* Convert to string and scrub sensitive values * Meant to be used before logging
(authInfo?: AuthenticationInfo)
| 53 | * Meant to be used before logging |
| 54 | */ |
| 55 | function scrubAuthInfo(authInfo?: AuthenticationInfo): string { |
| 56 | const message = JSON.stringify(authInfo) |
| 57 | const tokenRegex = /"([\w]*token":"[0-9a-f]{8}).+?"/ig |
| 58 | return message.replace(tokenRegex, '"$1-xxxx-xxxx-xxxx-xxxxxxxxxxxx"') |
| 59 | } |
| 60 | |
| 61 | export const loginAuthenticator = ( |
| 62 | credentialsFile: string, |
no outgoing calls
no test coverage detected