MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / scrubAuthInfo

Function scrubAuthInfo

src/lib/login-authenticator.ts:55–59  ·  view source on GitHub ↗

* Convert to string and scrub sensitive values * Meant to be used before logging

(authInfo?: AuthenticationInfo)

Source from the content-addressed store, hash-verified

53 * Meant to be used before logging
54 */
55function 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
61export const loginAuthenticator = (
62 credentialsFile: string,

Callers 2

loginAuthenticatorFunction · 0.70
loginFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected