Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [Bearer_token] Use Query.Get when fetching QueryParameter #1106

Merged
merged 2 commits into from
Jun 19, 2023

Conversation

marbergq
Copy link
Contributor

@marbergq marbergq commented May 24, 2023

Fix for bug where the bearer_token authn consumes body.
Instead of using r.FormValue which parses body (and thus consumes it, so it's not available to upstream services), we can just use r.URL.Query().Get(*tokenLocation.QueryParameter)

@CLAassistant
Copy link

CLAassistant commented May 24, 2023

CLA assistant check
All committers have signed the CLA.

@marbergq marbergq changed the title Use Query.Get when fetching query param fix: [Bearer_token] Use Query.Get when fetching QueryParameter May 24, 2023
@marbergq marbergq force-pushed the bugfix/bearer-consumes-body branch from b303046 to 6b06b92 Compare May 24, 2023 12:39
test/bearer-token/okapi/main.go Fixed Show fixed Hide fixed
test/bearer-token/okapi/main.go Fixed Show fixed Hide fixed
@codecov
Copy link

codecov bot commented May 24, 2023

Codecov Report

Merging #1106 (e4a3a24) into master (baeecc6) will increase coverage by 0.60%.
The diff coverage is 100.00%.

❗ Current head e4a3a24 differs from pull request most recent head a918d0e. Consider uploading reports for the commit a918d0e to get more accurate results

@@            Coverage Diff             @@
##           master    #1106      +/-   ##
==========================================
+ Coverage   77.64%   78.24%   +0.60%     
==========================================
  Files          80       80              
  Lines        3963     3843     -120     
==========================================
- Hits         3077     3007      -70     
+ Misses        607      564      -43     
+ Partials      279      272       -7     
Impacted Files Coverage Δ
driver/configuration/provider_koanf.go 88.88% <ø> (ø)
helper/bearer.go 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@marbergq marbergq force-pushed the bugfix/bearer-consumes-body branch from 9d7e75a to aab0e33 Compare May 24, 2023 13:32
@marbergq marbergq marked this pull request as ready for review May 24, 2023 14:11
@marbergq marbergq requested a review from aeneasr as a code owner May 24, 2023 14:11
@marbergq marbergq force-pushed the bugfix/bearer-consumes-body branch from 142115d to a918d0e Compare June 16, 2023 14:31
Copy link
Member

@aeneasr aeneasr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you! 🎉 Your contribution makes Ory better :)

@aeneasr aeneasr merged commit c520e50 into ory:master Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants