@cedar-policy/cedar-wasm 3.2.4 → 3.3.0

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.
@@ -46,6 +46,10 @@ export function checkParseEntities(entities_str: string, schema_str: string): Ch
46
46
  */
47
47
  export function checkParseContext(context_str: string, action_str: string, schema_str: string): CheckParseResult;
48
48
  /**
49
+ * @returns {string}
50
+ */
51
+ export function getCedarVersion(): string;
52
+ /**
49
53
  * @param {AuthorizationCall} call
50
54
  * @returns {AuthorizationAnswer}
51
55
  */
@@ -55,10 +59,6 @@ export function isAuthorized(call: AuthorizationCall): AuthorizationAnswer;
55
59
  * @returns {ValidationAnswer}
56
60
  */
57
61
  export function validate(call: ValidationCall): ValidationAnswer;
58
- /**
59
- * @returns {string}
60
- */
61
- export function getCedarVersion(): string;
62
62
  export type JsonToPolicyResult = { type: "success"; policyText: string } | { type: "error"; errors: string[] };
63
63
 
64
64
  export type PolicyToJsonResult = { type: "success"; policy: Policy } | { type: "error"; errors: string[] };
@@ -220,24 +220,19 @@ export type ActionConstraint = { op: "All" } | ({ op: "==" } & EqConstraint) | (
220
220
 
221
221
  export type PrincipalConstraint = { op: "All" } | ({ op: "==" } & EqConstraint) | ({ op: "in" } & PrincipalOrResourceInConstraint) | ({ op: "is" } & PrincipalOrResourceIsConstraint);
222
222
 
223
- export interface EntityJson {
224
- uid: EntityUidJson;
225
- attrs: Record<string, CedarValueJson>;
226
- parents: EntityUidJson[];
227
- }
223
+ export type EntityUidJson = { __expr: string } | { __entity: TypeAndId } | TypeAndId;
228
224
 
229
- export type Clause = { kind: "when"; body: Expr } | { kind: "unless"; body: Expr };
225
+ export interface FnAndArg {
226
+ fn: string;
227
+ arg: CedarValueJson;
228
+ }
230
229
 
231
- export interface Policy {
232
- effect: Effect;
233
- principal: PrincipalConstraint;
234
- action: ActionConstraint;
235
- resource: ResourceConstraint;
236
- conditions: Clause[];
237
- annotations?: Record<string, string>;
230
+ export interface TypeAndId {
231
+ type: string;
232
+ id: string;
238
233
  }
239
234
 
240
- export type Effect = "permit" | "forbid";
235
+ export type CedarValueJson = { __expr: string } | { __entity: TypeAndId } | { __extn: FnAndArg } | boolean | number | string | CedarValueJson[] | { [key: string]: CedarValueJson } | null;
241
236
 
242
237
  export type ExtFuncCall = {} & Record<string, Array<Expr>>;
243
238
 
@@ -245,21 +240,26 @@ export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: strin
245
240
 
246
241
  export type Expr = ExprNoExt | ExtFuncCall;
247
242
 
248
- export type EntityUidJson = { __expr: string } | { __entity: TypeAndId } | TypeAndId;
243
+ export type Decision = "Allow" | "Deny";
249
244
 
250
- export interface FnAndArg {
251
- fn: string;
252
- arg: CedarValueJson;
253
- }
245
+ export type Effect = "permit" | "forbid";
254
246
 
255
- export interface TypeAndId {
256
- type: string;
257
- id: string;
247
+ export interface EntityJson {
248
+ uid: EntityUidJson;
249
+ attrs: Record<string, CedarValueJson>;
250
+ parents: EntityUidJson[];
258
251
  }
259
252
 
260
- export type CedarValueJson = { __expr: string } | { __entity: TypeAndId } | { __extn: FnAndArg } | boolean | number | string | CedarValueJson[] | { [key: string]: CedarValueJson } | null;
253
+ export type Clause = { kind: "when"; body: Expr } | { kind: "unless"; body: Expr };
261
254
 
262
- export type Decision = "Allow" | "Deny";
255
+ export interface Policy {
256
+ effect: Effect;
257
+ principal: PrincipalConstraint;
258
+ action: ActionConstraint;
259
+ resource: ResourceConstraint;
260
+ conditions: Clause[];
261
+ annotations?: Record<string, string>;
262
+ }
263
263
 
264
264
  export type Var = "principal" | "action" | "resource" | "context";
265
265
 
@@ -222,24 +222,6 @@ export function checkParseContext(context_str, action_str, schema_str) {
222
222
  return takeObject(ret);
223
223
  }
224
224
 
225
- /**
226
- * @param {AuthorizationCall} call
227
- * @returns {AuthorizationAnswer}
228
- */
229
- export function isAuthorized(call) {
230
- const ret = wasm.isAuthorized(addHeapObject(call));
231
- return takeObject(ret);
232
- }
233
-
234
- /**
235
- * @param {ValidationCall} call
236
- * @returns {ValidationAnswer}
237
- */
238
- export function validate(call) {
239
- const ret = wasm.validate(addHeapObject(call));
240
- return takeObject(ret);
241
- }
242
-
243
225
  /**
244
226
  * @returns {string}
245
227
  */
@@ -260,6 +242,24 @@ export function getCedarVersion() {
260
242
  }
261
243
  }
262
244
 
245
+ /**
246
+ * @param {AuthorizationCall} call
247
+ * @returns {AuthorizationAnswer}
248
+ */
249
+ export function isAuthorized(call) {
250
+ const ret = wasm.isAuthorized(addHeapObject(call));
251
+ return takeObject(ret);
252
+ }
253
+
254
+ /**
255
+ * @param {ValidationCall} call
256
+ * @returns {ValidationAnswer}
257
+ */
258
+ export function validate(call) {
259
+ const ret = wasm.validate(addHeapObject(call));
260
+ return takeObject(ret);
261
+ }
262
+
263
263
  function handleError(f, args) {
264
264
  try {
265
265
  return f.apply(this, args);
Binary file
@@ -9,9 +9,9 @@ export function formatPolicies(a: number, b: number, c: number, d: number): numb
9
9
  export function checkParseSchema(a: number, b: number): number;
10
10
  export function checkParseEntities(a: number, b: number, c: number, d: number): number;
11
11
  export function checkParseContext(a: number, b: number, c: number, d: number, e: number, f: number): number;
12
+ export function getCedarVersion(a: number): void;
12
13
  export function isAuthorized(a: number): number;
13
14
  export function validate(a: number): number;
14
- export function getCedarVersion(a: number): void;
15
15
  export function __wbindgen_malloc(a: number, b: number): number;
16
16
  export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
17
17
  export function __wbindgen_add_to_stack_pointer(a: number): number;
package/esm/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cedar-policy/cedar-wasm",
3
3
  "description": "Wasm bindings and typescript types for Cedar lib",
4
- "version": "3.2.4",
4
+ "version": "3.3.0",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
7
  "cedar_wasm_bg.wasm",
@@ -46,6 +46,10 @@ export function checkParseEntities(entities_str: string, schema_str: string): Ch
46
46
  */
47
47
  export function checkParseContext(context_str: string, action_str: string, schema_str: string): CheckParseResult;
48
48
  /**
49
+ * @returns {string}
50
+ */
51
+ export function getCedarVersion(): string;
52
+ /**
49
53
  * @param {AuthorizationCall} call
50
54
  * @returns {AuthorizationAnswer}
51
55
  */
@@ -55,10 +59,6 @@ export function isAuthorized(call: AuthorizationCall): AuthorizationAnswer;
55
59
  * @returns {ValidationAnswer}
56
60
  */
57
61
  export function validate(call: ValidationCall): ValidationAnswer;
58
- /**
59
- * @returns {string}
60
- */
61
- export function getCedarVersion(): string;
62
62
  export type JsonToPolicyResult = { type: "success"; policyText: string } | { type: "error"; errors: string[] };
63
63
 
64
64
  export type PolicyToJsonResult = { type: "success"; policy: Policy } | { type: "error"; errors: string[] };
@@ -220,24 +220,19 @@ export type ActionConstraint = { op: "All" } | ({ op: "==" } & EqConstraint) | (
220
220
 
221
221
  export type PrincipalConstraint = { op: "All" } | ({ op: "==" } & EqConstraint) | ({ op: "in" } & PrincipalOrResourceInConstraint) | ({ op: "is" } & PrincipalOrResourceIsConstraint);
222
222
 
223
- export interface EntityJson {
224
- uid: EntityUidJson;
225
- attrs: Record<string, CedarValueJson>;
226
- parents: EntityUidJson[];
227
- }
223
+ export type EntityUidJson = { __expr: string } | { __entity: TypeAndId } | TypeAndId;
228
224
 
229
- export type Clause = { kind: "when"; body: Expr } | { kind: "unless"; body: Expr };
225
+ export interface FnAndArg {
226
+ fn: string;
227
+ arg: CedarValueJson;
228
+ }
230
229
 
231
- export interface Policy {
232
- effect: Effect;
233
- principal: PrincipalConstraint;
234
- action: ActionConstraint;
235
- resource: ResourceConstraint;
236
- conditions: Clause[];
237
- annotations?: Record<string, string>;
230
+ export interface TypeAndId {
231
+ type: string;
232
+ id: string;
238
233
  }
239
234
 
240
- export type Effect = "permit" | "forbid";
235
+ export type CedarValueJson = { __expr: string } | { __entity: TypeAndId } | { __extn: FnAndArg } | boolean | number | string | CedarValueJson[] | { [key: string]: CedarValueJson } | null;
241
236
 
242
237
  export type ExtFuncCall = {} & Record<string, Array<Expr>>;
243
238
 
@@ -245,21 +240,26 @@ export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: strin
245
240
 
246
241
  export type Expr = ExprNoExt | ExtFuncCall;
247
242
 
248
- export type EntityUidJson = { __expr: string } | { __entity: TypeAndId } | TypeAndId;
243
+ export type Decision = "Allow" | "Deny";
249
244
 
250
- export interface FnAndArg {
251
- fn: string;
252
- arg: CedarValueJson;
253
- }
245
+ export type Effect = "permit" | "forbid";
254
246
 
255
- export interface TypeAndId {
256
- type: string;
257
- id: string;
247
+ export interface EntityJson {
248
+ uid: EntityUidJson;
249
+ attrs: Record<string, CedarValueJson>;
250
+ parents: EntityUidJson[];
258
251
  }
259
252
 
260
- export type CedarValueJson = { __expr: string } | { __entity: TypeAndId } | { __extn: FnAndArg } | boolean | number | string | CedarValueJson[] | { [key: string]: CedarValueJson } | null;
253
+ export type Clause = { kind: "when"; body: Expr } | { kind: "unless"; body: Expr };
261
254
 
262
- export type Decision = "Allow" | "Deny";
255
+ export interface Policy {
256
+ effect: Effect;
257
+ principal: PrincipalConstraint;
258
+ action: ActionConstraint;
259
+ resource: ResourceConstraint;
260
+ conditions: Clause[];
261
+ annotations?: Record<string, string>;
262
+ }
263
263
 
264
264
  export type Var = "principal" | "action" | "resource" | "context";
265
265
 
@@ -217,24 +217,6 @@ module.exports.checkParseContext = function(context_str, action_str, schema_str)
217
217
  return takeObject(ret);
218
218
  };
219
219
 
220
- /**
221
- * @param {AuthorizationCall} call
222
- * @returns {AuthorizationAnswer}
223
- */
224
- module.exports.isAuthorized = function(call) {
225
- const ret = wasm.isAuthorized(addHeapObject(call));
226
- return takeObject(ret);
227
- };
228
-
229
- /**
230
- * @param {ValidationCall} call
231
- * @returns {ValidationAnswer}
232
- */
233
- module.exports.validate = function(call) {
234
- const ret = wasm.validate(addHeapObject(call));
235
- return takeObject(ret);
236
- };
237
-
238
220
  /**
239
221
  * @returns {string}
240
222
  */
@@ -255,6 +237,24 @@ module.exports.getCedarVersion = function() {
255
237
  }
256
238
  };
257
239
 
240
+ /**
241
+ * @param {AuthorizationCall} call
242
+ * @returns {AuthorizationAnswer}
243
+ */
244
+ module.exports.isAuthorized = function(call) {
245
+ const ret = wasm.isAuthorized(addHeapObject(call));
246
+ return takeObject(ret);
247
+ };
248
+
249
+ /**
250
+ * @param {ValidationCall} call
251
+ * @returns {ValidationAnswer}
252
+ */
253
+ module.exports.validate = function(call) {
254
+ const ret = wasm.validate(addHeapObject(call));
255
+ return takeObject(ret);
256
+ };
257
+
258
258
  function handleError(f, args) {
259
259
  try {
260
260
  return f.apply(this, args);
Binary file
@@ -9,9 +9,9 @@ export function formatPolicies(a: number, b: number, c: number, d: number): numb
9
9
  export function checkParseSchema(a: number, b: number): number;
10
10
  export function checkParseEntities(a: number, b: number, c: number, d: number): number;
11
11
  export function checkParseContext(a: number, b: number, c: number, d: number, e: number, f: number): number;
12
+ export function getCedarVersion(a: number): void;
12
13
  export function isAuthorized(a: number): number;
13
14
  export function validate(a: number): number;
14
- export function getCedarVersion(a: number): void;
15
15
  export function __wbindgen_malloc(a: number, b: number): number;
16
16
  export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
17
17
  export function __wbindgen_add_to_stack_pointer(a: number): number;
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cedar-policy/cedar-wasm",
3
3
  "description": "Wasm bindings and typescript types for Cedar lib",
4
- "version": "3.2.4",
4
+ "version": "3.3.0",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
7
  "cedar_wasm_bg.wasm",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cedar-policy/cedar-wasm",
3
3
  "description": "Wasm bindings and typescript types for Cedar lib",
4
- "version": "3.2.4",
4
+ "version": "3.3.0",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
7
  "esm/package.json",
@@ -46,6 +46,10 @@ export function checkParseEntities(entities_str: string, schema_str: string): Ch
46
46
  */
47
47
  export function checkParseContext(context_str: string, action_str: string, schema_str: string): CheckParseResult;
48
48
  /**
49
+ * @returns {string}
50
+ */
51
+ export function getCedarVersion(): string;
52
+ /**
49
53
  * @param {AuthorizationCall} call
50
54
  * @returns {AuthorizationAnswer}
51
55
  */
@@ -55,10 +59,6 @@ export function isAuthorized(call: AuthorizationCall): AuthorizationAnswer;
55
59
  * @returns {ValidationAnswer}
56
60
  */
57
61
  export function validate(call: ValidationCall): ValidationAnswer;
58
- /**
59
- * @returns {string}
60
- */
61
- export function getCedarVersion(): string;
62
62
  export type JsonToPolicyResult = { type: "success"; policyText: string } | { type: "error"; errors: string[] };
63
63
 
64
64
  export type PolicyToJsonResult = { type: "success"; policy: Policy } | { type: "error"; errors: string[] };
@@ -220,24 +220,19 @@ export type ActionConstraint = { op: "All" } | ({ op: "==" } & EqConstraint) | (
220
220
 
221
221
  export type PrincipalConstraint = { op: "All" } | ({ op: "==" } & EqConstraint) | ({ op: "in" } & PrincipalOrResourceInConstraint) | ({ op: "is" } & PrincipalOrResourceIsConstraint);
222
222
 
223
- export interface EntityJson {
224
- uid: EntityUidJson;
225
- attrs: Record<string, CedarValueJson>;
226
- parents: EntityUidJson[];
227
- }
223
+ export type EntityUidJson = { __expr: string } | { __entity: TypeAndId } | TypeAndId;
228
224
 
229
- export type Clause = { kind: "when"; body: Expr } | { kind: "unless"; body: Expr };
225
+ export interface FnAndArg {
226
+ fn: string;
227
+ arg: CedarValueJson;
228
+ }
230
229
 
231
- export interface Policy {
232
- effect: Effect;
233
- principal: PrincipalConstraint;
234
- action: ActionConstraint;
235
- resource: ResourceConstraint;
236
- conditions: Clause[];
237
- annotations?: Record<string, string>;
230
+ export interface TypeAndId {
231
+ type: string;
232
+ id: string;
238
233
  }
239
234
 
240
- export type Effect = "permit" | "forbid";
235
+ export type CedarValueJson = { __expr: string } | { __entity: TypeAndId } | { __extn: FnAndArg } | boolean | number | string | CedarValueJson[] | { [key: string]: CedarValueJson } | null;
241
236
 
242
237
  export type ExtFuncCall = {} & Record<string, Array<Expr>>;
243
238
 
@@ -245,21 +240,26 @@ export type ExprNoExt = { Value: CedarValueJson } | { Var: Var } | { Slot: strin
245
240
 
246
241
  export type Expr = ExprNoExt | ExtFuncCall;
247
242
 
248
- export type EntityUidJson = { __expr: string } | { __entity: TypeAndId } | TypeAndId;
243
+ export type Decision = "Allow" | "Deny";
249
244
 
250
- export interface FnAndArg {
251
- fn: string;
252
- arg: CedarValueJson;
253
- }
245
+ export type Effect = "permit" | "forbid";
254
246
 
255
- export interface TypeAndId {
256
- type: string;
257
- id: string;
247
+ export interface EntityJson {
248
+ uid: EntityUidJson;
249
+ attrs: Record<string, CedarValueJson>;
250
+ parents: EntityUidJson[];
258
251
  }
259
252
 
260
- export type CedarValueJson = { __expr: string } | { __entity: TypeAndId } | { __extn: FnAndArg } | boolean | number | string | CedarValueJson[] | { [key: string]: CedarValueJson } | null;
253
+ export type Clause = { kind: "when"; body: Expr } | { kind: "unless"; body: Expr };
261
254
 
262
- export type Decision = "Allow" | "Deny";
255
+ export interface Policy {
256
+ effect: Effect;
257
+ principal: PrincipalConstraint;
258
+ action: ActionConstraint;
259
+ resource: ResourceConstraint;
260
+ conditions: Clause[];
261
+ annotations?: Record<string, string>;
262
+ }
263
263
 
264
264
  export type Var = "principal" | "action" | "resource" | "context";
265
265
 
@@ -276,9 +276,9 @@ export interface InitOutput {
276
276
  readonly checkParseSchema: (a: number, b: number) => number;
277
277
  readonly checkParseEntities: (a: number, b: number, c: number, d: number) => number;
278
278
  readonly checkParseContext: (a: number, b: number, c: number, d: number, e: number, f: number) => number;
279
+ readonly getCedarVersion: (a: number) => void;
279
280
  readonly isAuthorized: (a: number) => number;
280
281
  readonly validate: (a: number) => number;
281
- readonly getCedarVersion: (a: number) => void;
282
282
  readonly __wbindgen_malloc: (a: number, b: number) => number;
283
283
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
284
284
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
package/web/cedar_wasm.js CHANGED
@@ -214,24 +214,6 @@ export function checkParseContext(context_str, action_str, schema_str) {
214
214
  return takeObject(ret);
215
215
  }
216
216
 
217
- /**
218
- * @param {AuthorizationCall} call
219
- * @returns {AuthorizationAnswer}
220
- */
221
- export function isAuthorized(call) {
222
- const ret = wasm.isAuthorized(addHeapObject(call));
223
- return takeObject(ret);
224
- }
225
-
226
- /**
227
- * @param {ValidationCall} call
228
- * @returns {ValidationAnswer}
229
- */
230
- export function validate(call) {
231
- const ret = wasm.validate(addHeapObject(call));
232
- return takeObject(ret);
233
- }
234
-
235
217
  /**
236
218
  * @returns {string}
237
219
  */
@@ -252,6 +234,24 @@ export function getCedarVersion() {
252
234
  }
253
235
  }
254
236
 
237
+ /**
238
+ * @param {AuthorizationCall} call
239
+ * @returns {AuthorizationAnswer}
240
+ */
241
+ export function isAuthorized(call) {
242
+ const ret = wasm.isAuthorized(addHeapObject(call));
243
+ return takeObject(ret);
244
+ }
245
+
246
+ /**
247
+ * @param {ValidationCall} call
248
+ * @returns {ValidationAnswer}
249
+ */
250
+ export function validate(call) {
251
+ const ret = wasm.validate(addHeapObject(call));
252
+ return takeObject(ret);
253
+ }
254
+
255
255
  function handleError(f, args) {
256
256
  try {
257
257
  return f.apply(this, args);
Binary file
@@ -9,9 +9,9 @@ export function formatPolicies(a: number, b: number, c: number, d: number): numb
9
9
  export function checkParseSchema(a: number, b: number): number;
10
10
  export function checkParseEntities(a: number, b: number, c: number, d: number): number;
11
11
  export function checkParseContext(a: number, b: number, c: number, d: number, e: number, f: number): number;
12
+ export function getCedarVersion(a: number): void;
12
13
  export function isAuthorized(a: number): number;
13
14
  export function validate(a: number): number;
14
- export function getCedarVersion(a: number): void;
15
15
  export function __wbindgen_malloc(a: number, b: number): number;
16
16
  export function __wbindgen_realloc(a: number, b: number, c: number, d: number): number;
17
17
  export function __wbindgen_add_to_stack_pointer(a: number): number;
package/web/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cedar-policy/cedar-wasm",
3
3
  "description": "Wasm bindings and typescript types for Cedar lib",
4
- "version": "3.2.4",
4
+ "version": "3.3.0",
5
5
  "license": "Apache-2.0",
6
6
  "files": [
7
7
  "cedar_wasm_bg.wasm",