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

feat: preserve_host feature for oauth2_introspect #1131

Merged
merged 14 commits into from
Sep 8, 2023

Conversation

alnr
Copy link
Collaborator

@alnr alnr commented Aug 30, 2023

  • fixed lots of lint issues
  • bump to Go 1.21
  • fixed context passing, cancelation, and tracing in a couple of places
  • added the preserve_host option which already exists in the cookie_session and bearer_token authenticators to the oauth2_introspection authenticator.
  • added the prefix option to the oauth2_introspection and bearer_token authenticators. This allows you to filter out tokens based on a string prefix.

@alnr alnr self-assigned this Aug 30, 2023
@alnr alnr requested a review from aeneasr as a code owner August 30, 2023 13:56
@codecov
Copy link

codecov bot commented Aug 30, 2023

Codecov Report

Merging #1131 (aa9555c) into master (5bf9b70) will decrease coverage by 0.07%.
Report is 1 commits behind head on master.
The diff coverage is 87.17%.

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

@@            Coverage Diff             @@
##           master    #1131      +/-   ##
==========================================
- Coverage   78.22%   78.16%   -0.07%     
==========================================
  Files          80       80              
  Lines        3863     3898      +35     
==========================================
+ Hits         3022     3047      +25     
- Misses        566      576      +10     
  Partials      275      275              
Files Changed Coverage Δ
api/health.go 0.00% <ø> (ø)
metrics/prometheus.go 95.74% <ø> (ø)
credentials/fetcher_default.go 62.00% <64.28%> (-3.78%) ⬇️
driver/registry_memory.go 90.45% <100.00%> (ø)
middleware/grpc_middleware.go 72.41% <100.00%> (ø)
pipeline/authn/authenticator_bearer_token.go 76.05% <100.00%> (+1.81%) ⬆️
pipeline/authn/authenticator_cookie_session.go 81.03% <100.00%> (+0.85%) ⬆️
pipeline/authn/authenticator_jwt.go 83.87% <100.00%> (+0.82%) ⬆️
...e/authn/authenticator_oauth2_client_credentials.go 73.88% <100.00%> (ø)
...peline/authn/authenticator_oauth2_introspection.go 81.72% <100.00%> (+1.72%) ⬆️
... and 5 more

…tion authenticators

This allows selecting between the two authenticators based on a prefix to the token.
credentials/fetcher_default.go Show resolved Hide resolved
pipeline/authn/authenticator_jwt.go Outdated Show resolved Hide resolved
pipeline/authn/authenticator_oauth2_introspection.go Outdated Show resolved Hide resolved
aeneasr
aeneasr previously approved these changes Sep 6, 2023
@aeneasr
Copy link
Member

aeneasr commented Sep 6, 2023

Looks like the changes are causing issues with the cache!

@alnr
Copy link
Collaborator Author

alnr commented Sep 6, 2023

Looks like the changes are causing issues with the cache!

I've seen this flake before. Must be something internal to ristretto. Couldn't reproduce it locally, even with go test -count=100 🤷

@alnr alnr enabled auto-merge (rebase) September 6, 2023 11:42
Benehiko
Benehiko previously approved these changes Sep 7, 2023
spec/config.schema.json Outdated Show resolved Hide resolved
spec/config.schema.json Outdated Show resolved Hide resolved
Co-authored-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
@aeneasr aeneasr dismissed stale reviews from Benehiko and themself via ada70db September 7, 2023 13:00
Co-authored-by: Alano Terblanche <18033717+Benehiko@users.noreply.github.com>
@aeneasr aeneasr merged commit b5d4d88 into master Sep 8, 2023
22 checks passed
@aeneasr aeneasr deleted the oauth-introspect-host branch September 8, 2023 07:57
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