-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Drop username from AuthenticateRequest #88365
Drop username from AuthenticateRequest #88365
Conversation
Since transport client is no longer support for 8.x, the username field in AuthenticateRequest is not useful at all. At REST layer, the API never requires passing the username. Authentication should always be performed for the current authenticating/effective subject. This logic does not need to depend on the username. This PR drops the username field and makes the Request class a singleton. Relates: elastic#88335
Pinging @elastic/es-security (Team:Security) |
if (out.getVersion().before(Version.V_8_4_0)) { | ||
throw new IllegalStateException("cannot send authenticate request to a node of earlier version"); | ||
} |
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.
Throwing exception here since it is better to fail explicitly than guessing. But in practice this will never happen because AuthenticateRequest does not get sent across nodes.
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
...ore/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateRequest.java
Show resolved
Hide resolved
...ore/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateRequest.java
Outdated
Show resolved
Hide resolved
…security/action/user/AuthenticateRequest.java Co-authored-by: Tim Vernum <[email protected]>
…thenticate-request
Since transport client is no longer supported for 8.x, the username field
in AuthenticateRequest is not useful at all. At REST layer, the API
never requires passing the username. Authentication should always be
performed for the current authenticating/effective subject. This logic
does not need to depend on the username. This PR drops the username
field and makes the Request class a singleton.
Relates: #88335