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

maintain a static map of trusted roles for resource list lookup api #2476

Merged
merged 1 commit into from
Jan 5, 2024

Conversation

havetisyan
Copy link
Collaborator

@havetisyan havetisyan commented Jan 5, 2024

Description

when we get large number of simultaneous listResourceAccess calls, all try to get the current list of trust roles setup in the server. This could get quite large so all the threads are busy getting large number of rows from DB. However, in most cases, those never change so there is no need to fetch the list for every request. So now we're maintaining a static map of the roles to address the case with large simultaneous calls:
a) by default we drop the map every 10 minutes so any deletions to the rows can be reflected in 10 minutes. This could be changed by the specifying the different value for the athenz.zms.mysql_server_trust_roles_update_timeout property value in milliseconds (default 600,000).
b) we check the last modification timestamp of the policy that has an assertion with assume_role action. this way new assertions are in effect immediately

Contribution Checklist:

  • The pull request does not introduce any breaking changes
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Attach Screenshots (Optional)

Signed-off-by: Henry Avetisyan <hga@yahooinc.com>
@abvaidya abvaidya merged commit 57006c9 into master Jan 5, 2024
2 checks passed
@abvaidya abvaidya deleted the trust-role-map branch January 5, 2024 02:56
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.

2 participants