Skip to content

feat: optional AccountingFirmId badge for RequestSignature#26

Open
nio-dtp wants to merge 1 commit into
masterfrom
feat/accounting-firm-id-badge
Open

feat: optional AccountingFirmId badge for RequestSignature#26
nio-dtp wants to merge 1 commit into
masterfrom
feat/accounting-firm-id-badge

Conversation

@nio-dtp

@nio-dtp nio-dtp commented Jul 8, 2026

Copy link
Copy Markdown

@nio-dtp nio-dtp force-pushed the feat/accounting-firm-id-badge branch 4 times, most recently from 46e1133 to e8547f8 Compare July 8, 2026 07:18
@nio-dtp nio-dtp requested a review from Copilot July 8, 2026 07:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an optional AccountingFirmId badge to the request-signature authenticator so a configured firm identifier can be extracted from the request, attached to the Passport, and propagated into the resulting SignatureValidToken.

Changes:

  • Introduces AccountingFirmIdBadge and AccountingFirmIdBadgeConfig plus wiring to conditionally add the badge during authentication.
  • Extends SignatureValidToken to carry an optional accountingFirmId.
  • Adds DI configuration support (badges.accounting_firm_id), unit tests, and README documentation for the new option.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
Tests/Units/Security/Firewall/RequestSignatureListener.php Adds unit tests covering badge extraction and token propagation.
Security/SignatureValidToken.php Adds optional accountingFirmId storage + accessor on the token.
Security/Firewall/RequestSignatureListener.php Implements optional badge resolution and injects it into the token.
Security/Firewall/AccountingFirmIdBadgeConfig.php Adds config value object for badge source/name.
Security/Badge/AccountingFirmIdBadge.php Adds new passport badge carrying the firm id.
Resources/config/services/security.php Updates base service definition to include the new optional ctor argument.
README.md Documents new badges.accounting_firm_id configuration behavior.
phpstan-baseline.neon Removes baseline entries now addressed via improved typing annotations.
DependencyInjection/Security/Factory/RequestSignatureFactory.php Adds config schema + service definition for the badge config and better PHPStan typing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Security/Firewall/RequestSignatureListener.php Outdated
Comment on lines +77 to +81
if (null !== $this->accountingFirmIdBadgeConfig) {
$passport->addBadge(new AccountingFirmIdBadge($this->resolveAccountingFirmId(
$request,
$this->accountingFirmIdBadgeConfig,
)));

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Kevin-koko de ce que j'ai compris c'est Kong qui ajoute le header. Si c'est le cas, je pense qu'on a pas besoin de l'ajouter dans la signature. Ya un truc qui m'échappe peut-être ?

Comment thread DependencyInjection/Security/Factory/RequestSignatureFactory.php Outdated
@nio-dtp nio-dtp force-pushed the feat/accounting-firm-id-badge branch from e8547f8 to a65615d Compare July 8, 2026 07:33
@nio-dtp nio-dtp marked this pull request as ready for review July 10, 2026 09:11
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