-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Remove deprecated Authentication#getUser #91069
Conversation
This PR removes the deprecated Authentication#getUser method and replaces its usages with #getEffectiveSubject#getUser. Relates: elastic#88494
Pinging @elastic/es-security (Team:Security) |
Failure is unrelated. It's reproducible on the main branch and I raised #91070 |
@elasticmachine run elasticsearch-ci/part-2 |
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.
LGTM
logger.trace( | ||
"Looking up run-as user [{}] for authenticated user [{}]", | ||
runAsUsername, | ||
authentication.getEffectiveSubject().getUser().principal() |
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.
Should we use getAuthenticatingSubject
here instead? I know at this stage in the flow that will be the same as getEffectiveSubject
but it's slightly more accurate. No need to do it as part of this PR since it may have cascading changes to tests where we mock
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.
Good catch! I'll update this and below to use getAuthenticatingSubject
. Will fix the tests if there are any failure. Thanks!
#91069 removed this method. This commit removes the usage from the examples.
This PR removes the deprecated Authentication#getUser method and replaces its usages with #getEffectiveSubject#getUser.
Relates: #88494