소스 검색

Read operator privs enabled from Env settings (#98246)

Security.settings incorrectly caches the node startup settings which
does not take into account setting changes that may take place after the
node has started (e.g. "addtionalSettings()" from plugins).

This commit fixes the behaviour for the OperatorPrivileges enabled
setting, until the bug can be fixed more generally
Tim Vernum 2 년 전
부모
커밋
2aca985e29
2개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 0
      docs/changelog/98246.yaml
  2. 1 1
      x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java

+ 5 - 0
docs/changelog/98246.yaml

@@ -0,0 +1,5 @@
+pr: 98246
+summary: Read operator privs enabled from Env settings
+area: Authorization
+type: enhancement
+issues: []

+ 1 - 1
x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java

@@ -905,7 +905,7 @@ public class Security extends Plugin
         final AuthenticationFailureHandler failureHandler = createAuthenticationFailureHandler(realms, extensionComponents);
 
         // operator privileges are enabled either explicitly via the setting or if running serverless
-        final boolean operatorPrivilegesEnabled = OPERATOR_PRIVILEGES_ENABLED.get(settings) || DiscoveryNode.isServerless();
+        final boolean operatorPrivilegesEnabled = OPERATOR_PRIVILEGES_ENABLED.get(environment.settings()) || DiscoveryNode.isServerless();
 
         if (operatorPrivilegesEnabled) {
             logger.info("operator privileges are enabled");