@janssenproject/cedarling_wasm 0.0.441 → 0.0.442-nodejs
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 +0 -167
- package/cedarling_wasm.js +50 -127
- package/cedarling_wasm_bg.wasm +0 -0
- package/package.json +2 -6
package/cedarling_wasm.d.ts
CHANGED
|
@@ -757,170 +757,3 @@ export function init(config: any): Promise<Cedarling>;
|
|
|
757
757
|
* ```
|
|
758
758
|
*/
|
|
759
759
|
export function init_from_archive_bytes(config: any, archive_bytes: Uint8Array): Promise<Cedarling>;
|
|
760
|
-
|
|
761
|
-
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
762
|
-
|
|
763
|
-
export interface InitOutput {
|
|
764
|
-
readonly memory: WebAssembly.Memory;
|
|
765
|
-
readonly __wbg_authorizeresult_free: (a: number, b: number) => void;
|
|
766
|
-
readonly __wbg_authorizeresultresponse_free: (a: number, b: number) => void;
|
|
767
|
-
readonly __wbg_batchauthorizemultiissuerresponse_free: (a: number, b: number) => void;
|
|
768
|
-
readonly __wbg_batchitemerror_free: (a: number, b: number) => void;
|
|
769
|
-
readonly __wbg_batchitemmultiissuerresult_free: (a: number, b: number) => void;
|
|
770
|
-
readonly __wbg_cedarling_free: (a: number, b: number) => void;
|
|
771
|
-
readonly __wbg_dataentry_free: (a: number, b: number) => void;
|
|
772
|
-
readonly __wbg_datastorestats_free: (a: number, b: number) => void;
|
|
773
|
-
readonly __wbg_diagnostics_free: (a: number, b: number) => void;
|
|
774
|
-
readonly __wbg_get_authorizeresult_decision: (a: number) => number;
|
|
775
|
-
readonly __wbg_get_authorizeresult_request_id: (a: number, b: number) => void;
|
|
776
|
-
readonly __wbg_get_authorizeresult_response: (a: number) => number;
|
|
777
|
-
readonly __wbg_get_dataentry_access_count: (a: number) => bigint;
|
|
778
|
-
readonly __wbg_get_dataentry_created_at: (a: number, b: number) => void;
|
|
779
|
-
readonly __wbg_get_dataentry_data_type: (a: number, b: number) => void;
|
|
780
|
-
readonly __wbg_get_dataentry_expires_at: (a: number, b: number) => void;
|
|
781
|
-
readonly __wbg_get_dataentry_key: (a: number, b: number) => void;
|
|
782
|
-
readonly __wbg_get_datastorestats_avg_entry_size_bytes: (a: number) => number;
|
|
783
|
-
readonly __wbg_get_datastorestats_capacity_usage_percent: (a: number) => number;
|
|
784
|
-
readonly __wbg_get_datastorestats_entry_count: (a: number) => number;
|
|
785
|
-
readonly __wbg_get_datastorestats_max_entries: (a: number) => number;
|
|
786
|
-
readonly __wbg_get_datastorestats_max_entry_size: (a: number) => number;
|
|
787
|
-
readonly __wbg_get_datastorestats_memory_alert_threshold: (a: number) => number;
|
|
788
|
-
readonly __wbg_get_datastorestats_memory_alert_triggered: (a: number) => number;
|
|
789
|
-
readonly __wbg_get_datastorestats_metrics_enabled: (a: number) => number;
|
|
790
|
-
readonly __wbg_get_datastorestats_total_size_bytes: (a: number) => number;
|
|
791
|
-
readonly __wbg_policyevaluationerror_free: (a: number, b: number) => void;
|
|
792
|
-
readonly __wbg_set_authorizeresult_decision: (a: number, b: number) => void;
|
|
793
|
-
readonly __wbg_set_authorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
794
|
-
readonly __wbg_set_authorizeresult_response: (a: number, b: number) => void;
|
|
795
|
-
readonly __wbg_set_dataentry_access_count: (a: number, b: bigint) => void;
|
|
796
|
-
readonly __wbg_set_dataentry_created_at: (a: number, b: number, c: number) => void;
|
|
797
|
-
readonly __wbg_set_dataentry_data_type: (a: number, b: number, c: number) => void;
|
|
798
|
-
readonly __wbg_set_dataentry_expires_at: (a: number, b: number, c: number) => void;
|
|
799
|
-
readonly __wbg_set_dataentry_key: (a: number, b: number, c: number) => void;
|
|
800
|
-
readonly __wbg_set_datastorestats_avg_entry_size_bytes: (a: number, b: number) => void;
|
|
801
|
-
readonly __wbg_set_datastorestats_capacity_usage_percent: (a: number, b: number) => void;
|
|
802
|
-
readonly __wbg_set_datastorestats_entry_count: (a: number, b: number) => void;
|
|
803
|
-
readonly __wbg_set_datastorestats_max_entries: (a: number, b: number) => void;
|
|
804
|
-
readonly __wbg_set_datastorestats_max_entry_size: (a: number, b: number) => void;
|
|
805
|
-
readonly __wbg_set_datastorestats_memory_alert_threshold: (a: number, b: number) => void;
|
|
806
|
-
readonly __wbg_set_datastorestats_memory_alert_triggered: (a: number, b: number) => void;
|
|
807
|
-
readonly __wbg_set_datastorestats_metrics_enabled: (a: number, b: number) => void;
|
|
808
|
-
readonly __wbg_set_datastorestats_total_size_bytes: (a: number, b: number) => void;
|
|
809
|
-
readonly authorizeresult_json_string: (a: number, b: number) => void;
|
|
810
|
-
readonly authorizeresultresponse_decision: (a: number) => number;
|
|
811
|
-
readonly authorizeresultresponse_diagnostics: (a: number) => number;
|
|
812
|
-
readonly batchauthorizemultiissuerresponse_batch_id: (a: number, b: number) => void;
|
|
813
|
-
readonly batchauthorizemultiissuerresponse_results: (a: number, b: number) => void;
|
|
814
|
-
readonly batchauthorizeunsignedresponse_results: (a: number, b: number) => void;
|
|
815
|
-
readonly batchitemerror_category: (a: number, b: number) => void;
|
|
816
|
-
readonly batchitemerror_item_index: (a: number) => number;
|
|
817
|
-
readonly batchitemerror_message: (a: number, b: number) => void;
|
|
818
|
-
readonly batchitemmultiissuerresult_error: (a: number) => number;
|
|
819
|
-
readonly batchitemmultiissuerresult_is_ok: (a: number) => number;
|
|
820
|
-
readonly batchitemmultiissuerresult_unwrap: (a: number, b: number) => void;
|
|
821
|
-
readonly batchitemunsignedresult_unwrap: (a: number, b: number) => void;
|
|
822
|
-
readonly cedarling_annotation_values: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
823
|
-
readonly cedarling_annotations_by_policy: (a: number, b: number, c: number, d: number) => void;
|
|
824
|
-
readonly cedarling_annotations_map: (a: number, b: number, c: number, d: number) => void;
|
|
825
|
-
readonly cedarling_authorize_multi_issuer: (a: number, b: number, c: number) => number;
|
|
826
|
-
readonly cedarling_authorize_multi_issuer_batch: (a: number, b: number, c: number) => number;
|
|
827
|
-
readonly cedarling_authorize_unsigned: (a: number, b: number, c: number) => number;
|
|
828
|
-
readonly cedarling_authorize_unsigned_batch: (a: number, b: number, c: number) => number;
|
|
829
|
-
readonly cedarling_clear_data_ctx: (a: number, b: number) => void;
|
|
830
|
-
readonly cedarling_failed_trusted_issuer_ids: (a: number) => number;
|
|
831
|
-
readonly cedarling_get_data_ctx: (a: number, b: number, c: number, d: number) => void;
|
|
832
|
-
readonly cedarling_get_data_entry_ctx: (a: number, b: number, c: number, d: number) => void;
|
|
833
|
-
readonly cedarling_get_log_by_id: (a: number, b: number, c: number, d: number) => void;
|
|
834
|
-
readonly cedarling_get_log_ids: (a: number) => number;
|
|
835
|
-
readonly cedarling_get_logs_by_request_id: (a: number, b: number, c: number, d: number) => void;
|
|
836
|
-
readonly cedarling_get_logs_by_request_id_and_tag: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
837
|
-
readonly cedarling_get_stats_ctx: (a: number, b: number) => void;
|
|
838
|
-
readonly cedarling_is_trusted_issuer_loaded_by_iss: (a: number, b: number, c: number) => number;
|
|
839
|
-
readonly cedarling_is_trusted_issuer_loaded_by_name: (a: number, b: number, c: number) => number;
|
|
840
|
-
readonly cedarling_list_data_ctx: (a: number, b: number) => void;
|
|
841
|
-
readonly cedarling_loaded_trusted_issuer_ids: (a: number) => number;
|
|
842
|
-
readonly cedarling_loaded_trusted_issuers_count: (a: number) => number;
|
|
843
|
-
readonly cedarling_new: (a: number) => number;
|
|
844
|
-
readonly cedarling_new_from_map: (a: number) => number;
|
|
845
|
-
readonly cedarling_pop_logs: (a: number, b: number) => void;
|
|
846
|
-
readonly cedarling_push_data_ctx: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint) => void;
|
|
847
|
-
readonly cedarling_remove_data_ctx: (a: number, b: number, c: number, d: number) => void;
|
|
848
|
-
readonly cedarling_shut_down: (a: number) => number;
|
|
849
|
-
readonly cedarling_total_issuers: (a: number) => number;
|
|
850
|
-
readonly dataentry_json_string: (a: number, b: number) => void;
|
|
851
|
-
readonly dataentry_value: (a: number, b: number) => void;
|
|
852
|
-
readonly datastorestats_json_string: (a: number, b: number) => void;
|
|
853
|
-
readonly diagnostics_errors: (a: number, b: number) => void;
|
|
854
|
-
readonly diagnostics_reason: (a: number, b: number) => void;
|
|
855
|
-
readonly init: (a: number) => number;
|
|
856
|
-
readonly init_from_archive_bytes: (a: number, b: number) => number;
|
|
857
|
-
readonly multiissuerauthorizeresult_json_string: (a: number, b: number) => void;
|
|
858
|
-
readonly policyevaluationerror_error: (a: number, b: number) => void;
|
|
859
|
-
readonly policyevaluationerror_id: (a: number, b: number) => void;
|
|
860
|
-
readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
861
|
-
readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
862
|
-
readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
863
|
-
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
864
|
-
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
|
865
|
-
readonly intounderlyingbytesource_pull: (a: number, b: number) => number;
|
|
866
|
-
readonly intounderlyingbytesource_start: (a: number, b: number) => void;
|
|
867
|
-
readonly intounderlyingbytesource_type: (a: number) => number;
|
|
868
|
-
readonly intounderlyingsink_abort: (a: number, b: number) => number;
|
|
869
|
-
readonly intounderlyingsink_close: (a: number) => number;
|
|
870
|
-
readonly intounderlyingsink_write: (a: number, b: number) => number;
|
|
871
|
-
readonly intounderlyingsource_cancel: (a: number) => void;
|
|
872
|
-
readonly intounderlyingsource_pull: (a: number, b: number) => number;
|
|
873
|
-
readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
|
|
874
|
-
readonly rust_zstd_wasm_shim_free: (a: number) => void;
|
|
875
|
-
readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
|
|
876
|
-
readonly rust_zstd_wasm_shim_memcmp: (a: number, b: number, c: number) => number;
|
|
877
|
-
readonly rust_zstd_wasm_shim_memcpy: (a: number, b: number, c: number) => number;
|
|
878
|
-
readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
|
|
879
|
-
readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
|
|
880
|
-
readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
|
|
881
|
-
readonly __wbg_get_multiissuerauthorizeresult_decision: (a: number) => number;
|
|
882
|
-
readonly __wbg_set_multiissuerauthorizeresult_response: (a: number, b: number) => void;
|
|
883
|
-
readonly __wbg_set_multiissuerauthorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
884
|
-
readonly __wbg_set_multiissuerauthorizeresult_decision: (a: number, b: number) => void;
|
|
885
|
-
readonly __wbg_get_multiissuerauthorizeresult_response: (a: number) => number;
|
|
886
|
-
readonly __wbg_get_multiissuerauthorizeresult_request_id: (a: number, b: number) => void;
|
|
887
|
-
readonly __wbg_multiissuerauthorizeresult_free: (a: number, b: number) => void;
|
|
888
|
-
readonly __wbg_batchitemunsignedresult_free: (a: number, b: number) => void;
|
|
889
|
-
readonly __wbg_batchauthorizeunsignedresponse_free: (a: number, b: number) => void;
|
|
890
|
-
readonly batchitemunsignedresult_is_ok: (a: number) => number;
|
|
891
|
-
readonly batchitemunsignedresult_error: (a: number) => number;
|
|
892
|
-
readonly batchauthorizeunsignedresponse_batch_id: (a: number, b: number) => void;
|
|
893
|
-
readonly cedarling_get_logs_by_tag: (a: number, b: number, c: number, d: number) => void;
|
|
894
|
-
readonly __wasm_bindgen_func_elem_8798: (a: number, b: number, c: number, d: number) => void;
|
|
895
|
-
readonly __wasm_bindgen_func_elem_8853: (a: number, b: number, c: number, d: number) => void;
|
|
896
|
-
readonly __wasm_bindgen_func_elem_12273: (a: number, b: number, c: number) => void;
|
|
897
|
-
readonly __wasm_bindgen_func_elem_8634: (a: number, b: number) => void;
|
|
898
|
-
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
899
|
-
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
900
|
-
readonly __wbindgen_export3: (a: number) => void;
|
|
901
|
-
readonly __wbindgen_export4: (a: number, b: number) => void;
|
|
902
|
-
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
903
|
-
readonly __wbindgen_export5: (a: number, b: number, c: number) => void;
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
907
|
-
|
|
908
|
-
/**
|
|
909
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
910
|
-
* a precompiled `WebAssembly.Module`.
|
|
911
|
-
*
|
|
912
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
913
|
-
*
|
|
914
|
-
* @returns {InitOutput}
|
|
915
|
-
*/
|
|
916
|
-
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
917
|
-
|
|
918
|
-
/**
|
|
919
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
920
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
921
|
-
*
|
|
922
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
923
|
-
*
|
|
924
|
-
* @returns {Promise<InitOutput>}
|
|
925
|
-
*/
|
|
926
|
-
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
|
-
|
|
7
|
+
class AuthorizeResult {
|
|
8
8
|
static __wrap(ptr) {
|
|
9
9
|
const obj = Object.create(AuthorizeResult.prototype);
|
|
10
10
|
obj.__wbg_ptr = ptr;
|
|
@@ -112,12 +112,13 @@ export class AuthorizeResult {
|
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
if (Symbol.dispose) AuthorizeResult.prototype[Symbol.dispose] = AuthorizeResult.prototype.free;
|
|
115
|
+
exports.AuthorizeResult = AuthorizeResult;
|
|
115
116
|
|
|
116
117
|
/**
|
|
117
118
|
* A WASM wrapper for the Rust `cedar_policy::Response` struct.
|
|
118
119
|
* Represents the result of an authorization request.
|
|
119
120
|
*/
|
|
120
|
-
|
|
121
|
+
class AuthorizeResultResponse {
|
|
121
122
|
static __wrap(ptr) {
|
|
122
123
|
const obj = Object.create(AuthorizeResultResponse.prototype);
|
|
123
124
|
obj.__wbg_ptr = ptr;
|
|
@@ -152,13 +153,14 @@ export class AuthorizeResultResponse {
|
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
155
|
if (Symbol.dispose) AuthorizeResultResponse.prototype[Symbol.dispose] = AuthorizeResultResponse.prototype.free;
|
|
156
|
+
exports.AuthorizeResultResponse = AuthorizeResultResponse;
|
|
155
157
|
|
|
156
158
|
/**
|
|
157
159
|
* WASM wrapper for
|
|
158
160
|
* `cedarling::BatchAuthorizeResponse<Result<MultiIssuerAuthorizeResult, BatchItemError>>`.
|
|
159
161
|
* Same shape as [`BatchAuthorizeUnsignedResponse`] with multi-issuer results.
|
|
160
162
|
*/
|
|
161
|
-
|
|
163
|
+
class BatchAuthorizeMultiIssuerResponse {
|
|
162
164
|
static __wrap(ptr) {
|
|
163
165
|
const obj = Object.create(BatchAuthorizeMultiIssuerResponse.prototype);
|
|
164
166
|
obj.__wbg_ptr = ptr;
|
|
@@ -215,6 +217,7 @@ export class BatchAuthorizeMultiIssuerResponse {
|
|
|
215
217
|
}
|
|
216
218
|
}
|
|
217
219
|
if (Symbol.dispose) BatchAuthorizeMultiIssuerResponse.prototype[Symbol.dispose] = BatchAuthorizeMultiIssuerResponse.prototype.free;
|
|
220
|
+
exports.BatchAuthorizeMultiIssuerResponse = BatchAuthorizeMultiIssuerResponse;
|
|
218
221
|
|
|
219
222
|
/**
|
|
220
223
|
* WASM wrapper for `cedarling::BatchAuthorizeResponse<Result<AuthorizeResult, BatchItemError>>`.
|
|
@@ -223,7 +226,7 @@ if (Symbol.dispose) BatchAuthorizeMultiIssuerResponse.prototype[Symbol.dispose]
|
|
|
223
226
|
* is a [`BatchItemUnsignedResult`] — Cedar decision on `is_ok()`, per-item
|
|
224
227
|
* build failure on `error`. `results[i]` corresponds to `items[i]`.
|
|
225
228
|
*/
|
|
226
|
-
|
|
229
|
+
class BatchAuthorizeUnsignedResponse {
|
|
227
230
|
static __wrap(ptr) {
|
|
228
231
|
const obj = Object.create(BatchAuthorizeUnsignedResponse.prototype);
|
|
229
232
|
obj.__wbg_ptr = ptr;
|
|
@@ -280,12 +283,13 @@ export class BatchAuthorizeUnsignedResponse {
|
|
|
280
283
|
}
|
|
281
284
|
}
|
|
282
285
|
if (Symbol.dispose) BatchAuthorizeUnsignedResponse.prototype[Symbol.dispose] = BatchAuthorizeUnsignedResponse.prototype.free;
|
|
286
|
+
exports.BatchAuthorizeUnsignedResponse = BatchAuthorizeUnsignedResponse;
|
|
283
287
|
|
|
284
288
|
/**
|
|
285
289
|
* Per-item build failure surfaced inside a batch response at `results[i]`
|
|
286
290
|
* when Cedar couldn't be reached for that item.
|
|
287
291
|
*/
|
|
288
|
-
|
|
292
|
+
class BatchItemError {
|
|
289
293
|
static __wrap(ptr) {
|
|
290
294
|
const obj = Object.create(BatchItemError.prototype);
|
|
291
295
|
obj.__wbg_ptr = ptr;
|
|
@@ -354,11 +358,12 @@ export class BatchItemError {
|
|
|
354
358
|
}
|
|
355
359
|
}
|
|
356
360
|
if (Symbol.dispose) BatchItemError.prototype[Symbol.dispose] = BatchItemError.prototype.free;
|
|
361
|
+
exports.BatchItemError = BatchItemError;
|
|
357
362
|
|
|
358
363
|
/**
|
|
359
364
|
* Multi-issuer analog of [`BatchItemUnsignedResult`].
|
|
360
365
|
*/
|
|
361
|
-
|
|
366
|
+
class BatchItemMultiIssuerResult {
|
|
362
367
|
static __wrap(ptr) {
|
|
363
368
|
const obj = Object.create(BatchItemMultiIssuerResult.prototype);
|
|
364
369
|
obj.__wbg_ptr = ptr;
|
|
@@ -412,12 +417,13 @@ export class BatchItemMultiIssuerResult {
|
|
|
412
417
|
}
|
|
413
418
|
}
|
|
414
419
|
if (Symbol.dispose) BatchItemMultiIssuerResult.prototype[Symbol.dispose] = BatchItemMultiIssuerResult.prototype.free;
|
|
420
|
+
exports.BatchItemMultiIssuerResult = BatchItemMultiIssuerResult;
|
|
415
421
|
|
|
416
422
|
/**
|
|
417
423
|
* One slot in a batch response's `results` array. Callers switch on
|
|
418
424
|
* `is_ok()` — on `true`, read `unwrap()`; on `false`, read `error()`.
|
|
419
425
|
*/
|
|
420
|
-
|
|
426
|
+
class BatchItemUnsignedResult {
|
|
421
427
|
static __wrap(ptr) {
|
|
422
428
|
const obj = Object.create(BatchItemUnsignedResult.prototype);
|
|
423
429
|
obj.__wbg_ptr = ptr;
|
|
@@ -472,11 +478,12 @@ export class BatchItemUnsignedResult {
|
|
|
472
478
|
}
|
|
473
479
|
}
|
|
474
480
|
if (Symbol.dispose) BatchItemUnsignedResult.prototype[Symbol.dispose] = BatchItemUnsignedResult.prototype.free;
|
|
481
|
+
exports.BatchItemUnsignedResult = BatchItemUnsignedResult;
|
|
475
482
|
|
|
476
483
|
/**
|
|
477
484
|
* The instance of the Cedarling application.
|
|
478
485
|
*/
|
|
479
|
-
|
|
486
|
+
class Cedarling {
|
|
480
487
|
static __wrap(ptr) {
|
|
481
488
|
const obj = Object.create(Cedarling.prototype);
|
|
482
489
|
obj.__wbg_ptr = ptr;
|
|
@@ -1204,12 +1211,13 @@ export class Cedarling {
|
|
|
1204
1211
|
}
|
|
1205
1212
|
}
|
|
1206
1213
|
if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
|
|
1214
|
+
exports.Cedarling = Cedarling;
|
|
1207
1215
|
|
|
1208
1216
|
/**
|
|
1209
1217
|
* A WASM wrapper for the Rust `cedarling::DataEntry` struct.
|
|
1210
1218
|
* Represents a data entry in the DataStore with value and metadata.
|
|
1211
1219
|
*/
|
|
1212
|
-
|
|
1220
|
+
class DataEntry {
|
|
1213
1221
|
static __wrap(ptr) {
|
|
1214
1222
|
const obj = Object.create(DataEntry.prototype);
|
|
1215
1223
|
obj.__wbg_ptr = ptr;
|
|
@@ -1398,12 +1406,13 @@ export class DataEntry {
|
|
|
1398
1406
|
}
|
|
1399
1407
|
}
|
|
1400
1408
|
if (Symbol.dispose) DataEntry.prototype[Symbol.dispose] = DataEntry.prototype.free;
|
|
1409
|
+
exports.DataEntry = DataEntry;
|
|
1401
1410
|
|
|
1402
1411
|
/**
|
|
1403
1412
|
* A WASM wrapper for the Rust `cedarling::DataStoreStats` struct.
|
|
1404
1413
|
* Statistics about the DataStore.
|
|
1405
1414
|
*/
|
|
1406
|
-
|
|
1415
|
+
class DataStoreStats {
|
|
1407
1416
|
static __wrap(ptr) {
|
|
1408
1417
|
const obj = Object.create(DataStoreStats.prototype);
|
|
1409
1418
|
obj.__wbg_ptr = ptr;
|
|
@@ -1577,6 +1586,7 @@ export class DataStoreStats {
|
|
|
1577
1586
|
}
|
|
1578
1587
|
}
|
|
1579
1588
|
if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.prototype.free;
|
|
1589
|
+
exports.DataStoreStats = DataStoreStats;
|
|
1580
1590
|
|
|
1581
1591
|
/**
|
|
1582
1592
|
* Diagnostics
|
|
@@ -1584,7 +1594,7 @@ if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.pr
|
|
|
1584
1594
|
*
|
|
1585
1595
|
* Provides detailed information about how a policy decision was made, including policies that contributed to the decision and any errors encountered during evaluation.
|
|
1586
1596
|
*/
|
|
1587
|
-
|
|
1597
|
+
class Diagnostics {
|
|
1588
1598
|
static __wrap(ptr) {
|
|
1589
1599
|
const obj = Object.create(Diagnostics.prototype);
|
|
1590
1600
|
obj.__wbg_ptr = ptr;
|
|
@@ -1641,8 +1651,9 @@ export class Diagnostics {
|
|
|
1641
1651
|
}
|
|
1642
1652
|
}
|
|
1643
1653
|
if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
|
|
1654
|
+
exports.Diagnostics = Diagnostics;
|
|
1644
1655
|
|
|
1645
|
-
|
|
1656
|
+
class IntoUnderlyingByteSource {
|
|
1646
1657
|
__destroy_into_raw() {
|
|
1647
1658
|
const ptr = this.__wbg_ptr;
|
|
1648
1659
|
this.__wbg_ptr = 0;
|
|
@@ -1687,8 +1698,9 @@ export class IntoUnderlyingByteSource {
|
|
|
1687
1698
|
}
|
|
1688
1699
|
}
|
|
1689
1700
|
if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
|
|
1701
|
+
exports.IntoUnderlyingByteSource = IntoUnderlyingByteSource;
|
|
1690
1702
|
|
|
1691
|
-
|
|
1703
|
+
class IntoUnderlyingSink {
|
|
1692
1704
|
__destroy_into_raw() {
|
|
1693
1705
|
const ptr = this.__wbg_ptr;
|
|
1694
1706
|
this.__wbg_ptr = 0;
|
|
@@ -1726,8 +1738,9 @@ export class IntoUnderlyingSink {
|
|
|
1726
1738
|
}
|
|
1727
1739
|
}
|
|
1728
1740
|
if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
|
|
1741
|
+
exports.IntoUnderlyingSink = IntoUnderlyingSink;
|
|
1729
1742
|
|
|
1730
|
-
|
|
1743
|
+
class IntoUnderlyingSource {
|
|
1731
1744
|
__destroy_into_raw() {
|
|
1732
1745
|
const ptr = this.__wbg_ptr;
|
|
1733
1746
|
this.__wbg_ptr = 0;
|
|
@@ -1752,12 +1765,13 @@ export class IntoUnderlyingSource {
|
|
|
1752
1765
|
}
|
|
1753
1766
|
}
|
|
1754
1767
|
if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
|
|
1768
|
+
exports.IntoUnderlyingSource = IntoUnderlyingSource;
|
|
1755
1769
|
|
|
1756
1770
|
/**
|
|
1757
1771
|
* A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
|
|
1758
1772
|
* Represents the result of a multi-issuer authorization request.
|
|
1759
1773
|
*/
|
|
1760
|
-
|
|
1774
|
+
class MultiIssuerAuthorizeResult {
|
|
1761
1775
|
static __wrap(ptr) {
|
|
1762
1776
|
const obj = Object.create(MultiIssuerAuthorizeResult.prototype);
|
|
1763
1777
|
obj.__wbg_ptr = ptr;
|
|
@@ -1861,6 +1875,7 @@ export class MultiIssuerAuthorizeResult {
|
|
|
1861
1875
|
}
|
|
1862
1876
|
}
|
|
1863
1877
|
if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
|
|
1878
|
+
exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
|
|
1864
1879
|
|
|
1865
1880
|
/**
|
|
1866
1881
|
* PolicyEvaluationError
|
|
@@ -1868,7 +1883,7 @@ if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = Multi
|
|
|
1868
1883
|
*
|
|
1869
1884
|
* Represents an error that occurred when evaluating a Cedar policy.
|
|
1870
1885
|
*/
|
|
1871
|
-
|
|
1886
|
+
class PolicyEvaluationError {
|
|
1872
1887
|
static __wrap(ptr) {
|
|
1873
1888
|
const obj = Object.create(PolicyEvaluationError.prototype);
|
|
1874
1889
|
obj.__wbg_ptr = ptr;
|
|
@@ -1927,6 +1942,7 @@ export class PolicyEvaluationError {
|
|
|
1927
1942
|
}
|
|
1928
1943
|
}
|
|
1929
1944
|
if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
|
|
1945
|
+
exports.PolicyEvaluationError = PolicyEvaluationError;
|
|
1930
1946
|
|
|
1931
1947
|
/**
|
|
1932
1948
|
* Create a new instance of the Cedarling application.
|
|
@@ -1934,10 +1950,11 @@ if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEval
|
|
|
1934
1950
|
* @param {any} config
|
|
1935
1951
|
* @returns {Promise<Cedarling>}
|
|
1936
1952
|
*/
|
|
1937
|
-
|
|
1953
|
+
function init(config) {
|
|
1938
1954
|
const ret = wasm.init(addHeapObject(config));
|
|
1939
1955
|
return takeObject(ret);
|
|
1940
1956
|
}
|
|
1957
|
+
exports.init = init;
|
|
1941
1958
|
|
|
1942
1959
|
/**
|
|
1943
1960
|
* Create a new instance of the Cedarling application from archive bytes.
|
|
@@ -1959,10 +1976,11 @@ export function init(config) {
|
|
|
1959
1976
|
* @param {Uint8Array} archive_bytes
|
|
1960
1977
|
* @returns {Promise<Cedarling>}
|
|
1961
1978
|
*/
|
|
1962
|
-
|
|
1979
|
+
function init_from_archive_bytes(config, archive_bytes) {
|
|
1963
1980
|
const ret = wasm.init_from_archive_bytes(addHeapObject(config), addHeapObject(archive_bytes));
|
|
1964
1981
|
return takeObject(ret);
|
|
1965
1982
|
}
|
|
1983
|
+
exports.init_from_archive_bytes = init_from_archive_bytes;
|
|
1966
1984
|
function __wbg_get_imports() {
|
|
1967
1985
|
const import0 = {
|
|
1968
1986
|
__proto__: null,
|
|
@@ -2378,7 +2396,7 @@ function __wbg_get_imports() {
|
|
|
2378
2396
|
const a = state0.a;
|
|
2379
2397
|
state0.a = 0;
|
|
2380
2398
|
try {
|
|
2381
|
-
return
|
|
2399
|
+
return __wasm_bindgen_func_elem_8851(a, state0.b, arg0, arg1);
|
|
2382
2400
|
} finally {
|
|
2383
2401
|
state0.a = a;
|
|
2384
2402
|
}
|
|
@@ -2593,12 +2611,12 @@ function __wbg_get_imports() {
|
|
|
2593
2611
|
},
|
|
2594
2612
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
2595
2613
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 992, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2596
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2614
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8796);
|
|
2597
2615
|
return addHeapObject(ret);
|
|
2598
2616
|
},
|
|
2599
2617
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
2600
2618
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 878, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2601
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2619
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8632);
|
|
2602
2620
|
return addHeapObject(ret);
|
|
2603
2621
|
},
|
|
2604
2622
|
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
@@ -2640,18 +2658,18 @@ function __wbg_get_imports() {
|
|
|
2640
2658
|
};
|
|
2641
2659
|
}
|
|
2642
2660
|
|
|
2643
|
-
function
|
|
2644
|
-
wasm.
|
|
2661
|
+
function __wasm_bindgen_func_elem_8632(arg0, arg1) {
|
|
2662
|
+
wasm.__wasm_bindgen_func_elem_8632(arg0, arg1);
|
|
2645
2663
|
}
|
|
2646
2664
|
|
|
2647
2665
|
function __wasm_bindgen_func_elem_12273(arg0, arg1, arg2) {
|
|
2648
2666
|
wasm.__wasm_bindgen_func_elem_12273(arg0, arg1, addHeapObject(arg2));
|
|
2649
2667
|
}
|
|
2650
2668
|
|
|
2651
|
-
function
|
|
2669
|
+
function __wasm_bindgen_func_elem_8796(arg0, arg1, arg2) {
|
|
2652
2670
|
try {
|
|
2653
2671
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2654
|
-
wasm.
|
|
2672
|
+
wasm.__wasm_bindgen_func_elem_8796(retptr, arg0, arg1, addHeapObject(arg2));
|
|
2655
2673
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2656
2674
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2657
2675
|
if (r1) {
|
|
@@ -2662,8 +2680,8 @@ function __wasm_bindgen_func_elem_8798(arg0, arg1, arg2) {
|
|
|
2662
2680
|
}
|
|
2663
2681
|
}
|
|
2664
2682
|
|
|
2665
|
-
function
|
|
2666
|
-
wasm.
|
|
2683
|
+
function __wasm_bindgen_func_elem_8851(arg0, arg1, arg2, arg3) {
|
|
2684
|
+
wasm.__wasm_bindgen_func_elem_8851(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
2667
2685
|
}
|
|
2668
2686
|
|
|
2669
2687
|
|
|
@@ -2959,15 +2977,7 @@ function takeObject(idx) {
|
|
|
2959
2977
|
|
|
2960
2978
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2961
2979
|
cachedTextDecoder.decode();
|
|
2962
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
2963
|
-
let numBytesDecoded = 0;
|
|
2964
2980
|
function decodeText(ptr, len) {
|
|
2965
|
-
numBytesDecoded += len;
|
|
2966
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
2967
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2968
|
-
cachedTextDecoder.decode();
|
|
2969
|
-
numBytesDecoded = len;
|
|
2970
|
-
}
|
|
2971
2981
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
2972
2982
|
}
|
|
2973
2983
|
|
|
@@ -2986,95 +2996,8 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
2986
2996
|
|
|
2987
2997
|
let WASM_VECTOR_LEN = 0;
|
|
2988
2998
|
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
cachedDataViewMemory0 = null;
|
|
2995
|
-
cachedUint8ArrayMemory0 = null;
|
|
2996
|
-
return wasm;
|
|
2997
|
-
}
|
|
2998
|
-
|
|
2999
|
-
async function __wbg_load(module, imports) {
|
|
3000
|
-
if (typeof Response === 'function' && module instanceof Response) {
|
|
3001
|
-
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
3002
|
-
try {
|
|
3003
|
-
return await WebAssembly.instantiateStreaming(module, imports);
|
|
3004
|
-
} catch (e) {
|
|
3005
|
-
const validResponse = module.ok && expectedResponseType(module.type);
|
|
3006
|
-
|
|
3007
|
-
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
3008
|
-
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);
|
|
3009
|
-
|
|
3010
|
-
} else { throw e; }
|
|
3011
|
-
}
|
|
3012
|
-
}
|
|
3013
|
-
|
|
3014
|
-
const bytes = await module.arrayBuffer();
|
|
3015
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
3016
|
-
} else {
|
|
3017
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
3018
|
-
|
|
3019
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
3020
|
-
return { instance, module };
|
|
3021
|
-
} else {
|
|
3022
|
-
return instance;
|
|
3023
|
-
}
|
|
3024
|
-
}
|
|
3025
|
-
|
|
3026
|
-
function expectedResponseType(type) {
|
|
3027
|
-
switch (type) {
|
|
3028
|
-
case 'basic': case 'cors': case 'default': return true;
|
|
3029
|
-
}
|
|
3030
|
-
return false;
|
|
3031
|
-
}
|
|
3032
|
-
}
|
|
3033
|
-
|
|
3034
|
-
function initSync(module) {
|
|
3035
|
-
if (wasm !== undefined) return wasm;
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
if (module !== undefined) {
|
|
3039
|
-
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
3040
|
-
({module} = module)
|
|
3041
|
-
} else {
|
|
3042
|
-
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
3043
|
-
}
|
|
3044
|
-
}
|
|
3045
|
-
|
|
3046
|
-
const imports = __wbg_get_imports();
|
|
3047
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
3048
|
-
module = new WebAssembly.Module(module);
|
|
3049
|
-
}
|
|
3050
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
3051
|
-
return __wbg_finalize_init(instance, module);
|
|
3052
|
-
}
|
|
3053
|
-
|
|
3054
|
-
async function __wbg_init(module_or_path) {
|
|
3055
|
-
if (wasm !== undefined) return wasm;
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
if (module_or_path !== undefined) {
|
|
3059
|
-
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
3060
|
-
({module_or_path} = module_or_path)
|
|
3061
|
-
} else {
|
|
3062
|
-
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
3063
|
-
}
|
|
3064
|
-
}
|
|
3065
|
-
|
|
3066
|
-
if (module_or_path === undefined) {
|
|
3067
|
-
module_or_path = new URL('cedarling_wasm_bg.wasm', import.meta.url);
|
|
3068
|
-
}
|
|
3069
|
-
const imports = __wbg_get_imports();
|
|
3070
|
-
|
|
3071
|
-
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
3072
|
-
module_or_path = fetch(module_or_path);
|
|
3073
|
-
}
|
|
3074
|
-
|
|
3075
|
-
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
3076
|
-
|
|
3077
|
-
return __wbg_finalize_init(instance, module);
|
|
3078
|
-
}
|
|
3079
|
-
|
|
3080
|
-
export { initSync, __wbg_init as default };
|
|
2999
|
+
const wasmPath = `${__dirname}/cedarling_wasm_bg.wasm`;
|
|
3000
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
3001
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
3002
|
+
let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
|
|
3003
|
+
let wasm = wasmInstance.exports;
|
package/cedarling_wasm_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@janssenproject/cedarling_wasm",
|
|
3
|
-
"type": "module",
|
|
4
3
|
"description": "The Cedarling is a performant local authorization service that runs the Rust Cedar Engine",
|
|
5
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.442-nodejs",
|
|
6
5
|
"license": "Apache-2.0",
|
|
7
6
|
"repository": {
|
|
8
7
|
"type": "git",
|
|
@@ -14,8 +13,5 @@
|
|
|
14
13
|
"cedarling_wasm.d.ts"
|
|
15
14
|
],
|
|
16
15
|
"main": "cedarling_wasm.js",
|
|
17
|
-
"types": "cedarling_wasm.d.ts"
|
|
18
|
-
"sideEffects": [
|
|
19
|
-
"./snippets/*"
|
|
20
|
-
]
|
|
16
|
+
"types": "cedarling_wasm.d.ts"
|
|
21
17
|
}
|