-
Notifications
You must be signed in to change notification settings - Fork 1.9k
oauth2: harden configuration, JWKS refresh, and token lifetimes #12106
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
Open
edsiper
wants to merge
11
commits into
master
Choose a base branch
from
oauth2-end-to-end-audit-noissue
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
88b80bb
in_http: advertise oauth2 jwt validation support
edsiper c524d35
in_opentelemetry: advertise oauth2 jwt validation support
edsiper 98ba020
input: reject unsupported oauth2 jwt properties
edsiper add867a
out_http: advertise oauth2 authentication support
edsiper ae29881
out_opentelemetry: advertise oauth2 authentication support
edsiper d0183c6
output: reject unsupported oauth2 properties
edsiper 36fe502
oauth2: correct token lifetime handling
edsiper 0ed0605
oauth2_jwt: preserve keys after failed refresh
edsiper 20b3df7
tests: internal: cover oauth2 token lifetimes
edsiper e03fc0d
tests: integration: cover unsupported oauth2 and lifetimes
edsiper a3f5814
tests: integration: cover jwks refresh fallback
edsiper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
tests/integration/scenarios/in_http/config/in_http_oauth2_refresh.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| service: | ||
| flush: 1 | ||
| log_level: info | ||
| http_server: on | ||
| http_port: ${FLUENT_BIT_HTTP_MONITORING_PORT} | ||
|
|
||
| pipeline: | ||
| inputs: | ||
| - name: http | ||
| port: ${FLUENT_BIT_TEST_LISTENER_PORT} | ||
| oauth2.validate: true | ||
| oauth2.issuer: issuer | ||
| oauth2.jwks_url: http://127.0.0.1:${TEST_SUITE_HTTP_PORT}/jwks | ||
| oauth2.jwks_refresh_interval: 1 | ||
| oauth2.allowed_audience: audience | ||
| oauth2.allowed_clients: client1 | ||
|
|
||
| outputs: | ||
| - name: http | ||
| match: '*' | ||
| host: 127.0.0.1 | ||
| port: ${TEST_SUITE_HTTP_PORT} | ||
| uri: /data | ||
| format: json | ||
| json_date_key: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This skew adjustment only affects the
flb_oauth2_get_access_token()path, but several existing plugins still decide whether to refresh withflb_oauth2_token_expired()and then reusectx->o->access_tokendirectly (for example BigQuery, Chronicle, Stackdriver, and Azure outputs). Since this commit now stores the fullexpires_ininstead of the old 10% shortened lifetime, those callers lose their only early-refresh margin and can send a token right up to its exact expiry under normal output traffic; please apply the same skew logic inflb_oauth2_token_expired()or migrate those callers to the skew-aware path.Useful? React with 👍 / 👎.