File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -182,10 +182,9 @@ private boolean hasIndicesWithFailuresSelector(TransportRequest request) {
182182 }
183183
184184 private String authenticatedUserDescription (Authentication authentication ) {
185- String userText = (authentication .isServiceAccount () ? "service account" : "user" )
186- + " ["
187- + authentication .getAuthenticatingSubject ().getUser ().principal ()
188- + "]" ;
185+ String userText = (authentication .isServiceAccount () ? "service account"
186+ : authentication .isCloudApiKey () ? "cloud API key"
187+ : "user" ) + " [" + authentication .getAuthenticatingSubject ().getUser ().principal () + "]" ;
189188 if (authentication .isAuthenticatedAsApiKey () || authentication .isCrossClusterAccess ()) {
190189 final String apiKeyId = (String ) authentication .getAuthenticatingSubject ()
191190 .getMetadata ()
@@ -208,7 +207,7 @@ private String authenticatedUserDescription(Authentication authentication) {
208207 // package-private for tests
209208 String rolesDescription (Subject subject , @ Nullable AuthorizationEngine .AuthorizationInfo authorizationInfo ) {
210209 // We cannot print the roles if it's an API key or a service account (both do not have roles, but privileges)
211- if (subject .getType () != Subject .Type .USER ) {
210+ if (subject .getType () != Subject .Type .USER && subject . getType () != Subject . Type . CLOUD_API_KEY ) {
212211 return "" ;
213212 }
214213
You can’t perform that action at this time.
0 commit comments