-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(users): add tenant id reads in user roles #6661
base: main
Are you sure you want to change the base?
Conversation
Changed Files
|
@@ -1864,6 +1864,7 @@ pub mod routes { | |||
.global_store | |||
.list_user_roles_by_user_id(ListUserRolesByUserIdPayload { | |||
user_id: &auth.user_id, | |||
tenant_id: auth.tenant_id.as_ref().unwrap_or(&state.tenant.tenant_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.
If default value if taken for tenant id not being present in auth token, then won't a user be able to access any tenancy if user gets access to a token with tenant_id: None
.
Are we ensuring tenant_id will never be null ?
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.
Tenant_id will always be present in token, i kept it option just for backward compatibility. We will be making it non option after one two deployments.
Also token tenant's id and state tenant id should be same, so we can use any. We are checking for this only in authentication part.
Moreover currently the feature is disabled, so we won't be having different tenancy support.
Type of Change
Description
Support tenant id in user roles queries.
Additional Changes
Motivation and Context
Closes #6660
How did you test it?
With tenancy feature flag enabled these changes will be tested when upcoming tenant related PRs from dashboard gets merged.
The current behaviour of user apis should not change. Since hyperswitch has its own tenant id and we don't have tenant_id feature flag enabled for now.
Tested the sanity flows for users. Working as expected.
Checklist
cargo +nightly fmt --all
cargo clippy