Skip to content

Commit 8e2eb39

Browse files
SecuritySettingsSource license.self_generated: trial (#38233)
Authn is enabled only if `license_type` is non `basic`, but `basic` is what the `LicenseService` generates implicitly. This commit explicitly sets license type to `trial`, which allows for authn, in the `SecuritySettingsSource` which is the settings configuration parameter for `InternalTestCluster`s. The real problem, that had created tests failures like #31028 and #32685, is that the check `licenseState.isAuthAllowed()` can change sporadically. If it were to return `true` or `false` during the whole test there would be no problem. The problem manifests when it turns from `true` to `false` right before `Realms.asList()`. There are other license checks before this one (request filter, token service, etc) that would not cause a problem if they would suddenly see the check as `false`. But switching to `false` before `Realms.asList()` makes it appear that no installed realms could have handled the authn token which is an authentication error, as can be seen in the failing tests. Closes #31028 #32685
1 parent 3b2a0d7 commit 8e2eb39

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

x-pack/plugin/security/src/test/java/org/elasticsearch/test/SecuritySettingsSource.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ public Settings nodeSettings(int nodeOrdinal) {
137137
.put(LoggingAuditTrail.EMIT_NODE_NAME_SETTING.getKey(), randomBoolean())
138138
.put(LoggingAuditTrail.EMIT_NODE_ID_SETTING.getKey(), randomBoolean())
139139
.put("xpack.security.authc.realms." + FileRealmSettings.TYPE + ".file.order", 0)
140-
.put("xpack.security.authc.realms." + NativeRealmSettings.TYPE + ".index.order", "1");
140+
.put("xpack.security.authc.realms." + NativeRealmSettings.TYPE + ".index.order", "1")
141+
.put("xpack.license.self_generated.type", "trial");
141142
addNodeSSLSettings(builder);
142143
return builder.build();
143144
}

0 commit comments

Comments
 (0)