-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Reindex-from-remote: Validate basic auth params #136501
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
Reindex-from-remote: Validate basic auth params #136501
Conversation
This fixes a bug in the reindex API where it did not correctly validate the request parameters for authenticating with a remote source using basic auth, which requires both username and password. 1. Prior to this change, a reindex request which set `source.remote.username` but not `source.remote.password` would result in a response with HTTP status code 500 (Internal Server Error). This will now result in a response with HTTP status code 400 (Bad Request). 2. Prior to this change, a reindex request which set `source.remote.password` but not `source.remote.username` would normally result in a response with HTTP status code 401 (Unuauthorized). (If the remote cluster does not require authentication, or if an API key or some other form of authentication is provided, the request would succeed, with the password silently ignored.) This will now result in a response with HTTP status code 400 (Bad Request).
Hi @PeteGillinElastic, I've created a changelog YAML for you. |
Hi @PeteGillinElastic, I've updated the changelog YAML for you. |
Pinging @elastic/es-data-management (Team:Data Management) |
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, thanks
…c-auth-validation
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!
left a nice-to-have, but i don't think it's that important so not blocking
server/src/main/java/org/elasticsearch/index/reindex/ReindexRequest.java
Show resolved
Hide resolved
This fixes a bug in the reindex API where it did not correctly validate the request parameters for authenticating with a remote source using basic auth. These require both username and password, and providing only one or the other is a user error. 1. Prior to this change, a reindex request which set `source.remote.username` but not `source.remote.password` would result in a response with HTTP status code 500 (Internal Server Error). This will now result in a response with HTTP status code 400 (Bad Request). 2. Prior to this change, a reindex request which set `source.remote.password` but not `source.remote.username` would normally result in a response with HTTP status code 401 (Unuauthorized). (If the remote cluster does not require authentication, or if an API key or some other form of authentication is provided, the request would succeed, with the password silently ignored.) This will now result in a response with HTTP status code 400 (Bad Request). The new behaviour more correctly indicates to the user that there is an error in their request. Closes elastic#135925
This fixes a bug in the reindex API where it did not correctly validate the request parameters for authenticating with a remote source using basic auth. These require both username and password, and providing only one or the other is a user error. 1. Prior to this change, a reindex request which set `source.remote.username` but not `source.remote.password` would result in a response with HTTP status code 500 (Internal Server Error). This will now result in a response with HTTP status code 400 (Bad Request). 2. Prior to this change, a reindex request which set `source.remote.password` but not `source.remote.username` would normally result in a response with HTTP status code 401 (Unuauthorized). (If the remote cluster does not require authentication, or if an API key or some other form of authentication is provided, the request would succeed, with the password silently ignored.) This will now result in a response with HTTP status code 400 (Bad Request). The new behaviour more correctly indicates to the user that there is an error in their request. Closes elastic#135925
This fixes a bug in the reindex API where it did not correctly validate the request parameters for authenticating with a remote source using basic auth. These require both username and password, and providing only one or the other is a user error. 1. Prior to this change, a reindex request which set `source.remote.username` but not `source.remote.password` would result in a response with HTTP status code 500 (Internal Server Error). This will now result in a response with HTTP status code 400 (Bad Request). 2. Prior to this change, a reindex request which set `source.remote.password` but not `source.remote.username` would normally result in a response with HTTP status code 401 (Unuauthorized). (If the remote cluster does not require authentication, or if an API key or some other form of authentication is provided, the request would succeed, with the password silently ignored.) This will now result in a response with HTTP status code 400 (Bad Request). The new behaviour more correctly indicates to the user that there is an error in their request. Closes #135925
This fixes a bug in the reindex API where it did not correctly validate the request parameters for authenticating with a remote source using basic auth. These require both username and password, and providing only one or the other is a user error. 1. Prior to this change, a reindex request which set `source.remote.username` but not `source.remote.password` would result in a response with HTTP status code 500 (Internal Server Error). This will now result in a response with HTTP status code 400 (Bad Request). 2. Prior to this change, a reindex request which set `source.remote.password` but not `source.remote.username` would normally result in a response with HTTP status code 401 (Unuauthorized). (If the remote cluster does not require authentication, or if an API key or some other form of authentication is provided, the request would succeed, with the password silently ignored.) This will now result in a response with HTTP status code 400 (Bad Request). The new behaviour more correctly indicates to the user that there is an error in their request. Closes #135925
This fixes a bug in the reindex API where it did not correctly validate the request parameters for authenticating with a remote source using basic auth. These require both username and password, and providing only one or the other is a user error. 1. Prior to this change, a reindex request which set `source.remote.username` but not `source.remote.password` would result in a response with HTTP status code 500 (Internal Server Error). This will now result in a response with HTTP status code 400 (Bad Request). 2. Prior to this change, a reindex request which set `source.remote.password` but not `source.remote.username` would normally result in a response with HTTP status code 401 (Unuauthorized). (If the remote cluster does not require authentication, or if an API key or some other form of authentication is provided, the request would succeed, with the password silently ignored.) This will now result in a response with HTTP status code 400 (Bad Request). The new behaviour more correctly indicates to the user that there is an error in their request. Closes #135925
This fixes a bug in the reindex API where it did not correctly validate the request parameters for authenticating with a remote source using basic auth. These require both username and password, and providing only one or the other is a user error.
Prior to this change, a reindex request which set
source.remote.username
but notsource.remote.password
would result in a response with HTTP status code 500 (Internal Server Error). This will now result in a response with HTTP status code 400 (Bad Request).Prior to this change, a reindex request which set
source.remote.password
but notsource.remote.username
would normally result in a response with HTTP status code 401 (Unuauthorized). (If the remote cluster does not require authentication, or if an API key or some other form of authentication is provided, the request would succeed, with the password silently ignored.) This will now result in a response with HTTP status code 400 (Bad Request).The new behaviour more correctly indicates to the user that there is an error in their request.
Closes #135925