Skip to content

Commit

Permalink
fix: remove token from log (#43)
Browse files Browse the repository at this point in the history
* fix: remove token from log

* fix: format
  • Loading branch information
JordenReuter authored Jul 5, 2024
1 parent 3a482ae commit a55359f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.tkit.onecx.shell.bff.rs.ShellConfig;
import org.tkit.onecx.shell.bff.rs.mappers.ExceptionMapper;
import org.tkit.onecx.shell.bff.rs.mappers.PermissionMapper;
import org.tkit.quarkus.log.cdi.LogExclude;
import org.tkit.quarkus.log.cdi.LogService;

import gen.org.tkit.onecx.permission.client.api.PermissionApi;
Expand Down Expand Up @@ -67,7 +68,8 @@ public Response getPermissions(GetPermissionsRequestDTO getPermissionsRequestDTO
return Response.status(Response.Status.OK).entity(mapper.map(rawPermission)).build();
}

public PermissionResponse getPermissions(String productName, String appName, String token, String keySeparator) {
public PermissionResponse getPermissions(String productName, String appName, @LogExclude(mask = "****") String token,
String keySeparator) {
if (!config.permissions().cachingEnabled()) {
return getPermissionsLocal(productName, appName, token, keySeparator);
}
Expand All @@ -76,7 +78,8 @@ public PermissionResponse getPermissions(String productName, String appName, Str
.indefinitely();
}

public PermissionResponse getPermissionsLocal(String productName, String appName, String token, String keySeparator) {
public PermissionResponse getPermissionsLocal(String productName, String appName, @LogExclude(mask = "****") String token,
String keySeparator) {
try (Response response = permissionClient.getApplicationPermissions(productName, appName,
new PermissionRequest().token(token))) {
var data = response.readEntity(ApplicationPermissions.class);
Expand Down

0 comments on commit a55359f

Please sign in to comment.