99designs / http-signatures-php

Sign and verify PSR-7 HTTP messages in PHP.
MIT License
44 stars 32 forks source link

PSR-7 support #19

Closed navitronic closed 8 years ago

navitronic commented 8 years ago

This PR adds support for signing and verifying PSR-7, as opposed to Symfony requests.

This change is a BC break and will require a 4.0 release

vinkla commented 8 years ago

:+1:

navitronic commented 8 years ago

note: relies on phpDoc changes in #13, so might look a touch messy right now.

pda commented 8 years ago

Let me know when #13 is merged and this PR is rebased onto the resulting master.

rubensayshi commented 8 years ago

tests are failing because the symfony Request does ::normalizeQueryString:

* It builds a normalized query string, where keys/value pairs are alphabetized,
* have consistent escaping and unneeded delimiters are removed.

only solution I see is making a custom DiactorosFactory which doesn't let symfony nomalize the qs:

        // use raw QUERY_STRING to avoid symfony normalizing it
        if (null !== $qs = $symfonyRequest->server->get('QUERY_STRING')) {
            $qs = '?'.$qs;
        }

        $uri = $symfonyRequest->getSchemeAndHttpHost().$symfonyRequest->getBaseUrl().$symfonyRequest->getPathInfo().$qs;
rubensayshi commented 8 years ago

@navitronic I've been awaiting this for a while now, if there's anything we can do to get this merged asap then please let me know !

navitronic commented 8 years ago

@rubensayshi This is now merged. I will update the README at some point today and release a 3.0

rubensayshi commented 7 years ago

awesome thx !!