Skip to content

Commit

Permalink
fix policy mapper to replace "-" with "_", and clean up error logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ogazitt committed Jun 21, 2024
1 parent 0b35c2a commit 8ee7436
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public AuthorizationDecision check(HttpServletRequest httpRequest, IdentityMappe
List<Decision> decisions = authzClient.is(identityCtx, policyCtx, resourceCtx);
isAllowed = isAllowed(decisions);
} catch (Exception e) {
log.error("Is call failed [{}]", e.getMessage());
log.error("Is call failed", e);
return new AuthorizationDecision(false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public String policyPath(HttpServletRequest request) {
if (tokens[i].startsWith("{") && tokens[i].endsWith("}")) {
tokens[i] = "__" + tokens[i].substring(1, tokens[i].length() - 1);
}
tokens[i] = tokens[i].replaceAll("-", "_");
}

return policyRoot + "." + method.toUpperCase() + "." + String.join(".", tokens);
Expand Down

0 comments on commit 8ee7436

Please sign in to comment.