Replace license check isAuthAllowed with isSecurityEnabled#54547
Replace license check isAuthAllowed with isSecurityEnabled#54547rjernst merged 8 commits intoelastic:masterfrom
Conversation
The isAuthAllowed() method for license checking is used by code that wants to ensure security is both enabled and available. The enabled state is dynamic and provided by isSecurityEnabled(). But since security is available with all license types, an check on the license level is not necessary. Thus, this change replaces isAuthAllowed() with calling isSecurityEnabled().
|
Pinging @elastic/es-security (:Security/License) |
| assertBusy(() -> { | ||
| for (XPackLicenseState licenseState : internalCluster().getInstances(XPackLicenseState.class)) { | ||
| if (licenseState.isAuthAllowed() == false) { | ||
| if (licenseState.isSecurityEnabled() == false) { |
There was a problem hiding this comment.
We briefly chatted about this elsewhere but in this test class security should always be enabled so I think that this should no longer be in a loop over internal state but just go ahead and call enableLicensing(OperationMode.BASIC)
|
The test failure that occurs in this PR is due to a change in how Security works when the license mode is missing. Previously |
|
Thanks for the analysis @jaymode! After checking with @tvernum, I've removed the test in question. Since authentication is now allowed at all license levels with this change (it was only disallowed with MISSING, which should just be removed since the behavior should fallback to BASIC), the test no longer makes sense. |
…4547) The isAuthAllowed() method for license checking is used by code that wants to ensure security is both enabled and available. The enabled state is dynamic and provided by isSecurityEnabled(). But since security is available with all license types, an check on the license level is not necessary. Thus, this change replaces isAuthAllowed() with calling isSecurityEnabled().
…55082) The isAuthAllowed() method for license checking is used by code that wants to ensure security is both enabled and available. The enabled state is dynamic and provided by isSecurityEnabled(). But since security is available with all license types, an check on the license level is not necessary. Thus, this change replaces isAuthAllowed() with calling isSecurityEnabled().
The isAuthAllowed() method for license checking is used by code that
wants to ensure security is both enabled and available. The enabled
state is dynamic and provided by isSecurityEnabled(). But since security
is available with all license types, an check on the license level is
not necessary. Thus, this change replaces isAuthAllowed() with calling
isSecurityEnabled().