Skip to content

Commit

Permalink
fix(ocm): psalm
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <[email protected]>
  • Loading branch information
ArtificialOwl committed Nov 21, 2024
1 parent 250f68a commit c7683aa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
12 changes: 0 additions & 12 deletions lib/private/Security/Signature/Model/IncomingSignedRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,6 @@ public function getKeyId(): string {
return $this->getSignatureElement('keyId');
}

/**
* @return SignatureAlgorithm
* @throws SignatureElementNotFoundException
*/
public function getUsedEncryption(): SignatureAlgorithm {
try {
return SignatureAlgorithm::from($this->getSignatureElement('algorithm'));
} catch (\Exception) {
throw new SignatureElementNotFoundException('unknown algorithm');
}
}

public function jsonSerialize(): array {
return array_merge(
parent::jsonSerialize(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ public function getHost(): string {
* @inheritDoc
*
* @param string $key
* @param string|int|float|bool|array $value
* @param string|int|float $value
*
* @return IOutgoingSignedRequest
* @since 31.0.0
*/
public function addHeader(string $key, string|int|float|bool $value): IOutgoingSignedRequest {
public function addHeader(string $key, string|int|float $value): IOutgoingSignedRequest {
$this->headers[$key] = $value;
return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/private/Security/Signature/SignatureManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ private function verifySignedRequest(IIncomingSignedRequest $signedRequest): voi
$signedRequest->getClearSignature(),
$signedRequest->getSignedSignature(),
$publicKey,
$signedRequest->getUsedEncryption()
SignatureAlgorithm::tryFrom($signedRequest->getSignatureElement('algorithm')) ?? SignatureAlgorithm::SHA256
);
} catch (InvalidSignatureException $e) {
$this->logger->debug('signature issue', ['signed' => $signedRequest, 'exception' => $e]);
Expand Down

0 comments on commit c7683aa

Please sign in to comment.