Skip to content

Commit

Permalink
Confine change
Browse files Browse the repository at this point in the history
Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks committed Oct 22, 2024
1 parent bc7b2ea commit 850cea5
Showing 1 changed file with 12 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -644,19 +644,17 @@ public void logDocumentWritten(ShardId shardId, GetResult originalResult, Index
XContentType.JSON
)
) {
if (auditConfigFilter.shouldLogRequestBody()) {
Object base64 = parser.map().values().iterator().next();
if (base64 instanceof String) {
msg.addSecurityConfigContentToRequestBody(
new String(BaseEncoding.base64().decode((String) base64), StandardCharsets.UTF_8),
id
);
} else {
msg.addSecurityConfigTupleToRequestBody(
new Tuple<XContentType, BytesReference>(XContentType.JSON, currentIndex.source()),
id
);
}
Object base64 = parser.map().values().iterator().next();
if (base64 instanceof String) {
msg.addSecurityConfigContentToRequestBody(
new String(BaseEncoding.base64().decode((String) base64), StandardCharsets.UTF_8),
id
);
} else {
msg.addSecurityConfigTupleToRequestBody(
new Tuple<XContentType, BytesReference>(XContentType.JSON, currentIndex.source()),
id
);
}
} catch (Exception e) {
log.error(e.toString());
Expand All @@ -671,9 +669,7 @@ public void logDocumentWritten(ShardId shardId, GetResult originalResult, Index
// originalResult.internalSourceRef()));

// current source, normally not null or empty
if (auditConfigFilter.shouldLogRequestBody()) {
msg.addTupleToRequestBody(new Tuple<MediaType, BytesReference>(XContentType.JSON, currentIndex.source()));
}
msg.addTupleToRequestBody(new Tuple<MediaType, BytesReference>(XContentType.JSON, currentIndex.source()));
}

}
Expand Down

0 comments on commit 850cea5

Please sign in to comment.