php-rest-api
php-rest-api copied to clipboard
Request signature validation fixes
- Passing null when the header is missing causes a TypeError, as the signature must be a string.
$_SERVERparams were being accessed using undefined constants auto-converted to strings. Fix to use regular strings.- HTTP headers are usually keyed with
HTTP_prefix, and using all uppercase characters and underscores. The existing check for simplyMessageBird-Signature-JWTdid not pick up the header when using Apache. Maybe that works on other web servers, so I've left it as a fallback.
@ErikBooijMB is there anything I need to add to get this PR approved? I'm not sure how anyone could use signature validation currently as it seems to be entirely broken for us, and blocking using v3 of this package.