add validation for user principals after auth#3351
Merged
Conversation
Signed-off-by: Henry Avetisyan <hga@yahooinc.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces user principal validation in both ZMS and ZTS services by integrating userAuthority and userDomain into the RsrcCtxWrapper. The validation logic ensures that users are active during authentication and authorization processes. Feedback from the review focuses on optimizing performance by implementing a flag to prevent redundant validation calls within a single request context. Additionally, the reviewer suggests enhancing error logging to explicitly signal misconfigurations when the required authority or domain properties are missing.
Signed-off-by: Henry Avetisyan <hga@yahooinc.com>
Signed-off-by: Henry Avetisyan <hga@yahooinc.com>
Signed-off-by: Henry Avetisyan <hga@yahooinc.com>
MartinTrojans
approved these changes
May 11, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Scenario:
a) user is issued a 24 hour user certificate at 8am
b) use is terminated at 10am and the user account is disabled in Athenz
With option (b), the user is no longer part of any role and/or group. However, the user still has a valid certificate for another 22 hours. If there are any roles that have "user." or "" members, then the user can still use its x.509 certificate to get an access token which should not be allowed. While we take the risk that the user's certificate will be valid for another 22 hours while connecting to other services, ZMS and ZTS themselves should not honor that certificate.
So now after every authenticate call, if the principal identity is the user domain, ZMS/ZTS validate the user with the configured user authority to make sure the user is still valid before processing the request.
Contribution Checklist:
Attach Screenshots (Optional)