-
Notifications
You must be signed in to change notification settings - Fork 65
/
constants.js
67 lines (55 loc) · 1.45 KB
/
constants.js
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
/**
* This module should contain constants that are used in multiple places.
*
* _Type a string more than once? Make it a constant!_
*/
import path from 'node:path'
/**
* Relative path to the default policy file
*/
export const DEFAULT_POLICY_PATH = path.normalize('lavamoat/node/policy.json')
/**
* Relative path to the default policy override file
*/
export const DEFAULT_POLICY_OVERRIDE_PATH = path.normalize(
'lavamoat/node/policy-override.json'
)
export const DEFAULT_POLICY_DEBUG_PATH = path.normalize(
'lavamoat/node/policy-debug.json'
)
/**
* Policy item for the root entry
*/
export const POLICY_ITEM_ROOT = 'root'
/**
* Policy item for a writable global
*/
export const POLICY_ITEM_WRITE = 'write'
/**
* Policy item for any access
*/
export const POLICY_ITEM_WILDCARD = 'any'
/**
* Designator for the root policy item in a LavaMoat policy
*/
export const LAVAMOAT_PKG_POLICY_ROOT = '$root$'
/**
* Name of the `packages` property of a `LavaMoatPackagePolicy`
*/
export const RSRC_POLICY_PKGS = 'packages'
/**
* Name of the `builtins` property of a `LavaMoatPackagePolicy`
*/
export const RSRC_POLICY_BUILTINS = 'builtins'
/**
* Name of the `globals` property of a `LavaMoatPackagePolicy`
*/
export const RSRC_POLICY_GLOBALS = 'globals'
/**
* `builtin` module type for a `LavamoatModuleRecord`
*/
export const LMR_TYPE_BUILTIN = 'builtin'
/**
* `js` module type for a `LavamoatModuleRecord`
*/
export const LMR_TYPE_SOURCE = 'js'