-
Notifications
You must be signed in to change notification settings - Fork 677
feat(pgwire): implement OAuth audience validation #23155
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
base: main
Are you sure you want to change the base?
Conversation
Seems to solve the same issue as this one 🥵 : #23143 . |
metadata: &HashMap<String, String>, | ||
) -> Result<bool, BoxedError> { | ||
let header = decode_header(jwt)?; | ||
let _header = decode_header(jwt)?; |
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.
let _header = decode_header(jwt)?; |
} | ||
|
||
fn audience_from_cluster_id(cluster_id: &str) -> String { | ||
format!("urn:risingwave:cluster:{}", cluster_id) |
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.
Please add a user-facing
label to this PR, along with any necessary documentation. Especially the audience format, which will be used to generate the token.
With aud becoming a required field after this PR, Cloud must patch and deploy a version that generates tokens with the audience
in the specified format, prior to any releases. Cc @xuhui-lu .
And @yuhao-su, we also need a way to expose the internal cluster_id
to Cloud, perhaps via a SQL function.
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
This PR implements OAuth audience validation. Fixed #23126 .
Summary of changes:
aud
) validation functionalityHow does this PR work:
The changes add validation logic to ensure that OAuth tokens contain the correct audience claim before accepting authentication.
Checklist
Documentation
Release note
https://docs.risingwave.com/sql/commands/sql-create-user
We need to update this page to tell users when use
oauth
, the jwt should contains aaud
claim with valueurn:risingwave:cluster:your_cluster_id
🤖 Generated with Claude Code