@janssenproject/cedarling_wasm 0.0.6 → 0.0.7
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/cedarling_wasm.d.ts +8 -0
- package/cedarling_wasm.js +26 -6
- package/cedarling_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/cedarling_wasm.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export class AuthorizeResult {
|
|
|
16
16
|
* Convert `AuthorizeResult` to json string value
|
|
17
17
|
*/
|
|
18
18
|
json_string(): string;
|
|
19
|
+
principal(principal: string): AuthorizeResultResponse | undefined;
|
|
19
20
|
/**
|
|
20
21
|
* Result of authorization where principal is `Jans::Workload`
|
|
21
22
|
*/
|
|
@@ -82,6 +83,11 @@ export class Cedarling {
|
|
|
82
83
|
* makes authorization decision based on the [`Request`]
|
|
83
84
|
*/
|
|
84
85
|
authorize(request: any): Promise<AuthorizeResult>;
|
|
86
|
+
/**
|
|
87
|
+
* Authorize request for unsigned principals.
|
|
88
|
+
* makes authorization decision based on the [`RequestUnsigned`]
|
|
89
|
+
*/
|
|
90
|
+
authorize_unsigned(request: any): Promise<AuthorizeResult>;
|
|
85
91
|
/**
|
|
86
92
|
* Get logs and remove them from the storage.
|
|
87
93
|
* Returns `Array` of `Map`
|
|
@@ -169,6 +175,7 @@ export interface InitOutput {
|
|
|
169
175
|
readonly cedarling_new: (a: number) => number;
|
|
170
176
|
readonly cedarling_new_from_map: (a: number) => number;
|
|
171
177
|
readonly cedarling_authorize: (a: number, b: number) => number;
|
|
178
|
+
readonly cedarling_authorize_unsigned: (a: number, b: number) => number;
|
|
172
179
|
readonly cedarling_pop_logs: (a: number, b: number) => void;
|
|
173
180
|
readonly cedarling_get_log_by_id: (a: number, b: number, c: number, d: number) => void;
|
|
174
181
|
readonly cedarling_get_log_ids: (a: number) => number;
|
|
@@ -185,6 +192,7 @@ export interface InitOutput {
|
|
|
185
192
|
readonly __wbg_get_authorizeresult_request_id: (a: number, b: number) => void;
|
|
186
193
|
readonly __wbg_set_authorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
187
194
|
readonly authorizeresult_json_string: (a: number, b: number) => void;
|
|
195
|
+
readonly authorizeresult_principal: (a: number, b: number, c: number) => number;
|
|
188
196
|
readonly __wbg_authorizeresultresponse_free: (a: number, b: number) => void;
|
|
189
197
|
readonly authorizeresultresponse_decision: (a: number) => number;
|
|
190
198
|
readonly authorizeresultresponse_diagnostics: (a: number) => number;
|
package/cedarling_wasm.js
CHANGED
|
@@ -253,7 +253,7 @@ function __wbg_adapter_51(arg0, arg1, arg2) {
|
|
|
253
253
|
wasm.__wbindgen_export_6(arg0, arg1, addHeapObject(arg2));
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
-
function
|
|
256
|
+
function __wbg_adapter_173(arg0, arg1, arg2, arg3) {
|
|
257
257
|
wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
258
258
|
}
|
|
259
259
|
|
|
@@ -401,6 +401,16 @@ export class AuthorizeResult {
|
|
|
401
401
|
wasm.__wbindgen_export_4(deferred1_0, deferred1_1, 1);
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
|
+
/**
|
|
405
|
+
* @param {string} principal
|
|
406
|
+
* @returns {AuthorizeResultResponse | undefined}
|
|
407
|
+
*/
|
|
408
|
+
principal(principal) {
|
|
409
|
+
const ptr0 = passStringToWasm0(principal, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
410
|
+
const len0 = WASM_VECTOR_LEN;
|
|
411
|
+
const ret = wasm.authorizeresult_principal(this.__wbg_ptr, ptr0, len0);
|
|
412
|
+
return ret === 0 ? undefined : AuthorizeResultResponse.__wrap(ret);
|
|
413
|
+
}
|
|
404
414
|
}
|
|
405
415
|
|
|
406
416
|
const AuthorizeResultResponseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -506,6 +516,16 @@ export class Cedarling {
|
|
|
506
516
|
const ret = wasm.cedarling_authorize(this.__wbg_ptr, addHeapObject(request));
|
|
507
517
|
return takeObject(ret);
|
|
508
518
|
}
|
|
519
|
+
/**
|
|
520
|
+
* Authorize request for unsigned principals.
|
|
521
|
+
* makes authorization decision based on the [`RequestUnsigned`]
|
|
522
|
+
* @param {any} request
|
|
523
|
+
* @returns {Promise<AuthorizeResult>}
|
|
524
|
+
*/
|
|
525
|
+
authorize_unsigned(request) {
|
|
526
|
+
const ret = wasm.cedarling_authorize_unsigned(this.__wbg_ptr, addHeapObject(request));
|
|
527
|
+
return takeObject(ret);
|
|
528
|
+
}
|
|
509
529
|
/**
|
|
510
530
|
* Get logs and remove them from the storage.
|
|
511
531
|
* Returns `Array` of `Map`
|
|
@@ -1067,7 +1087,7 @@ function __wbg_get_imports() {
|
|
|
1067
1087
|
const a = state0.a;
|
|
1068
1088
|
state0.a = 0;
|
|
1069
1089
|
try {
|
|
1070
|
-
return
|
|
1090
|
+
return __wbg_adapter_173(a, state0.b, arg0, arg1);
|
|
1071
1091
|
} finally {
|
|
1072
1092
|
state0.a = a;
|
|
1073
1093
|
}
|
|
@@ -1296,12 +1316,12 @@ function __wbg_get_imports() {
|
|
|
1296
1316
|
const ret = false;
|
|
1297
1317
|
return ret;
|
|
1298
1318
|
};
|
|
1299
|
-
imports.wbg.
|
|
1300
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1319
|
+
imports.wbg.__wbindgen_closure_wrapper10821 = function(arg0, arg1, arg2) {
|
|
1320
|
+
const ret = makeMutClosure(arg0, arg1, 1936, __wbg_adapter_48);
|
|
1301
1321
|
return addHeapObject(ret);
|
|
1302
1322
|
};
|
|
1303
|
-
imports.wbg.
|
|
1304
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1323
|
+
imports.wbg.__wbindgen_closure_wrapper11703 = function(arg0, arg1, arg2) {
|
|
1324
|
+
const ret = makeMutClosure(arg0, arg1, 2135, __wbg_adapter_51);
|
|
1305
1325
|
return addHeapObject(ret);
|
|
1306
1326
|
};
|
|
1307
1327
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
package/cedarling_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@janssenproject/cedarling_wasm",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "The Cedarling is a performant local authorization service that runs the Rust Cedar Engine",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.7",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|