@cedar-policy/cedar-wasm 4.5.0 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/cedar_wasm.d.ts +129 -132
- package/esm/cedar_wasm_bg.js +68 -68
- package/esm/cedar_wasm_bg.wasm +0 -0
- package/esm/cedar_wasm_bg.wasm.d.ts +10 -10
- package/esm/package.json +1 -1
- package/nodejs/cedar_wasm.d.ts +129 -132
- package/nodejs/cedar_wasm.js +68 -68
- package/nodejs/cedar_wasm_bg.wasm +0 -0
- package/nodejs/cedar_wasm_bg.wasm.d.ts +10 -10
- package/nodejs/package.json +1 -1
- package/package.json +1 -1
- package/web/cedar_wasm.d.ts +139 -142
- package/web/cedar_wasm.js +68 -68
- package/web/cedar_wasm_bg.wasm +0 -0
- package/web/cedar_wasm_bg.wasm.d.ts +10 -10
- package/web/package.json +1 -1
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const getValidRequestEnvsTemplate: (a: any, b: any) => any;
|
|
5
|
-
export const getValidRequestEnvsPolicy: (a: any, b: any) => any;
|
|
6
4
|
export const getCedarSDKVersion: () => [number, number];
|
|
5
|
+
export const getValidRequestEnvsPolicy: (a: any, b: any) => any;
|
|
6
|
+
export const getValidRequestEnvsTemplate: (a: any, b: any) => any;
|
|
7
7
|
export const getCedarVersion: () => [number, number];
|
|
8
|
-
export const
|
|
8
|
+
export const checkParseContext: (a: any) => any;
|
|
9
|
+
export const checkParseEntities: (a: any) => any;
|
|
9
10
|
export const checkParsePolicySet: (a: any) => any;
|
|
10
11
|
export const checkParseSchema: (a: any) => any;
|
|
11
|
-
export const checkParseEntities: (a: any) => any;
|
|
12
|
-
export const checkParseContext: (a: any) => any;
|
|
13
12
|
export const formatPolicies: (a: any) => any;
|
|
14
|
-
export const isAuthorized: (a: any) => any;
|
|
15
13
|
export const policySetTextToParts: (a: number, b: number) => any;
|
|
16
|
-
export const policyToText: (a: any) => any;
|
|
17
|
-
export const templateToText: (a: any) => any;
|
|
18
14
|
export const policyToJson: (a: any) => any;
|
|
19
|
-
export const
|
|
20
|
-
export const schemaToText: (a: any) => any;
|
|
15
|
+
export const policyToText: (a: any) => any;
|
|
21
16
|
export const schemaToJson: (a: any) => any;
|
|
17
|
+
export const schemaToText: (a: any) => any;
|
|
18
|
+
export const templateToJson: (a: any) => any;
|
|
19
|
+
export const templateToText: (a: any) => any;
|
|
20
|
+
export const validate: (a: any) => any;
|
|
21
|
+
export const isAuthorized: (a: any) => any;
|
|
22
22
|
export const getCedarLangVersion: () => [number, number];
|
|
23
23
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
24
24
|
export const __externref_table_alloc: () => number;
|
package/esm/package.json
CHANGED
package/nodejs/cedar_wasm.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
export function getCedarVersion(): string;
|
|
4
|
+
export function getCedarSDKVersion(): string;
|
|
3
5
|
/**
|
|
4
6
|
* Get valid request environment
|
|
5
7
|
*/
|
|
@@ -8,27 +10,18 @@ export function getValidRequestEnvsTemplate(t: Template, s: Schema): GetValidReq
|
|
|
8
10
|
* Get valid request environment
|
|
9
11
|
*/
|
|
10
12
|
export function getValidRequestEnvsPolicy(t: Policy, s: Schema): GetValidRequestEnvsResult;
|
|
11
|
-
export function getCedarVersion(): string;
|
|
12
|
-
export function getCedarSDKVersion(): string;
|
|
13
|
-
/**
|
|
14
|
-
* Parse a policy set and optionally validate it against a provided schema
|
|
15
|
-
*
|
|
16
|
-
* This is the basic validator interface, using [`ValidationCall`] and
|
|
17
|
-
* [`ValidationAnswer`] types
|
|
18
|
-
*/
|
|
19
|
-
export function validate(call: ValidationCall): ValidationAnswer;
|
|
20
13
|
/**
|
|
21
|
-
* Check whether a
|
|
14
|
+
* Check whether a set of entities successfully parses.
|
|
22
15
|
*/
|
|
23
|
-
export function
|
|
16
|
+
export function checkParseEntities(call: EntitiesParsingCall): CheckParseAnswer;
|
|
24
17
|
/**
|
|
25
18
|
* Check whether a schema successfully parses.
|
|
26
19
|
*/
|
|
27
20
|
export function checkParseSchema(schema: Schema): CheckParseAnswer;
|
|
28
21
|
/**
|
|
29
|
-
* Check whether a set
|
|
22
|
+
* Check whether a policy set successfully parses.
|
|
30
23
|
*/
|
|
31
|
-
export function
|
|
24
|
+
export function checkParsePolicySet(policies: PolicySet): CheckParseAnswer;
|
|
32
25
|
/**
|
|
33
26
|
* Check whether a context successfully parses.
|
|
34
27
|
*/
|
|
@@ -38,99 +31,111 @@ export function checkParseContext(call: ContextParsingCall): CheckParseAnswer;
|
|
|
38
31
|
*/
|
|
39
32
|
export function formatPolicies(call: FormattingCall): FormattingAnswer;
|
|
40
33
|
/**
|
|
41
|
-
*
|
|
34
|
+
* Return the Cedar (textual) representation of a template.
|
|
42
35
|
*/
|
|
43
|
-
export function
|
|
36
|
+
export function templateToText(template: Template): PolicyToTextAnswer;
|
|
37
|
+
/**
|
|
38
|
+
* Return the JSON representation of a policy.
|
|
39
|
+
*/
|
|
40
|
+
export function policyToJson(policy: Policy): PolicyToJsonAnswer;
|
|
44
41
|
/**
|
|
45
|
-
* Takes a PolicySet represented as string and return the policies
|
|
42
|
+
* Takes a `PolicySet` represented as string and return the policies
|
|
46
43
|
* and templates split into vecs and sorted by id.
|
|
47
44
|
*/
|
|
48
45
|
export function policySetTextToParts(policyset_str: string): PolicySetTextToPartsAnswer;
|
|
49
46
|
/**
|
|
50
|
-
* Return the
|
|
47
|
+
* Return the JSON representation of a schema.
|
|
51
48
|
*/
|
|
52
|
-
export function
|
|
49
|
+
export function schemaToJson(schema: Schema): SchemaToJsonAnswer;
|
|
53
50
|
/**
|
|
54
|
-
* Return the Cedar (textual) representation of a
|
|
51
|
+
* Return the Cedar (textual) representation of a schema.
|
|
55
52
|
*/
|
|
56
|
-
export function
|
|
53
|
+
export function schemaToText(schema: Schema): SchemaToTextAnswer;
|
|
57
54
|
/**
|
|
58
|
-
* Return the
|
|
55
|
+
* Return the Cedar (textual) representation of a policy.
|
|
59
56
|
*/
|
|
60
|
-
export function
|
|
57
|
+
export function policyToText(policy: Policy): PolicyToTextAnswer;
|
|
61
58
|
/**
|
|
62
59
|
* Return the JSON representation of a template.
|
|
63
60
|
*/
|
|
64
61
|
export function templateToJson(template: Template): PolicyToJsonAnswer;
|
|
65
62
|
/**
|
|
66
|
-
*
|
|
63
|
+
* Parse a policy set and optionally validate it against a provided schema
|
|
64
|
+
*
|
|
65
|
+
* This is the basic validator interface, using [`ValidationCall`] and
|
|
66
|
+
* [`ValidationAnswer`] types
|
|
67
67
|
*/
|
|
68
|
-
export function
|
|
68
|
+
export function validate(call: ValidationCall): ValidationAnswer;
|
|
69
69
|
/**
|
|
70
|
-
*
|
|
70
|
+
* Basic interface, using [`AuthorizationCall`] and [`AuthorizationAnswer`] types
|
|
71
71
|
*/
|
|
72
|
-
export function
|
|
72
|
+
export function isAuthorized(call: AuthorizationCall): AuthorizationAnswer;
|
|
73
73
|
/**
|
|
74
74
|
* Get language version of Cedar
|
|
75
75
|
*/
|
|
76
76
|
export function getCedarLangVersion(): string;
|
|
77
77
|
export type GetValidRequestEnvsResult = { type: "success"; principals: string[]; actions: string[]; resources: string[] } | { type: "failure"; error: string };
|
|
78
78
|
|
|
79
|
-
export interface ValidationCall {
|
|
80
|
-
validationSettings?: ValidationSettings;
|
|
81
|
-
schema: Schema;
|
|
82
|
-
policies: PolicySet;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface ValidationSettings {
|
|
86
|
-
mode: ValidationMode;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface ValidationError {
|
|
90
|
-
policyId: string;
|
|
91
|
-
error: DetailedError;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export type ValidationAnswer = { type: "failure"; errors: DetailedError[]; warnings: DetailedError[] } | { type: "success"; validationErrors: ValidationError[]; validationWarnings: ValidationError[]; otherWarnings: DetailedError[] };
|
|
95
|
-
|
|
96
|
-
export type CheckParseAnswer = { type: "success" } | { type: "failure"; errors: DetailedError[] };
|
|
97
|
-
|
|
98
79
|
export interface EntitiesParsingCall {
|
|
99
80
|
entities: Entities;
|
|
100
81
|
schema?: Schema | null;
|
|
101
82
|
}
|
|
102
83
|
|
|
84
|
+
export type CheckParseAnswer = { type: "success" } | { type: "failure"; errors: DetailedError[] };
|
|
85
|
+
|
|
103
86
|
export interface ContextParsingCall {
|
|
104
87
|
context: Context;
|
|
105
88
|
schema?: Schema | null;
|
|
106
89
|
action?: EntityUid | null;
|
|
107
90
|
}
|
|
108
91
|
|
|
92
|
+
export type FormattingAnswer = { type: "failure"; errors: DetailedError[] } | { type: "success"; formatted_policy: string };
|
|
93
|
+
|
|
109
94
|
export interface FormattingCall {
|
|
110
95
|
policyText: string;
|
|
111
96
|
lineWidth?: number;
|
|
112
97
|
indentWidth?: number;
|
|
113
98
|
}
|
|
114
99
|
|
|
115
|
-
export type
|
|
100
|
+
export type SchemaToTextAnswer = { type: "success"; text: string; warnings: DetailedError[] } | { type: "failure"; errors: DetailedError[] };
|
|
116
101
|
|
|
117
|
-
export
|
|
118
|
-
|
|
119
|
-
|
|
102
|
+
export type SchemaToJsonAnswer = { type: "success"; json: SchemaJson<string>; warnings: DetailedError[] } | { type: "failure"; errors: DetailedError[] };
|
|
103
|
+
|
|
104
|
+
export type PolicyToTextAnswer = { type: "success"; text: string } | { type: "failure"; errors: DetailedError[] };
|
|
105
|
+
|
|
106
|
+
export type PolicySetTextToPartsAnswer = { type: "success"; policies: string[]; policy_templates: string[] } | { type: "failure"; errors: DetailedError[] };
|
|
107
|
+
|
|
108
|
+
export type PolicyToJsonAnswer = { type: "success"; json: PolicyJson } | { type: "failure"; errors: DetailedError[] };
|
|
109
|
+
|
|
110
|
+
export interface ValidationSettings {
|
|
111
|
+
mode: ValidationMode;
|
|
120
112
|
}
|
|
121
113
|
|
|
122
|
-
export
|
|
123
|
-
|
|
124
|
-
|
|
114
|
+
export type ValidationAnswer = { type: "failure"; errors: DetailedError[]; warnings: DetailedError[] } | { type: "success"; validationErrors: ValidationError[]; validationWarnings: ValidationError[]; otherWarnings: DetailedError[] };
|
|
115
|
+
|
|
116
|
+
export interface ValidationCall {
|
|
117
|
+
validationSettings?: ValidationSettings;
|
|
118
|
+
schema: Schema;
|
|
119
|
+
policies: PolicySet;
|
|
125
120
|
}
|
|
126
121
|
|
|
127
|
-
export interface
|
|
122
|
+
export interface ValidationError {
|
|
128
123
|
policyId: string;
|
|
129
124
|
error: DetailedError;
|
|
130
125
|
}
|
|
131
126
|
|
|
132
127
|
export type AuthorizationAnswer = { type: "failure"; errors: DetailedError[]; warnings: DetailedError[] } | { type: "success"; response: Response; warnings: DetailedError[] };
|
|
133
128
|
|
|
129
|
+
export interface AuthorizationError {
|
|
130
|
+
policyId: string;
|
|
131
|
+
error: DetailedError;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface Response {
|
|
135
|
+
decision: Decision;
|
|
136
|
+
diagnostics: Diagnostics;
|
|
137
|
+
}
|
|
138
|
+
|
|
134
139
|
export interface AuthorizationCall {
|
|
135
140
|
principal: EntityUid;
|
|
136
141
|
action: EntityUid;
|
|
@@ -142,22 +147,23 @@ export interface AuthorizationCall {
|
|
|
142
147
|
entities: Entities;
|
|
143
148
|
}
|
|
144
149
|
|
|
145
|
-
export
|
|
150
|
+
export interface Diagnostics {
|
|
151
|
+
reason: PolicyId[];
|
|
152
|
+
errors: AuthorizationError[];
|
|
153
|
+
}
|
|
146
154
|
|
|
147
|
-
export type
|
|
155
|
+
export type PolicyId = string;
|
|
148
156
|
|
|
149
|
-
export type
|
|
157
|
+
export type SlotId = string;
|
|
150
158
|
|
|
151
|
-
export type
|
|
159
|
+
export type ValidationMode = "strict";
|
|
152
160
|
|
|
153
|
-
export type
|
|
161
|
+
export type StaticPolicySet = string | Policy[] | Record<PolicyId, Policy>;
|
|
154
162
|
|
|
155
|
-
export type
|
|
163
|
+
export type Context = Record<string, CedarValueJson>;
|
|
156
164
|
|
|
157
|
-
export interface
|
|
158
|
-
|
|
159
|
-
templates?: Record<PolicyId, Template>;
|
|
160
|
-
templateLinks?: TemplateLink[];
|
|
165
|
+
export interface SourceLabel extends SourceLocation {
|
|
166
|
+
label: string | null;
|
|
161
167
|
}
|
|
162
168
|
|
|
163
169
|
export interface TemplateLink {
|
|
@@ -166,27 +172,15 @@ export interface TemplateLink {
|
|
|
166
172
|
values: Record<SlotId, EntityUid>;
|
|
167
173
|
}
|
|
168
174
|
|
|
169
|
-
export type StaticPolicySet = string | Policy[] | Record<PolicyId, Policy>;
|
|
170
|
-
|
|
171
|
-
export type Template = string | PolicyJson;
|
|
172
|
-
|
|
173
175
|
export type Policy = string | PolicyJson;
|
|
174
176
|
|
|
175
|
-
export type
|
|
176
|
-
|
|
177
|
-
export type Context = Record<string, CedarValueJson>;
|
|
178
|
-
|
|
179
|
-
export type EntityUid = EntityUidJson;
|
|
177
|
+
export type Schema = string | SchemaJson<string>;
|
|
180
178
|
|
|
181
179
|
export interface SourceLocation {
|
|
182
180
|
start: number;
|
|
183
181
|
end: number;
|
|
184
182
|
}
|
|
185
183
|
|
|
186
|
-
export interface SourceLabel extends SourceLocation {
|
|
187
|
-
label: string | null;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
184
|
export type Severity = "advice" | "warning" | "error";
|
|
191
185
|
|
|
192
186
|
export interface DetailedError {
|
|
@@ -199,30 +193,21 @@ export interface DetailedError {
|
|
|
199
193
|
related?: DetailedError[];
|
|
200
194
|
}
|
|
201
195
|
|
|
202
|
-
export
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
export type ValidationMode = "strict";
|
|
207
|
-
|
|
208
|
-
export type ActionInConstraint = { entity: EntityUidJson } | { entities: EntityUidJson[] };
|
|
209
|
-
|
|
210
|
-
export interface PrincipalOrResourceIsConstraint {
|
|
211
|
-
entity_type: string;
|
|
212
|
-
in?: PrincipalOrResourceInConstraint;
|
|
196
|
+
export interface PolicySet {
|
|
197
|
+
staticPolicies?: StaticPolicySet;
|
|
198
|
+
templates?: Record<PolicyId, Template>;
|
|
199
|
+
templateLinks?: TemplateLink[];
|
|
213
200
|
}
|
|
214
201
|
|
|
215
|
-
export type
|
|
216
|
-
|
|
217
|
-
export type EqConstraint = { entity: EntityUidJson } | { slot: string };
|
|
202
|
+
export type Template = string | PolicyJson;
|
|
218
203
|
|
|
219
|
-
export type
|
|
204
|
+
export type EntityUid = EntityUidJson;
|
|
220
205
|
|
|
221
|
-
export type
|
|
206
|
+
export type Entities = Array<EntityJson>;
|
|
222
207
|
|
|
223
|
-
export type
|
|
208
|
+
export type Annotation = SmolStr;
|
|
224
209
|
|
|
225
|
-
export type
|
|
210
|
+
export type Decision = "allow" | "deny";
|
|
226
211
|
|
|
227
212
|
export interface EntityJson {
|
|
228
213
|
uid: EntityUidJson;
|
|
@@ -231,34 +216,29 @@ export interface EntityJson {
|
|
|
231
216
|
tags?: Record<string, CedarValueJson>;
|
|
232
217
|
}
|
|
233
218
|
|
|
234
|
-
export type
|
|
219
|
+
export type Expr = ExprNoExt | ExtFuncCall;
|
|
235
220
|
|
|
236
|
-
export type
|
|
221
|
+
export type ExtFuncCall = {} & Record<string, Array<Expr>>;
|
|
237
222
|
|
|
238
223
|
export type PatternElem = "Wildcard" | { Literal: SmolStr };
|
|
239
224
|
|
|
240
|
-
export type
|
|
225
|
+
export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: string } | { "!": { arg: Expr } } | { neg: { arg: Expr } } | { "==": { left: Expr; right: Expr } } | { "!=": { left: Expr; right: Expr } } | { in: { left: Expr; right: Expr } } | { "<": { left: Expr; right: Expr } } | { "<=": { left: Expr; right: Expr } } | { ">": { left: Expr; right: Expr } } | { ">=": { left: Expr; right: Expr } } | { "&&": { left: Expr; right: Expr } } | { "||": { left: Expr; right: Expr } } | { "+": { left: Expr; right: Expr } } | { "-": { left: Expr; right: Expr } } | { "*": { left: Expr; right: Expr } } | { contains: { left: Expr; right: Expr } } | { containsAll: { left: Expr; right: Expr } } | { containsAny: { left: Expr; right: Expr } } | { isEmpty: { arg: Expr } } | { getTag: { left: Expr; right: Expr } } | { hasTag: { left: Expr; right: Expr } } | { ".": { left: Expr; attr: SmolStr } } | { has: { left: Expr; attr: SmolStr } } | { like: { left: Expr; pattern: PatternElem[] } } | { is: { left: Expr; entity_type: SmolStr; in?: Expr } } | { "if-then-else": { if: Expr; then: Expr; else: Expr } } | { Set: Expr[] } | { Record: Record<string, Expr> };
|
|
241
226
|
|
|
242
227
|
export type TypeVariant<N> = { type: "String" } | { type: "Long" } | { type: "Boolean" } | { type: "Set"; element: Type<N> } | ({ type: "Record" } & RecordType<N>) | { type: "Entity"; name: N } | { type: "EntityOrCommon"; name: N } | { type: "Extension"; name: UnreservedId };
|
|
243
228
|
|
|
244
|
-
export interface RecordType<N> {
|
|
245
|
-
attributes: Record<SmolStr, TypeOfAttribute<N>>;
|
|
246
|
-
additionalAttributes?: boolean;
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
export type Type<N> = ({} & TypeVariant<N>) | { type: N };
|
|
250
|
-
|
|
251
229
|
export interface ActionEntityUID<N> {
|
|
252
230
|
id: SmolStr;
|
|
253
231
|
type?: N;
|
|
254
232
|
}
|
|
255
233
|
|
|
256
|
-
export interface
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
234
|
+
export interface StandardEntityType<N> {
|
|
235
|
+
memberOfTypes?: N[];
|
|
236
|
+
shape?: AttributesOrContext<N>;
|
|
237
|
+
tags?: Type<N>;
|
|
260
238
|
}
|
|
261
239
|
|
|
240
|
+
export type SchemaJson<N> = Record<string, NamespaceDefinition<N>>;
|
|
241
|
+
|
|
262
242
|
export interface ActionType<N> {
|
|
263
243
|
attributes?: Record<SmolStr, CedarValueJson>;
|
|
264
244
|
appliesTo?: ApplySpec<N>;
|
|
@@ -266,15 +246,7 @@ export interface ActionType<N> {
|
|
|
266
246
|
annotations?: Annotations;
|
|
267
247
|
}
|
|
268
248
|
|
|
269
|
-
export type
|
|
270
|
-
|
|
271
|
-
export interface StandardEntityType<N> {
|
|
272
|
-
memberOfTypes?: N[];
|
|
273
|
-
shape?: AttributesOrContext<N>;
|
|
274
|
-
tags?: Type<N>;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
export type EntityTypeKind<N> = StandardEntityType<N> | { enum: NonEmpty<SmolStr> };
|
|
249
|
+
export type Type<N> = ({} & TypeVariant<N>) | { type: N };
|
|
278
250
|
|
|
279
251
|
export interface NamespaceDefinition<N> {
|
|
280
252
|
commonTypes?: Record<CommonTypeId, CommonType<N>>;
|
|
@@ -283,33 +255,58 @@ export interface NamespaceDefinition<N> {
|
|
|
283
255
|
annotations?: Annotations;
|
|
284
256
|
}
|
|
285
257
|
|
|
258
|
+
export interface ApplySpec<N> {
|
|
259
|
+
resourceTypes: N[];
|
|
260
|
+
principalTypes: N[];
|
|
261
|
+
context?: AttributesOrContext<N>;
|
|
262
|
+
}
|
|
263
|
+
|
|
286
264
|
export type CommonTypeId = string;
|
|
287
265
|
|
|
288
|
-
export type
|
|
266
|
+
export type AttributesOrContext<N> = Type<N>;
|
|
289
267
|
|
|
290
|
-
export type
|
|
268
|
+
export type EntityTypeKind<N> = StandardEntityType<N> | { enum: NonEmpty<SmolStr> };
|
|
291
269
|
|
|
292
|
-
export
|
|
270
|
+
export interface RecordType<N> {
|
|
271
|
+
attributes: Record<SmolStr, TypeOfAttribute<N>>;
|
|
272
|
+
additionalAttributes?: boolean;
|
|
273
|
+
}
|
|
293
274
|
|
|
294
|
-
export type
|
|
275
|
+
export type Var = "principal" | "action" | "resource" | "context";
|
|
295
276
|
|
|
296
|
-
export
|
|
277
|
+
export interface TypeAndId {
|
|
278
|
+
type: string;
|
|
279
|
+
id: string;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export type CedarValueJson = { __entity: TypeAndId } | { __extn: FnAndArgs } | boolean | number | string | CedarValueJson[] | { [key: string]: CedarValueJson } | null;
|
|
297
283
|
|
|
298
284
|
export type EntityUidJson = { __entity: TypeAndId } | TypeAndId;
|
|
299
285
|
|
|
300
|
-
export
|
|
301
|
-
fn: string;
|
|
302
|
-
arg: CedarValueJson;
|
|
303
|
-
}
|
|
286
|
+
export type FnAndArgs = { fn: string; arg: CedarValueJson } | { fn: string; args: CedarValueJson[] };
|
|
304
287
|
|
|
305
|
-
export
|
|
306
|
-
|
|
307
|
-
|
|
288
|
+
export type Annotations = Record<string, Annotation>;
|
|
289
|
+
|
|
290
|
+
export type UnreservedId = string;
|
|
291
|
+
|
|
292
|
+
export type AnyId = SmolStr;
|
|
293
|
+
|
|
294
|
+
export interface PrincipalOrResourceIsConstraint {
|
|
295
|
+
entity_type: string;
|
|
296
|
+
in?: PrincipalOrResourceInConstraint;
|
|
308
297
|
}
|
|
309
298
|
|
|
310
|
-
export type
|
|
299
|
+
export type ActionConstraint = { op: "All" } | ({ op: "==" } & EqConstraint) | ({ op: "in" } & ActionInConstraint);
|
|
311
300
|
|
|
312
|
-
export type
|
|
301
|
+
export type ActionInConstraint = { entity: EntityUidJson } | { entities: EntityUidJson[] };
|
|
302
|
+
|
|
303
|
+
export type PrincipalConstraint = { op: "All" } | ({ op: "==" } & EqConstraint) | ({ op: "in" } & PrincipalOrResourceInConstraint) | ({ op: "is" } & PrincipalOrResourceIsConstraint);
|
|
304
|
+
|
|
305
|
+
export type PrincipalOrResourceInConstraint = { entity: EntityUidJson } | { slot: string };
|
|
306
|
+
|
|
307
|
+
export type EqConstraint = { entity: EntityUidJson } | { slot: string };
|
|
308
|
+
|
|
309
|
+
export type ResourceConstraint = { op: "All" } | ({ op: "==" } & EqConstraint) | ({ op: "in" } & PrincipalOrResourceInConstraint) | ({ op: "is" } & PrincipalOrResourceIsConstraint);
|
|
313
310
|
|
|
314
311
|
export type Clause = { kind: "when"; body: Expr } | { kind: "unless"; body: Expr };
|
|
315
312
|
|
|
@@ -322,7 +319,7 @@ export interface PolicyJson {
|
|
|
322
319
|
annotations?: Annotations;
|
|
323
320
|
}
|
|
324
321
|
|
|
325
|
-
export type
|
|
322
|
+
export type Effect = "permit" | "forbid";
|
|
326
323
|
|
|
327
324
|
type SmolStr = string;
|
|
328
325
|
export type TypeOfAttribute<N> = Type<N> & { required?: boolean };
|