@janssenproject/cedarling_wasm 0.0.467-nodejs → 0.0.467
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 +167 -0
- package/cedarling_wasm.js +131 -50
- package/cedarling_wasm_bg.wasm +0 -0
- package/package.json +6 -2
package/cedarling_wasm.d.ts
CHANGED
|
@@ -911,3 +911,170 @@ export function init(config: any): Promise<Cedarling>;
|
|
|
911
911
|
* ```
|
|
912
912
|
*/
|
|
913
913
|
export function initFromArchiveBytes(config: any, archive_bytes: Uint8Array): Promise<Cedarling>;
|
|
914
|
+
|
|
915
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
916
|
+
|
|
917
|
+
export interface InitOutput {
|
|
918
|
+
readonly memory: WebAssembly.Memory;
|
|
919
|
+
readonly __wbg_authorizeresult_free: (a: number, b: number) => void;
|
|
920
|
+
readonly __wbg_authorizeresultresponse_free: (a: number, b: number) => void;
|
|
921
|
+
readonly __wbg_batchauthorizemultiissuerresponse_free: (a: number, b: number) => void;
|
|
922
|
+
readonly __wbg_batchitemerror_free: (a: number, b: number) => void;
|
|
923
|
+
readonly __wbg_batchitemmultiissuerresult_free: (a: number, b: number) => void;
|
|
924
|
+
readonly __wbg_cedarling_free: (a: number, b: number) => void;
|
|
925
|
+
readonly __wbg_dataentry_free: (a: number, b: number) => void;
|
|
926
|
+
readonly __wbg_datastorestats_free: (a: number, b: number) => void;
|
|
927
|
+
readonly __wbg_diagnostics_free: (a: number, b: number) => void;
|
|
928
|
+
readonly __wbg_get_authorizeresult_decision: (a: number) => number;
|
|
929
|
+
readonly __wbg_get_authorizeresult_request_id: (a: number, b: number) => void;
|
|
930
|
+
readonly __wbg_get_authorizeresult_response: (a: number) => number;
|
|
931
|
+
readonly __wbg_get_dataentry_access_count: (a: number) => bigint;
|
|
932
|
+
readonly __wbg_get_dataentry_created_at: (a: number, b: number) => void;
|
|
933
|
+
readonly __wbg_get_dataentry_data_type: (a: number, b: number) => void;
|
|
934
|
+
readonly __wbg_get_dataentry_expires_at: (a: number, b: number) => void;
|
|
935
|
+
readonly __wbg_get_dataentry_key: (a: number, b: number) => void;
|
|
936
|
+
readonly __wbg_get_datastorestats_avg_entry_size_bytes: (a: number) => number;
|
|
937
|
+
readonly __wbg_get_datastorestats_capacity_usage_percent: (a: number) => number;
|
|
938
|
+
readonly __wbg_get_datastorestats_entry_count: (a: number) => number;
|
|
939
|
+
readonly __wbg_get_datastorestats_max_entries: (a: number) => number;
|
|
940
|
+
readonly __wbg_get_datastorestats_max_entry_size: (a: number) => number;
|
|
941
|
+
readonly __wbg_get_datastorestats_memory_alert_threshold: (a: number) => number;
|
|
942
|
+
readonly __wbg_get_datastorestats_memory_alert_triggered: (a: number) => number;
|
|
943
|
+
readonly __wbg_get_datastorestats_metrics_enabled: (a: number) => number;
|
|
944
|
+
readonly __wbg_get_datastorestats_total_size_bytes: (a: number) => number;
|
|
945
|
+
readonly __wbg_policyevaluationerror_free: (a: number, b: number) => void;
|
|
946
|
+
readonly __wbg_set_authorizeresult_decision: (a: number, b: number) => void;
|
|
947
|
+
readonly __wbg_set_authorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
948
|
+
readonly __wbg_set_authorizeresult_response: (a: number, b: number) => void;
|
|
949
|
+
readonly __wbg_set_dataentry_access_count: (a: number, b: bigint) => void;
|
|
950
|
+
readonly __wbg_set_dataentry_created_at: (a: number, b: number, c: number) => void;
|
|
951
|
+
readonly __wbg_set_dataentry_data_type: (a: number, b: number, c: number) => void;
|
|
952
|
+
readonly __wbg_set_dataentry_expires_at: (a: number, b: number, c: number) => void;
|
|
953
|
+
readonly __wbg_set_dataentry_key: (a: number, b: number, c: number) => void;
|
|
954
|
+
readonly __wbg_set_datastorestats_avg_entry_size_bytes: (a: number, b: number) => void;
|
|
955
|
+
readonly __wbg_set_datastorestats_capacity_usage_percent: (a: number, b: number) => void;
|
|
956
|
+
readonly __wbg_set_datastorestats_entry_count: (a: number, b: number) => void;
|
|
957
|
+
readonly __wbg_set_datastorestats_max_entries: (a: number, b: number) => void;
|
|
958
|
+
readonly __wbg_set_datastorestats_max_entry_size: (a: number, b: number) => void;
|
|
959
|
+
readonly __wbg_set_datastorestats_memory_alert_threshold: (a: number, b: number) => void;
|
|
960
|
+
readonly __wbg_set_datastorestats_memory_alert_triggered: (a: number, b: number) => void;
|
|
961
|
+
readonly __wbg_set_datastorestats_metrics_enabled: (a: number, b: number) => void;
|
|
962
|
+
readonly __wbg_set_datastorestats_total_size_bytes: (a: number, b: number) => void;
|
|
963
|
+
readonly authorizeresult_jsonString: (a: number, b: number) => void;
|
|
964
|
+
readonly authorizeresultresponse_decision: (a: number) => number;
|
|
965
|
+
readonly authorizeresultresponse_diagnostics: (a: number) => number;
|
|
966
|
+
readonly batchauthorizemultiissuerresponse_batch_id: (a: number, b: number) => void;
|
|
967
|
+
readonly batchauthorizemultiissuerresponse_results: (a: number, b: number) => void;
|
|
968
|
+
readonly batchauthorizeunsignedresponse_results: (a: number, b: number) => void;
|
|
969
|
+
readonly batchitemerror_category: (a: number, b: number) => void;
|
|
970
|
+
readonly batchitemerror_item_index: (a: number) => number;
|
|
971
|
+
readonly batchitemerror_message: (a: number, b: number) => void;
|
|
972
|
+
readonly batchitemmultiissuerresult_error: (a: number) => number;
|
|
973
|
+
readonly batchitemmultiissuerresult_is_ok: (a: number) => number;
|
|
974
|
+
readonly batchitemmultiissuerresult_unwrap: (a: number, b: number) => void;
|
|
975
|
+
readonly batchitemunsignedresult_unwrap: (a: number, b: number) => void;
|
|
976
|
+
readonly cedarling_annotationValues: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
977
|
+
readonly cedarling_annotationsByPolicy: (a: number, b: number, c: number, d: number) => void;
|
|
978
|
+
readonly cedarling_annotationsMap: (a: number, b: number, c: number, d: number) => void;
|
|
979
|
+
readonly cedarling_authorizeMultiIssuer: (a: number, b: number, c: number) => number;
|
|
980
|
+
readonly cedarling_authorizeMultiIssuerBatch: (a: number, b: number, c: number) => number;
|
|
981
|
+
readonly cedarling_authorizeUnsigned: (a: number, b: number, c: number) => number;
|
|
982
|
+
readonly cedarling_authorizeUnsignedBatch: (a: number, b: number, c: number) => number;
|
|
983
|
+
readonly cedarling_clearDataCtx: (a: number, b: number) => void;
|
|
984
|
+
readonly cedarling_failedTrustedIssuerIds: (a: number) => number;
|
|
985
|
+
readonly cedarling_getDataCtx: (a: number, b: number, c: number, d: number) => void;
|
|
986
|
+
readonly cedarling_getDataEntryCtx: (a: number, b: number, c: number, d: number) => void;
|
|
987
|
+
readonly cedarling_getLogById: (a: number, b: number, c: number, d: number) => void;
|
|
988
|
+
readonly cedarling_getLogIds: (a: number) => number;
|
|
989
|
+
readonly cedarling_getLogsByRequestId: (a: number, b: number, c: number, d: number) => void;
|
|
990
|
+
readonly cedarling_getLogsByRequestIdAndTag: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
991
|
+
readonly cedarling_getStatsCtx: (a: number, b: number) => void;
|
|
992
|
+
readonly cedarling_isTrustedIssuerLoadedByIss: (a: number, b: number, c: number) => number;
|
|
993
|
+
readonly cedarling_isTrustedIssuerLoadedByName: (a: number, b: number, c: number) => number;
|
|
994
|
+
readonly cedarling_listDataCtx: (a: number, b: number) => void;
|
|
995
|
+
readonly cedarling_loadedTrustedIssuerIds: (a: number) => number;
|
|
996
|
+
readonly cedarling_loadedTrustedIssuersCount: (a: number) => number;
|
|
997
|
+
readonly cedarling_new: (a: number) => number;
|
|
998
|
+
readonly cedarling_newFromMap: (a: number) => number;
|
|
999
|
+
readonly cedarling_popLogs: (a: number, b: number) => void;
|
|
1000
|
+
readonly cedarling_pushDataCtx: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint) => void;
|
|
1001
|
+
readonly cedarling_removeDataCtx: (a: number, b: number, c: number, d: number) => void;
|
|
1002
|
+
readonly cedarling_shutDown: (a: number) => number;
|
|
1003
|
+
readonly cedarling_totalIssuers: (a: number) => number;
|
|
1004
|
+
readonly dataentry_jsonString: (a: number, b: number) => void;
|
|
1005
|
+
readonly dataentry_value: (a: number, b: number) => void;
|
|
1006
|
+
readonly datastorestats_jsonString: (a: number, b: number) => void;
|
|
1007
|
+
readonly diagnostics_errors: (a: number, b: number) => void;
|
|
1008
|
+
readonly diagnostics_reason: (a: number, b: number) => void;
|
|
1009
|
+
readonly init: (a: number) => number;
|
|
1010
|
+
readonly initFromArchiveBytes: (a: number, b: number) => number;
|
|
1011
|
+
readonly multiissuerauthorizeresult_jsonString: (a: number, b: number) => void;
|
|
1012
|
+
readonly policyevaluationerror_error: (a: number, b: number) => void;
|
|
1013
|
+
readonly policyevaluationerror_id: (a: number, b: number) => void;
|
|
1014
|
+
readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
1015
|
+
readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
1016
|
+
readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
1017
|
+
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
1018
|
+
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
|
1019
|
+
readonly intounderlyingbytesource_pull: (a: number, b: number) => number;
|
|
1020
|
+
readonly intounderlyingbytesource_start: (a: number, b: number) => void;
|
|
1021
|
+
readonly intounderlyingbytesource_type: (a: number) => number;
|
|
1022
|
+
readonly intounderlyingsink_abort: (a: number, b: number) => number;
|
|
1023
|
+
readonly intounderlyingsink_close: (a: number) => number;
|
|
1024
|
+
readonly intounderlyingsink_write: (a: number, b: number) => number;
|
|
1025
|
+
readonly intounderlyingsource_cancel: (a: number) => void;
|
|
1026
|
+
readonly intounderlyingsource_pull: (a: number, b: number) => number;
|
|
1027
|
+
readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
|
|
1028
|
+
readonly rust_zstd_wasm_shim_free: (a: number) => void;
|
|
1029
|
+
readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
|
|
1030
|
+
readonly rust_zstd_wasm_shim_memcmp: (a: number, b: number, c: number) => number;
|
|
1031
|
+
readonly rust_zstd_wasm_shim_memcpy: (a: number, b: number, c: number) => number;
|
|
1032
|
+
readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
|
|
1033
|
+
readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
|
|
1034
|
+
readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
|
|
1035
|
+
readonly __wbg_get_multiissuerauthorizeresult_decision: (a: number) => number;
|
|
1036
|
+
readonly __wbg_set_multiissuerauthorizeresult_response: (a: number, b: number) => void;
|
|
1037
|
+
readonly __wbg_set_multiissuerauthorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
1038
|
+
readonly __wbg_set_multiissuerauthorizeresult_decision: (a: number, b: number) => void;
|
|
1039
|
+
readonly __wbg_get_multiissuerauthorizeresult_response: (a: number) => number;
|
|
1040
|
+
readonly __wbg_get_multiissuerauthorizeresult_request_id: (a: number, b: number) => void;
|
|
1041
|
+
readonly __wbg_multiissuerauthorizeresult_free: (a: number, b: number) => void;
|
|
1042
|
+
readonly __wbg_batchitemunsignedresult_free: (a: number, b: number) => void;
|
|
1043
|
+
readonly __wbg_batchauthorizeunsignedresponse_free: (a: number, b: number) => void;
|
|
1044
|
+
readonly batchitemunsignedresult_is_ok: (a: number) => number;
|
|
1045
|
+
readonly batchitemunsignedresult_error: (a: number) => number;
|
|
1046
|
+
readonly batchauthorizeunsignedresponse_batch_id: (a: number, b: number) => void;
|
|
1047
|
+
readonly cedarling_getLogsByTag: (a: number, b: number, c: number, d: number) => void;
|
|
1048
|
+
readonly __wasm_bindgen_func_elem_8902: (a: number, b: number, c: number, d: number) => void;
|
|
1049
|
+
readonly __wasm_bindgen_func_elem_8968: (a: number, b: number, c: number, d: number) => void;
|
|
1050
|
+
readonly __wasm_bindgen_func_elem_12454: (a: number, b: number, c: number) => void;
|
|
1051
|
+
readonly __wasm_bindgen_func_elem_8737: (a: number, b: number) => void;
|
|
1052
|
+
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
1053
|
+
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
1054
|
+
readonly __wbindgen_export3: (a: number) => void;
|
|
1055
|
+
readonly __wbindgen_export4: (a: number, b: number) => void;
|
|
1056
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
1057
|
+
readonly __wbindgen_export5: (a: number, b: number, c: number) => void;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
1061
|
+
|
|
1062
|
+
/**
|
|
1063
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
1064
|
+
* a precompiled `WebAssembly.Module`.
|
|
1065
|
+
*
|
|
1066
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
1067
|
+
*
|
|
1068
|
+
* @returns {InitOutput}
|
|
1069
|
+
*/
|
|
1070
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
1071
|
+
|
|
1072
|
+
/**
|
|
1073
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
1074
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
1075
|
+
*
|
|
1076
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
1077
|
+
*
|
|
1078
|
+
* @returns {Promise<InitOutput>}
|
|
1079
|
+
*/
|
|
1080
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
package/cedarling_wasm.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* A WASM wrapper for the Rust `cedarling::AuthorizeResult` struct.
|
|
5
5
|
* Represents the result of an authorization request.
|
|
6
6
|
*/
|
|
7
|
-
class AuthorizeResult {
|
|
7
|
+
export class AuthorizeResult {
|
|
8
8
|
static __wrap(ptr) {
|
|
9
9
|
const obj = Object.create(AuthorizeResult.prototype);
|
|
10
10
|
obj.__wbg_ptr = ptr;
|
|
@@ -112,13 +112,12 @@ class AuthorizeResult {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
if (Symbol.dispose) AuthorizeResult.prototype[Symbol.dispose] = AuthorizeResult.prototype.free;
|
|
115
|
-
exports.AuthorizeResult = AuthorizeResult;
|
|
116
115
|
|
|
117
116
|
/**
|
|
118
117
|
* A WASM wrapper for the Rust `cedar_policy::Response` struct.
|
|
119
118
|
* Represents the result of an authorization request.
|
|
120
119
|
*/
|
|
121
|
-
class AuthorizeResultResponse {
|
|
120
|
+
export class AuthorizeResultResponse {
|
|
122
121
|
static __wrap(ptr) {
|
|
123
122
|
const obj = Object.create(AuthorizeResultResponse.prototype);
|
|
124
123
|
obj.__wbg_ptr = ptr;
|
|
@@ -153,14 +152,13 @@ class AuthorizeResultResponse {
|
|
|
153
152
|
}
|
|
154
153
|
}
|
|
155
154
|
if (Symbol.dispose) AuthorizeResultResponse.prototype[Symbol.dispose] = AuthorizeResultResponse.prototype.free;
|
|
156
|
-
exports.AuthorizeResultResponse = AuthorizeResultResponse;
|
|
157
155
|
|
|
158
156
|
/**
|
|
159
157
|
* WASM wrapper for
|
|
160
158
|
* `cedarling::BatchAuthorizeResponse<Result<MultiIssuerAuthorizeResult, BatchItemError>>`.
|
|
161
159
|
* Same shape as [`BatchAuthorizeUnsignedResponse`] with multi-issuer results.
|
|
162
160
|
*/
|
|
163
|
-
class BatchAuthorizeMultiIssuerResponse {
|
|
161
|
+
export class BatchAuthorizeMultiIssuerResponse {
|
|
164
162
|
static __wrap(ptr) {
|
|
165
163
|
const obj = Object.create(BatchAuthorizeMultiIssuerResponse.prototype);
|
|
166
164
|
obj.__wbg_ptr = ptr;
|
|
@@ -217,7 +215,6 @@ class BatchAuthorizeMultiIssuerResponse {
|
|
|
217
215
|
}
|
|
218
216
|
}
|
|
219
217
|
if (Symbol.dispose) BatchAuthorizeMultiIssuerResponse.prototype[Symbol.dispose] = BatchAuthorizeMultiIssuerResponse.prototype.free;
|
|
220
|
-
exports.BatchAuthorizeMultiIssuerResponse = BatchAuthorizeMultiIssuerResponse;
|
|
221
218
|
|
|
222
219
|
/**
|
|
223
220
|
* WASM wrapper for `cedarling::BatchAuthorizeResponse<Result<AuthorizeResult, BatchItemError>>`.
|
|
@@ -226,7 +223,7 @@ exports.BatchAuthorizeMultiIssuerResponse = BatchAuthorizeMultiIssuerResponse;
|
|
|
226
223
|
* is a [`BatchItemUnsignedResult`] — Cedar decision on `is_ok()`, per-item
|
|
227
224
|
* build failure on `error`. `results[i]` corresponds to `items[i]`.
|
|
228
225
|
*/
|
|
229
|
-
class BatchAuthorizeUnsignedResponse {
|
|
226
|
+
export class BatchAuthorizeUnsignedResponse {
|
|
230
227
|
static __wrap(ptr) {
|
|
231
228
|
const obj = Object.create(BatchAuthorizeUnsignedResponse.prototype);
|
|
232
229
|
obj.__wbg_ptr = ptr;
|
|
@@ -283,13 +280,12 @@ class BatchAuthorizeUnsignedResponse {
|
|
|
283
280
|
}
|
|
284
281
|
}
|
|
285
282
|
if (Symbol.dispose) BatchAuthorizeUnsignedResponse.prototype[Symbol.dispose] = BatchAuthorizeUnsignedResponse.prototype.free;
|
|
286
|
-
exports.BatchAuthorizeUnsignedResponse = BatchAuthorizeUnsignedResponse;
|
|
287
283
|
|
|
288
284
|
/**
|
|
289
285
|
* Per-item build failure surfaced inside a batch response at `results[i]`
|
|
290
286
|
* when Cedar couldn't be reached for that item.
|
|
291
287
|
*/
|
|
292
|
-
class BatchItemError {
|
|
288
|
+
export class BatchItemError {
|
|
293
289
|
static __wrap(ptr) {
|
|
294
290
|
const obj = Object.create(BatchItemError.prototype);
|
|
295
291
|
obj.__wbg_ptr = ptr;
|
|
@@ -358,12 +354,11 @@ class BatchItemError {
|
|
|
358
354
|
}
|
|
359
355
|
}
|
|
360
356
|
if (Symbol.dispose) BatchItemError.prototype[Symbol.dispose] = BatchItemError.prototype.free;
|
|
361
|
-
exports.BatchItemError = BatchItemError;
|
|
362
357
|
|
|
363
358
|
/**
|
|
364
359
|
* Multi-issuer analog of [`BatchItemUnsignedResult`].
|
|
365
360
|
*/
|
|
366
|
-
class BatchItemMultiIssuerResult {
|
|
361
|
+
export class BatchItemMultiIssuerResult {
|
|
367
362
|
static __wrap(ptr) {
|
|
368
363
|
const obj = Object.create(BatchItemMultiIssuerResult.prototype);
|
|
369
364
|
obj.__wbg_ptr = ptr;
|
|
@@ -417,13 +412,12 @@ class BatchItemMultiIssuerResult {
|
|
|
417
412
|
}
|
|
418
413
|
}
|
|
419
414
|
if (Symbol.dispose) BatchItemMultiIssuerResult.prototype[Symbol.dispose] = BatchItemMultiIssuerResult.prototype.free;
|
|
420
|
-
exports.BatchItemMultiIssuerResult = BatchItemMultiIssuerResult;
|
|
421
415
|
|
|
422
416
|
/**
|
|
423
417
|
* One slot in a batch response's `results` array. Callers switch on
|
|
424
418
|
* `is_ok()` — on `true`, read `unwrap()`; on `false`, read `error()`.
|
|
425
419
|
*/
|
|
426
|
-
class BatchItemUnsignedResult {
|
|
420
|
+
export class BatchItemUnsignedResult {
|
|
427
421
|
static __wrap(ptr) {
|
|
428
422
|
const obj = Object.create(BatchItemUnsignedResult.prototype);
|
|
429
423
|
obj.__wbg_ptr = ptr;
|
|
@@ -478,12 +472,11 @@ class BatchItemUnsignedResult {
|
|
|
478
472
|
}
|
|
479
473
|
}
|
|
480
474
|
if (Symbol.dispose) BatchItemUnsignedResult.prototype[Symbol.dispose] = BatchItemUnsignedResult.prototype.free;
|
|
481
|
-
exports.BatchItemUnsignedResult = BatchItemUnsignedResult;
|
|
482
475
|
|
|
483
476
|
/**
|
|
484
477
|
* The instance of the Cedarling application.
|
|
485
478
|
*/
|
|
486
|
-
class Cedarling {
|
|
479
|
+
export class Cedarling {
|
|
487
480
|
static __wrap(ptr) {
|
|
488
481
|
const obj = Object.create(Cedarling.prototype);
|
|
489
482
|
obj.__wbg_ptr = ptr;
|
|
@@ -1339,13 +1332,12 @@ class Cedarling {
|
|
|
1339
1332
|
}
|
|
1340
1333
|
}
|
|
1341
1334
|
if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
|
|
1342
|
-
exports.Cedarling = Cedarling;
|
|
1343
1335
|
|
|
1344
1336
|
/**
|
|
1345
1337
|
* A WASM wrapper for the Rust `cedarling::DataEntry` struct.
|
|
1346
1338
|
* Represents a data entry in the DataStore with value and metadata.
|
|
1347
1339
|
*/
|
|
1348
|
-
class DataEntry {
|
|
1340
|
+
export class DataEntry {
|
|
1349
1341
|
static __wrap(ptr) {
|
|
1350
1342
|
const obj = Object.create(DataEntry.prototype);
|
|
1351
1343
|
obj.__wbg_ptr = ptr;
|
|
@@ -1534,13 +1526,12 @@ class DataEntry {
|
|
|
1534
1526
|
}
|
|
1535
1527
|
}
|
|
1536
1528
|
if (Symbol.dispose) DataEntry.prototype[Symbol.dispose] = DataEntry.prototype.free;
|
|
1537
|
-
exports.DataEntry = DataEntry;
|
|
1538
1529
|
|
|
1539
1530
|
/**
|
|
1540
1531
|
* A WASM wrapper for the Rust `cedarling::DataStoreStats` struct.
|
|
1541
1532
|
* Statistics about the DataStore.
|
|
1542
1533
|
*/
|
|
1543
|
-
class DataStoreStats {
|
|
1534
|
+
export class DataStoreStats {
|
|
1544
1535
|
static __wrap(ptr) {
|
|
1545
1536
|
const obj = Object.create(DataStoreStats.prototype);
|
|
1546
1537
|
obj.__wbg_ptr = ptr;
|
|
@@ -1714,7 +1705,6 @@ class DataStoreStats {
|
|
|
1714
1705
|
}
|
|
1715
1706
|
}
|
|
1716
1707
|
if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.prototype.free;
|
|
1717
|
-
exports.DataStoreStats = DataStoreStats;
|
|
1718
1708
|
|
|
1719
1709
|
/**
|
|
1720
1710
|
* Diagnostics
|
|
@@ -1722,7 +1712,7 @@ exports.DataStoreStats = DataStoreStats;
|
|
|
1722
1712
|
*
|
|
1723
1713
|
* Provides detailed information about how a policy decision was made, including policies that contributed to the decision and any errors encountered during evaluation.
|
|
1724
1714
|
*/
|
|
1725
|
-
class Diagnostics {
|
|
1715
|
+
export class Diagnostics {
|
|
1726
1716
|
static __wrap(ptr) {
|
|
1727
1717
|
const obj = Object.create(Diagnostics.prototype);
|
|
1728
1718
|
obj.__wbg_ptr = ptr;
|
|
@@ -1779,9 +1769,8 @@ class Diagnostics {
|
|
|
1779
1769
|
}
|
|
1780
1770
|
}
|
|
1781
1771
|
if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
|
|
1782
|
-
exports.Diagnostics = Diagnostics;
|
|
1783
1772
|
|
|
1784
|
-
class IntoUnderlyingByteSource {
|
|
1773
|
+
export class IntoUnderlyingByteSource {
|
|
1785
1774
|
__destroy_into_raw() {
|
|
1786
1775
|
const ptr = this.__wbg_ptr;
|
|
1787
1776
|
this.__wbg_ptr = 0;
|
|
@@ -1826,9 +1815,8 @@ class IntoUnderlyingByteSource {
|
|
|
1826
1815
|
}
|
|
1827
1816
|
}
|
|
1828
1817
|
if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
|
|
1829
|
-
exports.IntoUnderlyingByteSource = IntoUnderlyingByteSource;
|
|
1830
1818
|
|
|
1831
|
-
class IntoUnderlyingSink {
|
|
1819
|
+
export class IntoUnderlyingSink {
|
|
1832
1820
|
__destroy_into_raw() {
|
|
1833
1821
|
const ptr = this.__wbg_ptr;
|
|
1834
1822
|
this.__wbg_ptr = 0;
|
|
@@ -1866,9 +1854,8 @@ class IntoUnderlyingSink {
|
|
|
1866
1854
|
}
|
|
1867
1855
|
}
|
|
1868
1856
|
if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
|
|
1869
|
-
exports.IntoUnderlyingSink = IntoUnderlyingSink;
|
|
1870
1857
|
|
|
1871
|
-
class IntoUnderlyingSource {
|
|
1858
|
+
export class IntoUnderlyingSource {
|
|
1872
1859
|
__destroy_into_raw() {
|
|
1873
1860
|
const ptr = this.__wbg_ptr;
|
|
1874
1861
|
this.__wbg_ptr = 0;
|
|
@@ -1893,13 +1880,12 @@ class IntoUnderlyingSource {
|
|
|
1893
1880
|
}
|
|
1894
1881
|
}
|
|
1895
1882
|
if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
|
|
1896
|
-
exports.IntoUnderlyingSource = IntoUnderlyingSource;
|
|
1897
1883
|
|
|
1898
1884
|
/**
|
|
1899
1885
|
* A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
|
|
1900
1886
|
* Represents the result of a multi-issuer authorization request.
|
|
1901
1887
|
*/
|
|
1902
|
-
class MultiIssuerAuthorizeResult {
|
|
1888
|
+
export class MultiIssuerAuthorizeResult {
|
|
1903
1889
|
static __wrap(ptr) {
|
|
1904
1890
|
const obj = Object.create(MultiIssuerAuthorizeResult.prototype);
|
|
1905
1891
|
obj.__wbg_ptr = ptr;
|
|
@@ -2003,7 +1989,6 @@ class MultiIssuerAuthorizeResult {
|
|
|
2003
1989
|
}
|
|
2004
1990
|
}
|
|
2005
1991
|
if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
|
|
2006
|
-
exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
|
|
2007
1992
|
|
|
2008
1993
|
/**
|
|
2009
1994
|
* PolicyEvaluationError
|
|
@@ -2011,7 +1996,7 @@ exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
|
|
|
2011
1996
|
*
|
|
2012
1997
|
* Represents an error that occurred when evaluating a Cedar policy.
|
|
2013
1998
|
*/
|
|
2014
|
-
class PolicyEvaluationError {
|
|
1999
|
+
export class PolicyEvaluationError {
|
|
2015
2000
|
static __wrap(ptr) {
|
|
2016
2001
|
const obj = Object.create(PolicyEvaluationError.prototype);
|
|
2017
2002
|
obj.__wbg_ptr = ptr;
|
|
@@ -2070,7 +2055,6 @@ class PolicyEvaluationError {
|
|
|
2070
2055
|
}
|
|
2071
2056
|
}
|
|
2072
2057
|
if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
|
|
2073
|
-
exports.PolicyEvaluationError = PolicyEvaluationError;
|
|
2074
2058
|
|
|
2075
2059
|
/**
|
|
2076
2060
|
* Creates a Cedarling application from bootstrap properties.
|
|
@@ -2094,11 +2078,10 @@ exports.PolicyEvaluationError = PolicyEvaluationError;
|
|
|
2094
2078
|
* @param {any} config
|
|
2095
2079
|
* @returns {Promise<Cedarling>}
|
|
2096
2080
|
*/
|
|
2097
|
-
function init(config) {
|
|
2081
|
+
export function init(config) {
|
|
2098
2082
|
const ret = wasm.init(addHeapObject(config));
|
|
2099
2083
|
return takeObject(ret);
|
|
2100
2084
|
}
|
|
2101
|
-
exports.init = init;
|
|
2102
2085
|
|
|
2103
2086
|
/**
|
|
2104
2087
|
* Create a new instance of the Cedarling application from archive bytes.
|
|
@@ -2130,11 +2113,10 @@ exports.init = init;
|
|
|
2130
2113
|
* @param {Uint8Array} archive_bytes
|
|
2131
2114
|
* @returns {Promise<Cedarling>}
|
|
2132
2115
|
*/
|
|
2133
|
-
function initFromArchiveBytes(config, archive_bytes) {
|
|
2116
|
+
export function initFromArchiveBytes(config, archive_bytes) {
|
|
2134
2117
|
const ret = wasm.initFromArchiveBytes(addHeapObject(config), addHeapObject(archive_bytes));
|
|
2135
2118
|
return takeObject(ret);
|
|
2136
2119
|
}
|
|
2137
|
-
exports.initFromArchiveBytes = initFromArchiveBytes;
|
|
2138
2120
|
function __wbg_get_imports() {
|
|
2139
2121
|
const import0 = {
|
|
2140
2122
|
__proto__: null,
|
|
@@ -2550,7 +2532,7 @@ function __wbg_get_imports() {
|
|
|
2550
2532
|
const a = state0.a;
|
|
2551
2533
|
state0.a = 0;
|
|
2552
2534
|
try {
|
|
2553
|
-
return
|
|
2535
|
+
return __wasm_bindgen_func_elem_8968(a, state0.b, arg0, arg1);
|
|
2554
2536
|
} finally {
|
|
2555
2537
|
state0.a = a;
|
|
2556
2538
|
}
|
|
@@ -2760,7 +2742,7 @@ function __wbg_get_imports() {
|
|
|
2760
2742
|
},
|
|
2761
2743
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2762
2744
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1010, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2763
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2745
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8902);
|
|
2764
2746
|
return addHeapObject(ret);
|
|
2765
2747
|
},
|
|
2766
2748
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
@@ -2770,7 +2752,7 @@ function __wbg_get_imports() {
|
|
|
2770
2752
|
},
|
|
2771
2753
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
2772
2754
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 1003, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2773
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2755
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8737);
|
|
2774
2756
|
return addHeapObject(ret);
|
|
2775
2757
|
},
|
|
2776
2758
|
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
@@ -2812,18 +2794,18 @@ function __wbg_get_imports() {
|
|
|
2812
2794
|
};
|
|
2813
2795
|
}
|
|
2814
2796
|
|
|
2815
|
-
function
|
|
2816
|
-
wasm.
|
|
2797
|
+
function __wasm_bindgen_func_elem_8737(arg0, arg1) {
|
|
2798
|
+
wasm.__wasm_bindgen_func_elem_8737(arg0, arg1);
|
|
2817
2799
|
}
|
|
2818
2800
|
|
|
2819
2801
|
function __wasm_bindgen_func_elem_12454(arg0, arg1, arg2) {
|
|
2820
2802
|
wasm.__wasm_bindgen_func_elem_12454(arg0, arg1, addHeapObject(arg2));
|
|
2821
2803
|
}
|
|
2822
2804
|
|
|
2823
|
-
function
|
|
2805
|
+
function __wasm_bindgen_func_elem_8902(arg0, arg1, arg2) {
|
|
2824
2806
|
try {
|
|
2825
2807
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2826
|
-
wasm.
|
|
2808
|
+
wasm.__wasm_bindgen_func_elem_8902(retptr, arg0, arg1, addHeapObject(arg2));
|
|
2827
2809
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2828
2810
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2829
2811
|
if (r1) {
|
|
@@ -2834,8 +2816,8 @@ function __wasm_bindgen_func_elem_8904(arg0, arg1, arg2) {
|
|
|
2834
2816
|
}
|
|
2835
2817
|
}
|
|
2836
2818
|
|
|
2837
|
-
function
|
|
2838
|
-
wasm.
|
|
2819
|
+
function __wasm_bindgen_func_elem_8968(arg0, arg1, arg2, arg3) {
|
|
2820
|
+
wasm.__wasm_bindgen_func_elem_8968(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
2839
2821
|
}
|
|
2840
2822
|
|
|
2841
2823
|
|
|
@@ -3131,7 +3113,15 @@ function takeObject(idx) {
|
|
|
3131
3113
|
|
|
3132
3114
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
3133
3115
|
cachedTextDecoder.decode();
|
|
3116
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
3117
|
+
let numBytesDecoded = 0;
|
|
3134
3118
|
function decodeText(ptr, len) {
|
|
3119
|
+
numBytesDecoded += len;
|
|
3120
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
3121
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
3122
|
+
cachedTextDecoder.decode();
|
|
3123
|
+
numBytesDecoded = len;
|
|
3124
|
+
}
|
|
3135
3125
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
3136
3126
|
}
|
|
3137
3127
|
|
|
@@ -3150,8 +3140,99 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
3150
3140
|
|
|
3151
3141
|
let WASM_VECTOR_LEN = 0;
|
|
3152
3142
|
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3143
|
+
let wasmModule, wasmInstance, wasm;
|
|
3144
|
+
function __wbg_finalize_init(instance, module) {
|
|
3145
|
+
wasmInstance = instance;
|
|
3146
|
+
wasm = instance.exports;
|
|
3147
|
+
wasmModule = module;
|
|
3148
|
+
cachedDataViewMemory0 = null;
|
|
3149
|
+
cachedUint8ArrayMemory0 = null;
|
|
3150
|
+
return wasm;
|
|
3151
|
+
}
|
|
3152
|
+
|
|
3153
|
+
async function __wbg_load(module, imports) {
|
|
3154
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
3155
|
+
if (!module.ok) {
|
|
3156
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
3157
|
+
}
|
|
3158
|
+
|
|
3159
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
3160
|
+
try {
|
|
3161
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
3162
|
+
} catch (e) {
|
|
3163
|
+
const validResponse = expectedResponseType(module.type);
|
|
3164
|
+
|
|
3165
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
3166
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
3167
|
+
|
|
3168
|
+
} else { throw e; }
|
|
3169
|
+
}
|
|
3170
|
+
}
|
|
3171
|
+
|
|
3172
|
+
const bytes = await module.arrayBuffer();
|
|
3173
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
3174
|
+
} else {
|
|
3175
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
3176
|
+
|
|
3177
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
3178
|
+
return { instance, module };
|
|
3179
|
+
} else {
|
|
3180
|
+
return instance;
|
|
3181
|
+
}
|
|
3182
|
+
}
|
|
3183
|
+
|
|
3184
|
+
function expectedResponseType(type) {
|
|
3185
|
+
switch (type) {
|
|
3186
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
3187
|
+
}
|
|
3188
|
+
return false;
|
|
3189
|
+
}
|
|
3190
|
+
}
|
|
3191
|
+
|
|
3192
|
+
function initSync(module) {
|
|
3193
|
+
if (wasm !== undefined) return wasm;
|
|
3194
|
+
|
|
3195
|
+
|
|
3196
|
+
if (module !== undefined) {
|
|
3197
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
3198
|
+
({module} = module)
|
|
3199
|
+
} else {
|
|
3200
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
3201
|
+
}
|
|
3202
|
+
}
|
|
3203
|
+
|
|
3204
|
+
const imports = __wbg_get_imports();
|
|
3205
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
3206
|
+
module = new WebAssembly.Module(module);
|
|
3207
|
+
}
|
|
3208
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
3209
|
+
return __wbg_finalize_init(instance, module);
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3212
|
+
async function __wbg_init(module_or_path) {
|
|
3213
|
+
if (wasm !== undefined) return wasm;
|
|
3214
|
+
|
|
3215
|
+
|
|
3216
|
+
if (module_or_path !== undefined) {
|
|
3217
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
3218
|
+
({module_or_path} = module_or_path)
|
|
3219
|
+
} else {
|
|
3220
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
3221
|
+
}
|
|
3222
|
+
}
|
|
3223
|
+
|
|
3224
|
+
if (module_or_path === undefined) {
|
|
3225
|
+
module_or_path = new URL('cedarling_wasm_bg.wasm', import.meta.url);
|
|
3226
|
+
}
|
|
3227
|
+
const imports = __wbg_get_imports();
|
|
3228
|
+
|
|
3229
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
3230
|
+
module_or_path = fetch(module_or_path);
|
|
3231
|
+
}
|
|
3232
|
+
|
|
3233
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
3234
|
+
|
|
3235
|
+
return __wbg_finalize_init(instance, module);
|
|
3236
|
+
}
|
|
3237
|
+
|
|
3238
|
+
export { initSync, __wbg_init as default };
|
package/cedarling_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@janssenproject/cedarling_wasm",
|
|
3
|
+
"type": "module",
|
|
3
4
|
"description": "The Cedarling is a performant local authorization service that runs the Rust Cedar Engine",
|
|
4
|
-
"version": "0.0.467
|
|
5
|
+
"version": "0.0.467",
|
|
5
6
|
"license": "Apache-2.0",
|
|
6
7
|
"repository": {
|
|
7
8
|
"type": "git",
|
|
@@ -13,5 +14,8 @@
|
|
|
13
14
|
"cedarling_wasm.d.ts"
|
|
14
15
|
],
|
|
15
16
|
"main": "cedarling_wasm.js",
|
|
16
|
-
"types": "cedarling_wasm.d.ts"
|
|
17
|
+
"types": "cedarling_wasm.d.ts",
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"./snippets/*"
|
|
20
|
+
]
|
|
17
21
|
}
|