Page MenuHomeDevCentral

Add convenience XHubSignature256 class to default to SHA-256
ClosedPublic

Authored by dereckson on Sun, Apr 19, 18:48.
Tags
None
Referenced Files
F28291058: D4086.id10714.diff
Mon, May 11, 05:31
F28285304: D4086.id10691.diff
Mon, May 11, 04:01
Unknown Object (File)
Sun, May 10, 18:57
Unknown Object (File)
Tue, May 5, 12:39
Unknown Object (File)
Mon, May 4, 04:19
Unknown Object (File)
Sun, May 3, 10:49
Unknown Object (File)
Sat, May 2, 21:48
Unknown Object (File)
Sat, May 2, 20:16
Subscribers
None

Details

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/src/XHubSignature256.php:32PHPCS.W.Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsedGeneric.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed
Warninggithub/src/XHubSignature256.php:53PHPCS.W.Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsedGeneric.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassAfterLastUsed
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 6653
Build 6939: 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.

This revision is now accepted and ready to land.Sat, Apr 25, 17:29
This revision was landed with ongoing or failed builds.Sat, Apr 25, 17:30
This revision was automatically updated to reflect the committed changes.