Skip to content

Commit

Permalink
chore: standardize egress audit key (#423)
Browse files Browse the repository at this point in the history
* chore: standardize egress audit key

* chore(snapshot): 18.14.1-snapshot.0

* chore: remove unneeded stringify

* chore(snapshot): 18.14.1-snapshot.1
  • Loading branch information
kleyow authored Dec 12, 2024
1 parent 96b705b commit fa5ff1e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/central-services-shared",
"version": "18.14.0",
"version": "18.14.1-snapshot.1",
"description": "Shared code for mojaloop central services",
"license": "Apache-2.0",
"author": "ModusBox",
Expand Down
10 changes: 9 additions & 1 deletion src/util/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,15 @@ const sendRequest = async ({

if (span) {
requestOptions = span.injectContextToHttpRequest(requestOptions)
span.audit(requestOptions, EventSdk.AuditEventAction.egress)
const { data, ...rest } = requestOptions
if (typeof payload === 'string') {
try {
payload = JSON.parse(payload)
} catch (e) {
// do nothing
}
}
span.audit({ ...rest, payload }, EventSdk.AuditEventAction.egress)
}
logger.debug('sendRequest::requestOptions:', { requestOptions })
const response = await request(requestOptions)
Expand Down

0 comments on commit fa5ff1e

Please sign in to comment.