Skip to content

Commit

Permalink
Merge pull request #16 from fulll/fix-signature-ttl-type-hint
Browse files Browse the repository at this point in the history
Fix signature TTL type hint
  • Loading branch information
nio-dtp authored Feb 28, 2023
2 parents d5842c5 + 8ca314d commit 112ceae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 3 additions & 1 deletion Security/Firewall/RequestSignatureListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ public function authenticate(Request $request): Passport
throw new UnauthorizedHttpException('Signature must be filled.');
}

$signatureTtlParameter = $this->signatureQueryParameters->getTimeQueryParameter();

$signedRequest = new SignedRequest(
$request->server->get('REQUEST_METHOD'),
$request->server->get('HTTP_HOST'),
$request->getPathInfo(),
rawurldecode($request->getContent()),
$request->get($this->signatureQueryParameters->getTimeQueryParameter()),
$request->query->has($signatureTtlParameter) ? $request->query->getInt($signatureTtlParameter) : null,
);

try {
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,6 @@ parameters:
count: 1
path: Security/Firewall/RequestSignatureListener.php

-
message: "#^Parameter \\#5 \\$signatureTime of class Rezzza\\\\SecurityBundle\\\\Security\\\\Firewall\\\\SignedRequest constructor expects int\\|null, mixed given\\.$#"
count: 1
path: Security/Firewall/RequestSignatureListener.php

-
message: "#^Property Rezzza\\\\SecurityBundle\\\\Security\\\\Firewall\\\\RequestSignatureListener\\:\\:\\$tokenStorage is never read, only written\\.$#"
count: 1
Expand Down

0 comments on commit 112ceae

Please sign in to comment.