-
Notifications
You must be signed in to change notification settings - Fork 11
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
SECAUTH-1475 Calls jwks endpoint with x-zone_uuid header #16
Conversation
- handles 400 (Bad request) status code - memorizes the zones that were already accepted - avoids jwks call in case zone was already accepted and keys are not yet expired - removes singleFlight here, as GetJWKs is parameterized with zone id -> sync required?
Hi @nenaraab Another possible improvement is the use of map for |
Hi @f-blass The usage of map[string]bool for zoneIDs is a good idea. In the first draft I’ve added zoneID as key but then I realized that the jwks are the same for all zones (normally up to 20, but for shared ias tenant it could be 1000) that are “assigned” to the same identity tenant… in order to reduce memory I decided to remove the single flight, but maybe we can synchronize the call to identity differently - considering the url AND the x-zone_uuid header… |
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.
Looks good now. 👍🏼
For the future we can maybe think about adding a concurrent test to be run with race detector.
sync.RWMutex
to avoid concurrent remote calls to fetch jwks per zone