MCPcopy Index your code
hub / github.com/api3dao/airnode / hideSecrets

Function hideSecrets

docker/scripts/utils.ts:7–20  ·  view source on GitHub ↗
(command: string, options?: ExecSyncOptions)

Source from the content-addressed store, hash-verified

5import { goSync } from '@api3/promise-utils';
6
7const hideSecrets = (command: string, options?: ExecSyncOptions) => {
8 // There are currently 2 secrets being logged:
9 // * DockerHub auth token - stdin
10 // * GitHub auth token - remote URL
11 // Third secret, the NPM auth token, is stored in a file therefore not logged
12
13 // DockerHub auth token
14 const hiddenOptions = has(options, 'input') ? { ...options, input: '***' } : options;
15
16 // GitHub auth token
17 const hiddenCommand = command.replace(/(https:\/\/x-access-token):(.*?)(@github\.com.*$)/, '$1:***$3');
18
19 return { hiddenCommand, hiddenOptions };
20};
21
22export const runCommand = (command: string, options?: ExecSyncOptions) => {
23 const { hiddenCommand, hiddenOptions } = hideSecrets(command, options);

Callers 1

runCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected