Skip to content

Commit

Permalink
Support PEP passing the policy in the TryAccess request
Browse files Browse the repository at this point in the history
  • Loading branch information
Daven00 committed Sep 2, 2024
1 parent d7f94c2 commit f66b7c4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,13 @@ private static void handleTryAccessRequest(JsonIn jsonIn) {

// make the actual try access request to the UCS
String request = new String(Base64.getDecoder().decode(messageIn.getRequest()));

String policy = (messageIn.getPolicy() != null)
? new String(Base64.getDecoder().decode(messageIn.getPolicy()))
: null;

TryAccessResponseMessage response =
ucsClient.tryAccess(request, null, getIdFromJson(jsonIn), getMessageIdFromJson(jsonIn));
ucsClient.tryAccess(request, policy, getIdFromJson(jsonIn), getMessageIdFromJson(jsonIn));

// build the json object
JsonOut jsonOut = response == null ?
Expand Down
2 changes: 1 addition & 1 deletion UCSDht/src/main/java/it/cnr/iit/ucsdht/UCSClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private TryAccessMessage buildTryAccessMessage(String request, String policy, St
// I can't figure out its purpose yet.
TryAccessMessage message = new TryAccessMessage(pepId, pepProperties.getUri(), messageId);
message.setRequest(request);
// message.setPolicy(policy);
message.setPolicy(policy);
return message;
}

Expand Down

0 comments on commit f66b7c4

Please sign in to comment.