From 3c761513eb03968b9564039d768e32e3ce96fe79 Mon Sep 17 00:00:00 2001 From: Ryan Liang Date: Fri, 25 Aug 2023 09:29:17 -0700 Subject: [PATCH] Fix comment - Craig Signed-off-by: Ryan Liang --- .../action/onbehalf/CreateOnBehalfOfTokenAction.java | 6 +++--- .../org/opensearch/security/authtoken/jwt/JwtVendor.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/opensearch/security/action/onbehalf/CreateOnBehalfOfTokenAction.java b/src/main/java/org/opensearch/security/action/onbehalf/CreateOnBehalfOfTokenAction.java index 8f5c6b86bb..8a2f730236 100644 --- a/src/main/java/org/opensearch/security/action/onbehalf/CreateOnBehalfOfTokenAction.java +++ b/src/main/java/org/opensearch/security/action/onbehalf/CreateOnBehalfOfTokenAction.java @@ -143,7 +143,7 @@ public void accept(RestChannel channel) throws Exception { final String service = (String) requestBody.getOrDefault("service", DEFAULT_SERVICE); final User user = threadPool.getThreadContext().getTransient(ConfigConstants.OPENDISTRO_SECURITY_USER); - Set mappedRoles = mapRoles(user, /*Do not include host based mappings*/ null); + Set mappedRoles = mapRoles(user); builder.startObject(); builder.field("user", user.getName()); @@ -173,8 +173,8 @@ public void accept(RestChannel channel) throws Exception { }; } - public Set mapRoles(final User user, final TransportAddress caller) { - return this.configModel.mapSecurityRoles(user, caller); + private Set mapRoles(final User user) { + return this.configModel.mapSecurityRoles(user, null); } } diff --git a/src/main/java/org/opensearch/security/authtoken/jwt/JwtVendor.java b/src/main/java/org/opensearch/security/authtoken/jwt/JwtVendor.java index d2860dacc6..5d3262799f 100644 --- a/src/main/java/org/opensearch/security/authtoken/jwt/JwtVendor.java +++ b/src/main/java/org/opensearch/security/authtoken/jwt/JwtVendor.java @@ -111,7 +111,7 @@ public String createJwt( Integer expirySeconds, List roles, List backendRoles, - Boolean roleSecurityMode + boolean roleSecurityMode ) throws Exception { final long nowAsMillis = timeProvider.getAsLong(); final Instant nowAsInstant = Instant.ofEpochMilli(timeProvider.getAsLong());