Skip to content

Conversation

@Ayeshas09
Copy link
Contributor

@Ayeshas09 Ayeshas09 commented Nov 5, 2025

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:

  • 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

Why

To add the support of HMAC signature verification

Type of change

Select multiple if applicable.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause a breaking change)
  • Tests (adds or updates tests)
  • Documentation (adds or updates documentation)
  • Refactor (style improvements, performance improvements, code refactoring)
  • Revert (reverts a commit)
  • CI/Build (adds or updates a script, change in external dependencies)

Dependency Change

N/A

Breaking change

N/A

Testing

Unit tests are included in the PR for the new feature

Checklist

  • My code follows the coding conventions
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added new unit tests

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 5, 2025

Copy link

Copilot AI left a 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.

@asadali214 asadali214 merged commit 3baf8f0 into master Nov 6, 2025
11 checks passed
@asadali214 asadali214 deleted the feat-signature-verification branch November 6, 2025 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants