Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/819 add api option to get request response printed to log #820

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
#819: automatically remove access token from REST requests before log…
…ging them
JoernBerkefeld committed Mar 27, 2023
commit a8a358afa9fe2a006c5fea835e0beea870543fa6
2 changes: 2 additions & 0 deletions lib/util/auth.js
Original file line number Diff line number Diff line change
@@ -123,6 +123,8 @@ function setupSDK(sessionKey, authObject) {
/<fueloauth(.*)<\/fueloauth>/gim,
'<fueloauth>*** TOKEN REMOVED ***</fueloauth>'
);
} else if (msg.headers?.Authorization) {
msg.headers.Authorization = 'Bearer *** TOKEN REMOVED ***';

Check failure

Code scanning / CodeQL

Hard-coded credentials

The hard-coded value "Bearer *** TOKEN REMOVED ***" is used as [authorization header](1).
}
if (Util.OPTIONS.api === 'cli') {
console.log(`${Util.color.fgMagenta}API REQUEST >>${Util.color.reset}`, msg); // eslint-disable-line no-console