@@ -1239,6 +1239,7 @@ public <T> List<T> loadExtensions(Class<T> extensionPointType) {
12391239 assertThat (operatorPrivilegesService , is (NOOP_OPERATOR_PRIVILEGES_SERVICE ));
12401240 }
12411241
1242+
12421243 public void testAuthContextForSlowLog_LocalAccess_OriginalRealmUser () throws Exception {
12431244 createComponents (Settings .EMPTY );
12441245 AuthenticationContextSerializer serializer = new AuthenticationContextSerializer ();
@@ -1570,7 +1571,9 @@ public void testAuthContextForSlowLog_CCA_OriginalRunAsUser() throws Exception {
15701571 AuthenticationField .API_KEY_ID_KEY ,
15711572 "api_id_runas"
15721573 ),
1573- true );
1574+ true
1575+ );
1576+
15741577 Authentication baseApiKeyAuthRunAs = Authentication .newApiKeyAuthentication (
15751578 AuthenticationResult .success (
15761579 dummyApiKeyUserForRunAs ,
@@ -1587,23 +1590,19 @@ public void testAuthContextForSlowLog_CCA_OriginalRunAsUser() throws Exception {
15871590
15881591 serializer .writeToContext (outerCrossClusterAccessAuthRunAs , threadContext );
15891592
1590- // Call the method under test
15911593 Map <String , String > authContext = security .getAuthContextForSlowLog ();
15921594
1593- // Assert the results
15941595 assertNotNull (authContext );
1595- // user.name/realm should reflect the AUTHENTICATING user from querying cluster
15961596 assertThat (authContext .get ("user.name" ), equalTo ("authenticating_remote" ));
15971597 assertThat (authContext .get ("user.realm" ), equalTo ("remote_auth_realm" ));
15981598 assertThat (authContext .get ("user.full_name" ), equalTo ("Authenticating Remote User" ));
15991599
1600- // user.effective.* should reflect the EFFECTIVE user from querying cluster
16011600 assertThat (authContext .get ("user.effective.name" ), equalTo ("effective_remote" ));
16021601 assertThat (authContext .get ("user.effective.realm" ), equalTo ("remote_effective_realm" ));
16031602 assertThat (authContext .get ("user.effective.full_name" ), equalTo ("Effective Remote User" ));
16041603
1605- assertThat (authContext .get ("auth.type" ), equalTo (Authentication .AuthenticationType .REALM .name ())); // Type based on base auth
1606- assertFalse (authContext .containsKey ("apikey.id" )); // Not an API key
1604+ assertThat (authContext .get ("auth.type" ), equalTo (Authentication .AuthenticationType .REALM .name ()));
1605+ assertFalse (authContext .containsKey ("apikey.id" ));
16071606 assertFalse (authContext .containsKey ("apikey.name" ));
16081607 }
16091608
0 commit comments