Skip to content

Commit 1a38d49

Browse files
committed
Merge branch 'main' into xpack-usage-mp
2 parents 2cd5735 + 53a41db commit 1a38d49

File tree

3 files changed

+15
-12
lines changed

3 files changed

+15
-12
lines changed

muted-tests.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -485,21 +485,9 @@ tests:
485485
- class: org.elasticsearch.index.engine.ThreadPoolMergeExecutorServiceDiskSpaceTests
486486
method: testMergeTasksAreUnblockedWhenMoreDiskSpaceBecomesAvailable
487487
issue: https://github.com/elastic/elasticsearch/issues/129296
488-
- class: org.elasticsearch.xpack.security.PermissionsIT
489-
method: testCanManageIndexWithNoPermissions
490-
issue: https://github.com/elastic/elasticsearch/issues/129471
491-
- class: org.elasticsearch.xpack.security.PermissionsIT
492-
method: testCanManageIndexAndPolicyDifferentUsers
493-
issue: https://github.com/elastic/elasticsearch/issues/129479
494-
- class: org.elasticsearch.xpack.security.PermissionsIT
495-
method: testCanViewExplainOnUnmanagedIndex
496-
issue: https://github.com/elastic/elasticsearch/issues/129480
497488
- class: org.elasticsearch.xpack.profiling.action.GetStatusActionIT
498489
method: testWaitsUntilResourcesAreCreated
499490
issue: https://github.com/elastic/elasticsearch/issues/129486
500-
- class: org.elasticsearch.xpack.security.PermissionsIT
501-
method: testWhenUserLimitedByOnlyAliasOfIndexCanWriteToIndexWhichWasRolledoverByILMPolicy
502-
issue: https://github.com/elastic/elasticsearch/issues/129481
503491
- class: org.elasticsearch.xpack.esql.qa.multi_node.EsqlSpecIT
504492
method: test {knn-function.KnnSearchWithKOption SYNC}
505493
issue: https://github.com/elastic/elasticsearch/issues/129512
@@ -575,6 +563,9 @@ tests:
575563
- class: org.elasticsearch.multiproject.test.CoreWithMultipleProjectsClientYamlTestSuiteIT
576564
method: test {yaml=cluster.stats/10_basic/Dense vector stats}
577565
issue: https://github.com/elastic/elasticsearch/issues/130307
566+
- class: org.elasticsearch.multiproject.test.CoreWithMultipleProjectsClientYamlTestSuiteIT
567+
method: test {yaml=nodes.stats/11_indices_metrics/Lucene segment level fields stats}
568+
issue: https://github.com/elastic/elasticsearch/issues/130360
578569

579570
# Examples:
580571
#

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ public void createApiKey(
368368
ensureEnabled();
369369
if (authentication == null) {
370370
listener.onFailure(new IllegalArgumentException("authentication must be provided"));
371+
} else if (authentication.isCloudApiKey()) {
372+
listener.onFailure(new IllegalArgumentException("creating elasticsearch api keys using cloud api keys is not supported"));
371373
} else {
372374
final TransportVersion transportVersion = getMinTransportVersion();
373375
if (validateRoleDescriptorsForMixedCluster(listener, request.getRoleDescriptors(), transportVersion) == false) {

x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authc/ApiKeyServiceTests.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2557,6 +2557,16 @@ public void testCreationWillFailIfHashingThreadPoolIsSaturated() {
25572557
assertThat(e, is(rejectedExecutionException));
25582558
}
25592559

2560+
public void testCreationFailsIfAuthenticationIsCloudApiKey() throws InterruptedException {
2561+
final Authentication authentication = AuthenticationTestHelper.randomCloudApiKeyAuthentication();
2562+
final CreateApiKeyRequest createApiKeyRequest = new CreateApiKeyRequest(randomAlphaOfLengthBetween(3, 8), null, null);
2563+
ApiKeyService service = createApiKeyService(Settings.EMPTY);
2564+
final PlainActionFuture<CreateApiKeyResponse> future = new PlainActionFuture<>();
2565+
service.createApiKey(authentication, createApiKeyRequest, Set.of(), future);
2566+
final IllegalArgumentException iae = expectThrows(IllegalArgumentException.class, future);
2567+
assertThat(iae.getMessage(), equalTo("creating elasticsearch api keys using cloud api keys is not supported"));
2568+
}
2569+
25602570
public void testCachedApiKeyValidationWillNotBeBlockedByUnCachedApiKey() throws IOException, ExecutionException, InterruptedException {
25612571
final String apiKeyId1 = randomAlphaOfLength(12);
25622572
final String apiKey1 = randomAlphaOfLength(16);

0 commit comments

Comments
 (0)