Page MenuHomeDevCentral

Add convenience XHubSignature256 class to default to SHA-256
Needs ReviewPublic

Authored by dereckson on Sun, Apr 19, 18:48.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Maniphest Tasks
T2310: Support X-Hub-Signature-256
Summary

To update the default algo doesn't a good approach, especially as GitHub
has chosen to update the header from X-Hub-Signature to X-Hub-Signature-256.

This is a weird inheritance case where we would like to impose SHA-256
as algorithm but where the parent class allows algorithm override.

Ref T2310

Diff Detail

Repository
rKERUALD Keruald libraries development repository
Lint
Lint Errors
SeverityLocationCodeMessage
Errorgithub/tests/XHubSignature256Test.php:9PHPCS.E.PSR1.Classes.ClassDeclaration.MissingNamespacePSR1.Classes.ClassDeclaration.MissingNamespace
Warninggithub/src/XHubSignature256.php:15PHPCS.W.Generic.CodeAnalysis.UselessOverridingMethod.FoundGeneric.CodeAnalysis.UselessOverridingMethod.Found
Warninggithub/tests/XHubSignature256Test.php:1PHPCS.W.PSR1.Files.SideEffects.FoundWithSymbolsPSR1.Files.SideEffects.FoundWithSymbols
Unit
Test Failures
Branch
T2310-X-Hub-Signature-256
Build Status
Buildable 6654
Build 6940: arc lint + arc unit

Unit TestsBroken

TimeTest
0 msXHubSignature256Test
XHubSignature256Test::testValidate Error: Class "Keruald\GitHub\XHubSignature256" not found

Event Timeline

dereckson created this revision.

To put tests in a namespace is certainly a good idea, but that will be in a follow-up commit.

Unit tests

WindRiver
$ phpunit github
Switching to Composer phpunit:
PHPUnit 12.5-dev by Sebastian Bergmann and contributors.

Runtime:       PHP 8.3.30
Configuration: /home/dereckson/dev/keruald/_monorepo/core/phpunit.xml

........                                                            8 / 8 (100%)

Time: 00:00.016, Memory: 16.00 MB

OK (8 tests, 14 assertions)

Tests seem to require 8111582dd667f98fc11bd50e98b7a9e2d33ff149 to work, but change isn't rebased.