@@ -1239,6 +1239,7 @@ public <T> List<T> loadExtensions(Class<T> extensionPointType) {
1239
1239
assertThat (operatorPrivilegesService , is (NOOP_OPERATOR_PRIVILEGES_SERVICE ));
1240
1240
}
1241
1241
1242
+
1242
1243
public void testAuthContextForSlowLog_LocalAccess_OriginalRealmUser () throws Exception {
1243
1244
createComponents (Settings .EMPTY );
1244
1245
AuthenticationContextSerializer serializer = new AuthenticationContextSerializer ();
@@ -1570,7 +1571,9 @@ public void testAuthContextForSlowLog_CCA_OriginalRunAsUser() throws Exception {
1570
1571
AuthenticationField .API_KEY_ID_KEY ,
1571
1572
"api_id_runas"
1572
1573
),
1573
- true );
1574
+ true
1575
+ );
1576
+
1574
1577
Authentication baseApiKeyAuthRunAs = Authentication .newApiKeyAuthentication (
1575
1578
AuthenticationResult .success (
1576
1579
dummyApiKeyUserForRunAs ,
@@ -1587,23 +1590,19 @@ public void testAuthContextForSlowLog_CCA_OriginalRunAsUser() throws Exception {
1587
1590
1588
1591
serializer .writeToContext (outerCrossClusterAccessAuthRunAs , threadContext );
1589
1592
1590
- // Call the method under test
1591
1593
Map <String , String > authContext = security .getAuthContextForSlowLog ();
1592
1594
1593
- // Assert the results
1594
1595
assertNotNull (authContext );
1595
- // user.name/realm should reflect the AUTHENTICATING user from querying cluster
1596
1596
assertThat (authContext .get ("user.name" ), equalTo ("authenticating_remote" ));
1597
1597
assertThat (authContext .get ("user.realm" ), equalTo ("remote_auth_realm" ));
1598
1598
assertThat (authContext .get ("user.full_name" ), equalTo ("Authenticating Remote User" ));
1599
1599
1600
- // user.effective.* should reflect the EFFECTIVE user from querying cluster
1601
1600
assertThat (authContext .get ("user.effective.name" ), equalTo ("effective_remote" ));
1602
1601
assertThat (authContext .get ("user.effective.realm" ), equalTo ("remote_effective_realm" ));
1603
1602
assertThat (authContext .get ("user.effective.full_name" ), equalTo ("Effective Remote User" ));
1604
1603
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" ));
1607
1606
assertFalse (authContext .containsKey ("apikey.name" ));
1608
1607
}
1609
1608
0 commit comments