facile-it / php-openid-client

PHP OpenID Client
36 stars 7 forks source link

Support authorization endpoint containing query params #26

Closed antonioeatgoat closed 1 year ago

antonioeatgoat commented 1 year ago

Right now, if the well-known url provides an authorization endpoint containing a query, the AuthorizationService will build a wrong url, which will eventually contains the symbol ? twice.

This PR adds the unit test to spot the case, so adds some checks on the uri generation in order to prevent the problem. Even better would be to have to separate tests, one for the uri containing params and one for the uri without params, but this is up to you.

I wasn't able to perform a composer run psalm before opening the PR since it looks broken, I am sorry.

codecov[bot] commented 1 year ago

Codecov Report

Base: 59.89% // Head: 60.00% // Increases project coverage by +0.10% :tada:

Coverage data is based on head (9b3adca) compared to base (b47e83d). Patch coverage: 100.00% of modified lines in pull request are covered.

:exclamation: Current head 9b3adca differs from pull request most recent head 69687af. Consider uploading reports for the commit 69687af to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #26 +/- ## ============================================ + Coverage 59.89% 60.00% +0.10% - Complexity 465 466 +1 ============================================ Files 62 62 Lines 1521 1525 +4 ============================================ + Hits 911 915 +4 Misses 610 610 ``` | [Impacted Files](https://codecov.io/gh/facile-it/php-openid-client/pull/26?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=facile-it) | Coverage Δ | | |---|---|---| | [src/Service/AuthorizationService.php](https://codecov.io/gh/facile-it/php-openid-client/pull/26?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=facile-it#diff-c3JjL1NlcnZpY2UvQXV0aG9yaXphdGlvblNlcnZpY2UucGhw) | `49.56% <100.00%> (+1.81%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=facile-it). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=facile-it)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

thomasvargiu commented 1 year ago

Thanks @antonioeatgoat! Give me some time to fix psalm issues and I'll release it

antonioeatgoat commented 1 year ago

Thank you @thomasvargiu for the very quick feedback!

thomasvargiu commented 1 year ago

Released in 0.3.3