chore: Add review feedback

Throw when one of the headers are empty

Enumerate all the allowed algorithms in th NATIVE constant

Co-authored-by: Carl Schwan <carl@carlschwan.eu>
Signed-off-by: Micke Nordin <kano@sunet.se>
This commit is contained in:
Micke Nordin 2026-05-11 12:33:35 +02:00 committed by Micke Nordin
parent d8cafa1ba5
commit 1b4c9b21d2
2 changed files with 5 additions and 0 deletions

View file

@ -306,6 +306,9 @@ class Rfc9421IncomingSignedRequest extends SignedRequest implements
if ($value === '' && strtolower($component) === 'host') {
$value = $this->request->getServerHost();
}
if ($value === '') {
throw new IncomingRequestException('covered header is missing or empty: ' . $component);
}
$out[strtolower($component)] = $value;
}
return $out;

View file

@ -31,6 +31,8 @@ use Throwable;
final class Algorithm {
public const NATIVE = [
'rsa-v1_5-sha256',
'rsa-v1_5-sha384',
'rsa-v1_5-sha512',
'ecdsa-p256-sha256',
'ecdsa-p384-sha384',
'ed25519',