Skip to content

Commit

Permalink
Testing logs 3 for RHP
Browse files Browse the repository at this point in the history
  • Loading branch information
sahusanket committed Nov 29, 2024
1 parent 15dd77d commit 766af1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public void enforce(FullHttpRequest request, HttpResponder responder) throws Exc
permissions);
}
Queue<AuditLogContext> auditLogContextQueue = SecurityRequestContext.getAuditLogQueue();
LOG.warn("SANKET_TEST : in RPH : q size : {}", auditLogContextQueue.size());
//Clearing this so it doesn't get double write to messaging queue
//This should be written by the Client who is calling this service.
SecurityRequestContext.clearAuditLogQueue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ public void enforce(EntityId entity, Principal principal, Set<? extends Permissi
EnforcementResponse res = cacheEnabled
? authPolicyCache.get(authorizationPrivilege) : doEnforce(authorizationPrivilege);

LOG.warn("SANKET_TEST : Q size {}", res.getAuditLogContexts().size());

if (res.getAuditLogContexts() != null && !res.getAuditLogContexts().isEmpty()) {
SecurityRequestContext.enqueueAuditLogContext(res.getAuditLogContexts());
}
Expand Down Expand Up @@ -308,7 +310,7 @@ private EnforcementResponse doEnforce(AuthorizationPrivilege authorizationPrivil

Type queueType = new TypeToken<LinkedBlockingDeque<AuditLogContext>>(){}.getType();
Queue<AuditLogContext> deserializedQueue = GSON.fromJson(response.getResponseBodyAsString(), queueType);

LOG.warn("SANKET_TEST : deserializedQueue size {}", deserializedQueue.size());
if (response.getResponseCode() == HttpURLConnection.HTTP_OK) {
return new EnforcementResponse(true, deserializedQueue, null);
}
Expand Down

0 comments on commit 766af1e

Please sign in to comment.