-
Notifications
You must be signed in to change notification settings - Fork 25.2k
[Failure Store] Test API keys and skip_unavailable with RCS1 #125782
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
[Failure Store] Test API keys and skip_unavailable with RCS1 #125782
Conversation
…nt-using-selectors-for-ccs-ccr
…nt-using-selectors-for-ccs-ccr
…nt-using-selectors-for-ccs-ccr
…nt-using-selectors-for-ccs-ccr
…nt-using-selectors-for-ccs-ccr
…nt-using-selectors-for-ccs-ccr
Adjust existing RCS1 tests to randomize using API keys for authorization and `skip_unavailable` setting.
…ccs-with-api-keys # Conflicts: # x-pack/plugin/security/qa/multi-cluster/src/javaRestTest/java/org/elasticsearch/xpack/remotecluster/AbstractRemoteClusterSecurityFailureStoreRestIT.java # x-pack/plugin/security/qa/multi-cluster/src/javaRestTest/java/org/elasticsearch/xpack/remotecluster/RemoteClusterSecurityRCS1FailureStoreRestIT.java
public void testRCS1CrossClusterSearch() throws Exception { | ||
final boolean rcs1Security = true; | ||
final boolean isProxyMode = randomBoolean(); | ||
final boolean skipUnavailable = false; // we want to get actual failures and not skip and get empty results | ||
final boolean skipUnavailable = randomBoolean(); |
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.
Addressing this suggestion: https://github.com/elastic/elasticsearch/pull/125252/files#r2010058827
The result does come empty, but it also contains failure reason per remote cluster. Which is what I'm asserting on.
assertOK(client().performRequest(indexDocRequest)); | ||
} | ||
|
||
private static void setupUserAndRoleOnQueryCluster() throws IOException { |
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.
These changes are mostly refactorings in order to reuse the role definitions when creating API keys.
"names": ["local_index"], | ||
"privileges": ["read"] | ||
}, | ||
{ |
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.
The roles on query cluster now include index privileges which were previously only defined on fulfilling cluster. This is needed, because API keys are created on query cluster for each user. Without this, API keys would be useless as they would not have any privilege to access, because their roles are limited-by owning user's privileges.
Pinging @elastic/es-security (Team:Security) |
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
…#125782) Adjust existing RCS1 tests to randomize using API keys for authorization and `skip_unavailable` setting. Followup on elastic#125252
💚 Backport successful
|
Adjust existing RCS1 tests to randomize using API keys for authorization
and
skip_unavailable
setting.Followup on #125252