-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.ts
101 lines (86 loc) · 3.53 KB
/
constants.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
export const AWS_REGION = 'ca-central-1';
export const AWS_KINESIS_BUFFER_TIME = 100;
export const AWS_KINESIS_MAX_RECORDS = 10;
export const AWS_OPENSEARCH_HOST = process.env.AWS_OPENSEARCH_HOST ?? '';
export const OPENSEARCH_INDEX_BROKER_AUDIT =
process.env.OPENSEARCH_INDEX_BROKER_AUDIT ?? '';
export const TOKEN_RENEW_RATIO = 0.75;
export const HEADER_VAULT_ROLE_ID = 'x-vault-role-id';
export const HEADER_BROKER_TOKEN = 'x-broker-token';
export const COLLECTION_MAX_EMBEDDED = 40;
export const COLLECTION_COLLATION_LOCALE = 'en';
export const INTENTION_DEFAULT_TTL_SECONDS = 600;
export const INTENTION_MIN_TTL_SECONDS = 30;
export const INTENTION_MAX_TTL_SECONDS = 1800;
export const INTENTION_TRANSIENT_TTL_MS = 7 * 24 * 60 * 60 * 1000;
// Search paths use last existing path as the value
export const INTENTION_SERVICE_ENVIRONMENT_SEARCH_PATHS = [
'action.service.environment',
'action.service.target.environment',
] as const;
export const INTENTION_SERVICE_INSTANCE_SEARCH_PATHS = [
...INTENTION_SERVICE_ENVIRONMENT_SEARCH_PATHS,
'action.service.instanceName',
'action.service.target.instanceName',
] as const;
export const SHORT_ENV_CONVERSION = {
production: 'prod',
development: 'dev',
} as const;
export const ACTION_VALIDATE_TEAM_ADMIN =
process.env.ACTION_VALIDATE_TEAM_ADMIN ?? '';
export const ACTION_VALIDATE_TEAM_DBA =
process.env.ACTION_VALIDATE_TEAM_DBA ?? '';
export const ACTION_PROVISION_TOKEN_SELF = 'token/self';
export const ACTION_PROVISION_APPROLE_SECRET_ID = 'approle/secret-id';
export const VAULT_PROVISIONED_ACTION_SET = new Set([
ACTION_PROVISION_TOKEN_SELF,
ACTION_PROVISION_APPROLE_SECRET_ID,
]);
export const IS_PRIMARY_NODE = process.env.HOSTNAME?.endsWith('-0') ?? false;
export const AUDIT_LOGSTREAM_DIR = process.env.AUDIT_LOGSTREAM_DIR ?? '/tmp';
export const AUDIT_LOGSTREAM_SIZE = process.env.AUDIT_LOGSTREAM_SIZE ?? '50M';
export const AUDIT_LOGSTREAM_MAX_LOGS =
process.env.AUDIT_LOGSTREAM_MAX_LOGS ?? '7';
export const VAULT_ADDR = process.env.VAULT_ADDR ?? '';
export const VAULT_SERVICE_WRAP_TTL = 60;
export const VAULT_AUDIT_DEVICE_NAME = 'file';
export const VAULT_ENVIRONMENTS = Object.freeze([
'production',
'test',
'development',
'tools',
]);
export const VAULT_ENVIRONMENTS_SHORT = Object.freeze([
'prod',
'test',
'dev',
'tools',
]);
export const VAULT_KV_APPS_MOUNT = 'apps';
export const VAULT_SYNC_APP_AUTH_MOUNT =
process.env.VAULT_APPROLE_PATH ?? 'vs_apps_approle';
export const JWT_MAX_AGE = '365d';
export const JWT_GENERATE_BLOCK_GRACE_PERIOD = 60000;
export const MILLISECONDS_IN_SECOND = 1000;
export const DAYS_10_IN_SECONDS = 60 * 60 * 24 * 10;
export const DAYS_365_IN_SECONDS = 60 * 60 * 24 * 365;
export const OAUTH2_CLIENT_MAP_DOMAIN =
process.env.OAUTH2_CLIENT_MAP_DOMAIN ?? '';
export const OAUTH2_CLIENT_DOMAIN = process.env.OAUTH2_CLIENT_DOMAIN ?? 'idp';
export const OAUTH2_CLIENT_MAP_EMAIL =
process.env.OAUTH2_CLIENT_MAP_EMAIL ?? 'email';
export const OAUTH2_CLIENT_MAP_GUID =
process.env.OAUTH2_CLIENT_MAP_GUID ?? 'idir_user_guid';
export const OAUTH2_CLIENT_MAP_NAME =
process.env.OAUTH2_CLIENT_MAP_NAME ?? 'display_name';
export const OAUTH2_CLIENT_MAP_ROLES =
process.env.OAUTH2_CLIENT_MAP_ROLES ?? 'client_roles';
export const OAUTH2_CLIENT_MAP_USERNAME =
process.env.OAUTH2_CLIENT_MAP_USERNAME ?? 'idir_username';
export const REDIS_PUBSUB = {
GRAPH: 'graph',
BROKER_ACCOUNT_TOKEN: 'broker-account-token',
} as const;
export const GITHUB_CLIENT_ID = process.env.GITHUB_CLIENT_ID ?? '';
export const GITHUB_PRIVATE_KEY = process.env.GITHUB_PRIVATE_KEY ?? '';