-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add hmac signature verifier #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…atic/core-lib-php into feat-signature-verification
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces HMAC signature verification functionality to the Core library, along with a utility for extracting values from JSON using JSON Pointer notation. The implementation includes comprehensive test coverage and refactors existing JSON pointer logic into a reusable utility class.
Key changes:
- Adds HMAC signature verification with configurable algorithms, encoding schemes, and signature templates
- Extracts JSON pointer functionality into a reusable utility class
- Adds Symfony HTTP Foundation dependency for request handling
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/SignatureVerifier/HmacSignatureVerifier.php | Core implementation of HMAC signature verification with support for multiple algorithms and encoding formats |
| src/SignatureVerifier/SignatureVerifierInterface.php | Interface defining the contract for signature verification implementations |
| src/SignatureVerifier/VerificationFailure.php | Simple value object for representing verification failures with error messages |
| src/Utils/JsonPointerValue.php | Utility class for extracting values from JSON strings using JSON Pointer paths |
| src/Response/Types/ErrorType.php | Refactored to use the new JsonPointerValue utility instead of duplicated implementation |
| tests/SignatureVerifierTest.php | Comprehensive test suite covering HMAC verification scenarios including edge cases and multiple encoding formats |
| tests/Mocking/SignatureVerifier/MockVerificationFailure.php | Test mock extending VerificationFailure for use in signature verification tests |
| tests/JsonPointerValueTest.php | Complete test coverage for JSON pointer value extraction including edge cases |
| composer.json | Adds symfony/http-foundation dependency and reformats autoload configuration |
| .phan/config.php | Updates static analysis configuration to include Symfony HTTP Foundation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.



What
This PR introduces HMAC signature verification functionality to the Core library, along with a utility for extracting values from JSON using JSON Pointer notation. The implementation includes comprehensive test coverage and refactors existing JSON pointer logic into a reusable utility class.
Key changes:
Why
To add the support of HMAC signature verification
Type of change
Select multiple if applicable.
Dependency Change
N/A
Breaking change
N/A
Testing
Unit tests are included in the PR for the new feature
Checklist