1 | import { StringMap } from '@naturalcycles/js-lib';
|
2 | /**
|
3 | * Loads plaintext secrets from process.env, removes them, stores locally.
|
4 | * Make sure to call this function early on server startup, so secrets are removed from process.env
|
5 | *
|
6 | * Does NOT delete previous secrets from secretMap.
|
7 | */
|
8 | export declare function loadSecretsFromEnv(): void;
|
9 | /**
|
10 | * Removes process.env.SECRET_*
|
11 | */
|
12 | export declare function removeSecretsFromEnv(): void;
|
13 | /**
|
14 | * Does NOT delete previous secrets from secretMap.
|
15 | *
|
16 | * If SECRET_ENCRYPTION_KEY argument is passed - will decrypt the contents of the file first, before parsing it as JSON.
|
17 | */
|
18 | export declare function loadSecretsFromJsonFile(filePath: string, SECRET_ENCRYPTION_KEY?: string): void;
|
19 | /**
|
20 | * json secrets are always base64'd
|
21 | */
|
22 | export declare function secret<T = string>(k: string, json?: boolean): T;
|
23 | export declare function secretOptional<T = string>(k: string, json?: boolean): T | undefined;
|
24 | export declare function getSecretMap(): StringMap;
|
25 | /**
|
26 | * REPLACES secretMap with new map.
|
27 | */
|
28 | export declare function setSecretMap(map: StringMap): void;
|