@janssenproject/cedarling_wasm 0.0.415 → 0.0.416-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 +61 -144
- package/cedarling_wasm.js +169 -125
- package/cedarling_wasm_bg.wasm +0 -0
- package/package.json +2 -6
package/cedarling_wasm.d.ts
CHANGED
|
@@ -63,6 +63,67 @@ export class Cedarling {
|
|
|
63
63
|
private constructor();
|
|
64
64
|
free(): void;
|
|
65
65
|
[Symbol.dispose](): void;
|
|
66
|
+
/**
|
|
67
|
+
* Collect every value of the annotation `key` across the given policies,
|
|
68
|
+
* preserving duplicates. Unknown policy IDs are silently skipped.
|
|
69
|
+
*
|
|
70
|
+
* # Arguments
|
|
71
|
+
*
|
|
72
|
+
* * `policy_ids` - List of policy IDs to search. Typically
|
|
73
|
+
* `result.response.diagnostics.reason` from an authorization result.
|
|
74
|
+
* * `key` - The annotation key to collect values for (e.g. `"redirect"`).
|
|
75
|
+
*
|
|
76
|
+
* # Example
|
|
77
|
+
*
|
|
78
|
+
* ```javascript
|
|
79
|
+
* const redirects = cedarling.annotation_values(result.response.diagnostics.reason, "redirect");
|
|
80
|
+
* // ["/upgrade"]
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
annotation_values(policy_ids: string[], key: string): string[];
|
|
84
|
+
/**
|
|
85
|
+
* Return the annotations of each given policy, grouped by policy ID
|
|
86
|
+
* the loss-free companion to `annotations_map`. Unknown policy IDs are
|
|
87
|
+
* silently skipped.
|
|
88
|
+
*
|
|
89
|
+
* # Arguments
|
|
90
|
+
*
|
|
91
|
+
* * `policy_ids` - List of policy IDs whose annotations should be returned
|
|
92
|
+
* grouped by policy ID. Typically `result.response.diagnostics.reason` from
|
|
93
|
+
* an authorization result.
|
|
94
|
+
*
|
|
95
|
+
* # Example
|
|
96
|
+
*
|
|
97
|
+
* ```javascript
|
|
98
|
+
* const byPolicy = cedarling.annotations_by_policy(result.response.diagnostics.reason);
|
|
99
|
+
* // { "5": { redirect: "/upgrade", tier: "premium" } }
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
annotations_by_policy(policy_ids: string[]): any;
|
|
103
|
+
/**
|
|
104
|
+
* Merge the annotations (`@key("value")`) of the given policies into a single object.
|
|
105
|
+
*
|
|
106
|
+
* Intended for resolving the determining policies of an authorization decision:
|
|
107
|
+
* pass `result.response.diagnostics.reason`.
|
|
108
|
+
*
|
|
109
|
+
* Lossy: if the same annotation key appears on several policies, one value wins
|
|
110
|
+
* arbitrarily. Use `annotation_values` / `annotations_by_policy` when duplicates
|
|
111
|
+
* matter. Unknown policy IDs are silently skipped.
|
|
112
|
+
*
|
|
113
|
+
* # Arguments
|
|
114
|
+
*
|
|
115
|
+
* * `policy_ids` - List of policy IDs whose annotations should be merged into
|
|
116
|
+
* a single object. Typically `result.response.diagnostics.reason` from an
|
|
117
|
+
* authorization result.
|
|
118
|
+
*
|
|
119
|
+
* # Example
|
|
120
|
+
*
|
|
121
|
+
* ```javascript
|
|
122
|
+
* const annotations = cedarling.annotations_map(result.response.diagnostics.reason);
|
|
123
|
+
* // { redirect: "/upgrade", tier: "premium" }
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
annotations_map(policy_ids: string[]): any;
|
|
66
127
|
/**
|
|
67
128
|
* Authorize multi-issuer request.
|
|
68
129
|
* Makes authorization decision based on multiple JWT tokens from different issuers.
|
|
@@ -544,147 +605,3 @@ export function init(config: any): Promise<Cedarling>;
|
|
|
544
605
|
* ```
|
|
545
606
|
*/
|
|
546
607
|
export function init_from_archive_bytes(config: any, archive_bytes: Uint8Array): Promise<Cedarling>;
|
|
547
|
-
|
|
548
|
-
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
549
|
-
|
|
550
|
-
export interface InitOutput {
|
|
551
|
-
readonly memory: WebAssembly.Memory;
|
|
552
|
-
readonly __wbg_authorizeresult_free: (a: number, b: number) => void;
|
|
553
|
-
readonly __wbg_authorizeresultresponse_free: (a: number, b: number) => void;
|
|
554
|
-
readonly __wbg_cedarling_free: (a: number, b: number) => void;
|
|
555
|
-
readonly __wbg_dataentry_free: (a: number, b: number) => void;
|
|
556
|
-
readonly __wbg_datastorestats_free: (a: number, b: number) => void;
|
|
557
|
-
readonly __wbg_diagnostics_free: (a: number, b: number) => void;
|
|
558
|
-
readonly __wbg_get_authorizeresult_decision: (a: number) => number;
|
|
559
|
-
readonly __wbg_get_authorizeresult_request_id: (a: number, b: number) => void;
|
|
560
|
-
readonly __wbg_get_authorizeresult_response: (a: number) => number;
|
|
561
|
-
readonly __wbg_get_dataentry_access_count: (a: number) => bigint;
|
|
562
|
-
readonly __wbg_get_dataentry_created_at: (a: number, b: number) => void;
|
|
563
|
-
readonly __wbg_get_dataentry_data_type: (a: number, b: number) => void;
|
|
564
|
-
readonly __wbg_get_dataentry_expires_at: (a: number, b: number) => void;
|
|
565
|
-
readonly __wbg_get_dataentry_key: (a: number, b: number) => void;
|
|
566
|
-
readonly __wbg_get_datastorestats_avg_entry_size_bytes: (a: number) => number;
|
|
567
|
-
readonly __wbg_get_datastorestats_capacity_usage_percent: (a: number) => number;
|
|
568
|
-
readonly __wbg_get_datastorestats_entry_count: (a: number) => number;
|
|
569
|
-
readonly __wbg_get_datastorestats_max_entries: (a: number) => number;
|
|
570
|
-
readonly __wbg_get_datastorestats_max_entry_size: (a: number) => number;
|
|
571
|
-
readonly __wbg_get_datastorestats_memory_alert_threshold: (a: number) => number;
|
|
572
|
-
readonly __wbg_get_datastorestats_memory_alert_triggered: (a: number) => number;
|
|
573
|
-
readonly __wbg_get_datastorestats_metrics_enabled: (a: number) => number;
|
|
574
|
-
readonly __wbg_get_datastorestats_total_size_bytes: (a: number) => number;
|
|
575
|
-
readonly __wbg_policyevaluationerror_free: (a: number, b: number) => void;
|
|
576
|
-
readonly __wbg_set_authorizeresult_decision: (a: number, b: number) => void;
|
|
577
|
-
readonly __wbg_set_authorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
578
|
-
readonly __wbg_set_authorizeresult_response: (a: number, b: number) => void;
|
|
579
|
-
readonly __wbg_set_dataentry_access_count: (a: number, b: bigint) => void;
|
|
580
|
-
readonly __wbg_set_dataentry_created_at: (a: number, b: number, c: number) => void;
|
|
581
|
-
readonly __wbg_set_dataentry_data_type: (a: number, b: number, c: number) => void;
|
|
582
|
-
readonly __wbg_set_dataentry_expires_at: (a: number, b: number, c: number) => void;
|
|
583
|
-
readonly __wbg_set_dataentry_key: (a: number, b: number, c: number) => void;
|
|
584
|
-
readonly __wbg_set_datastorestats_avg_entry_size_bytes: (a: number, b: number) => void;
|
|
585
|
-
readonly __wbg_set_datastorestats_capacity_usage_percent: (a: number, b: number) => void;
|
|
586
|
-
readonly __wbg_set_datastorestats_entry_count: (a: number, b: number) => void;
|
|
587
|
-
readonly __wbg_set_datastorestats_max_entries: (a: number, b: number) => void;
|
|
588
|
-
readonly __wbg_set_datastorestats_max_entry_size: (a: number, b: number) => void;
|
|
589
|
-
readonly __wbg_set_datastorestats_memory_alert_threshold: (a: number, b: number) => void;
|
|
590
|
-
readonly __wbg_set_datastorestats_memory_alert_triggered: (a: number, b: number) => void;
|
|
591
|
-
readonly __wbg_set_datastorestats_metrics_enabled: (a: number, b: number) => void;
|
|
592
|
-
readonly __wbg_set_datastorestats_total_size_bytes: (a: number, b: number) => void;
|
|
593
|
-
readonly authorizeresult_json_string: (a: number, b: number) => void;
|
|
594
|
-
readonly authorizeresultresponse_decision: (a: number) => number;
|
|
595
|
-
readonly authorizeresultresponse_diagnostics: (a: number) => number;
|
|
596
|
-
readonly cedarling_authorize_multi_issuer: (a: number, b: number, c: number) => number;
|
|
597
|
-
readonly cedarling_authorize_unsigned: (a: number, b: number, c: number) => number;
|
|
598
|
-
readonly cedarling_clear_data_ctx: (a: number, b: number) => void;
|
|
599
|
-
readonly cedarling_failed_trusted_issuer_ids: (a: number) => number;
|
|
600
|
-
readonly cedarling_get_data_ctx: (a: number, b: number, c: number, d: number) => void;
|
|
601
|
-
readonly cedarling_get_data_entry_ctx: (a: number, b: number, c: number, d: number) => void;
|
|
602
|
-
readonly cedarling_get_log_by_id: (a: number, b: number, c: number, d: number) => void;
|
|
603
|
-
readonly cedarling_get_log_ids: (a: number) => number;
|
|
604
|
-
readonly cedarling_get_logs_by_request_id: (a: number, b: number, c: number, d: number) => void;
|
|
605
|
-
readonly cedarling_get_logs_by_request_id_and_tag: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
606
|
-
readonly cedarling_get_stats_ctx: (a: number, b: number) => void;
|
|
607
|
-
readonly cedarling_is_trusted_issuer_loaded_by_iss: (a: number, b: number, c: number) => number;
|
|
608
|
-
readonly cedarling_is_trusted_issuer_loaded_by_name: (a: number, b: number, c: number) => number;
|
|
609
|
-
readonly cedarling_list_data_ctx: (a: number, b: number) => void;
|
|
610
|
-
readonly cedarling_loaded_trusted_issuer_ids: (a: number) => number;
|
|
611
|
-
readonly cedarling_loaded_trusted_issuers_count: (a: number) => number;
|
|
612
|
-
readonly cedarling_new: (a: number) => number;
|
|
613
|
-
readonly cedarling_new_from_map: (a: number) => number;
|
|
614
|
-
readonly cedarling_pop_logs: (a: number, b: number) => void;
|
|
615
|
-
readonly cedarling_push_data_ctx: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint) => void;
|
|
616
|
-
readonly cedarling_remove_data_ctx: (a: number, b: number, c: number, d: number) => void;
|
|
617
|
-
readonly cedarling_shut_down: (a: number) => number;
|
|
618
|
-
readonly cedarling_total_issuers: (a: number) => number;
|
|
619
|
-
readonly dataentry_json_string: (a: number, b: number) => void;
|
|
620
|
-
readonly dataentry_value: (a: number, b: number) => void;
|
|
621
|
-
readonly datastorestats_json_string: (a: number, b: number) => void;
|
|
622
|
-
readonly diagnostics_errors: (a: number, b: number) => void;
|
|
623
|
-
readonly diagnostics_reason: (a: number, b: number) => void;
|
|
624
|
-
readonly init: (a: number) => number;
|
|
625
|
-
readonly init_from_archive_bytes: (a: number, b: number) => number;
|
|
626
|
-
readonly multiissuerauthorizeresult_json_string: (a: number, b: number) => void;
|
|
627
|
-
readonly policyevaluationerror_error: (a: number, b: number) => void;
|
|
628
|
-
readonly policyevaluationerror_id: (a: number, b: number) => void;
|
|
629
|
-
readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
|
|
630
|
-
readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
|
|
631
|
-
readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
|
|
632
|
-
readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
|
|
633
|
-
readonly intounderlyingbytesource_cancel: (a: number) => void;
|
|
634
|
-
readonly intounderlyingbytesource_pull: (a: number, b: number) => number;
|
|
635
|
-
readonly intounderlyingbytesource_start: (a: number, b: number) => void;
|
|
636
|
-
readonly intounderlyingbytesource_type: (a: number) => number;
|
|
637
|
-
readonly intounderlyingsink_abort: (a: number, b: number) => number;
|
|
638
|
-
readonly intounderlyingsink_close: (a: number) => number;
|
|
639
|
-
readonly intounderlyingsink_write: (a: number, b: number) => number;
|
|
640
|
-
readonly intounderlyingsource_cancel: (a: number) => void;
|
|
641
|
-
readonly intounderlyingsource_pull: (a: number, b: number) => number;
|
|
642
|
-
readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
|
|
643
|
-
readonly rust_zstd_wasm_shim_free: (a: number) => void;
|
|
644
|
-
readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
|
|
645
|
-
readonly rust_zstd_wasm_shim_memcmp: (a: number, b: number, c: number) => number;
|
|
646
|
-
readonly rust_zstd_wasm_shim_memcpy: (a: number, b: number, c: number) => number;
|
|
647
|
-
readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
|
|
648
|
-
readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
|
|
649
|
-
readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
|
|
650
|
-
readonly __wbg_get_multiissuerauthorizeresult_decision: (a: number) => number;
|
|
651
|
-
readonly __wbg_set_multiissuerauthorizeresult_response: (a: number, b: number) => void;
|
|
652
|
-
readonly __wbg_set_multiissuerauthorizeresult_request_id: (a: number, b: number, c: number) => void;
|
|
653
|
-
readonly __wbg_set_multiissuerauthorizeresult_decision: (a: number, b: number) => void;
|
|
654
|
-
readonly __wbg_get_multiissuerauthorizeresult_response: (a: number) => number;
|
|
655
|
-
readonly __wbg_get_multiissuerauthorizeresult_request_id: (a: number, b: number) => void;
|
|
656
|
-
readonly __wbg_multiissuerauthorizeresult_free: (a: number, b: number) => void;
|
|
657
|
-
readonly cedarling_get_logs_by_tag: (a: number, b: number, c: number, d: number) => void;
|
|
658
|
-
readonly __wasm_bindgen_func_elem_8668: (a: number, b: number, c: number, d: number) => void;
|
|
659
|
-
readonly __wasm_bindgen_func_elem_8722: (a: number, b: number, c: number, d: number) => void;
|
|
660
|
-
readonly __wasm_bindgen_func_elem_12144: (a: number, b: number, c: number) => void;
|
|
661
|
-
readonly __wasm_bindgen_func_elem_8503: (a: number, b: number) => void;
|
|
662
|
-
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
663
|
-
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
664
|
-
readonly __wbindgen_export3: (a: number) => void;
|
|
665
|
-
readonly __wbindgen_export4: (a: number, b: number) => void;
|
|
666
|
-
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
667
|
-
readonly __wbindgen_export5: (a: number, b: number, c: number) => void;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
671
|
-
|
|
672
|
-
/**
|
|
673
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
674
|
-
* a precompiled `WebAssembly.Module`.
|
|
675
|
-
*
|
|
676
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
677
|
-
*
|
|
678
|
-
* @returns {InitOutput}
|
|
679
|
-
*/
|
|
680
|
-
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
681
|
-
|
|
682
|
-
/**
|
|
683
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
684
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
685
|
-
*
|
|
686
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
687
|
-
*
|
|
688
|
-
* @returns {Promise<InitOutput>}
|
|
689
|
-
*/
|
|
690
|
-
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,11 +153,12 @@ 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
|
* The instance of the Cedarling application.
|
|
158
160
|
*/
|
|
159
|
-
|
|
161
|
+
class Cedarling {
|
|
160
162
|
static __wrap(ptr) {
|
|
161
163
|
const obj = Object.create(Cedarling.prototype);
|
|
162
164
|
obj.__wbg_ptr = ptr;
|
|
@@ -173,6 +175,122 @@ export class Cedarling {
|
|
|
173
175
|
const ptr = this.__destroy_into_raw();
|
|
174
176
|
wasm.__wbg_cedarling_free(ptr, 0);
|
|
175
177
|
}
|
|
178
|
+
/**
|
|
179
|
+
* Collect every value of the annotation `key` across the given policies,
|
|
180
|
+
* preserving duplicates. Unknown policy IDs are silently skipped.
|
|
181
|
+
*
|
|
182
|
+
* # Arguments
|
|
183
|
+
*
|
|
184
|
+
* * `policy_ids` - List of policy IDs to search. Typically
|
|
185
|
+
* `result.response.diagnostics.reason` from an authorization result.
|
|
186
|
+
* * `key` - The annotation key to collect values for (e.g. `"redirect"`).
|
|
187
|
+
*
|
|
188
|
+
* # Example
|
|
189
|
+
*
|
|
190
|
+
* ```javascript
|
|
191
|
+
* const redirects = cedarling.annotation_values(result.response.diagnostics.reason, "redirect");
|
|
192
|
+
* // ["/upgrade"]
|
|
193
|
+
* ```
|
|
194
|
+
* @param {string[]} policy_ids
|
|
195
|
+
* @param {string} key
|
|
196
|
+
* @returns {string[]}
|
|
197
|
+
*/
|
|
198
|
+
annotation_values(policy_ids, key) {
|
|
199
|
+
try {
|
|
200
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
201
|
+
const ptr0 = passArrayJsValueToWasm0(policy_ids, wasm.__wbindgen_export);
|
|
202
|
+
const len0 = WASM_VECTOR_LEN;
|
|
203
|
+
const ptr1 = passStringToWasm0(key, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
204
|
+
const len1 = WASM_VECTOR_LEN;
|
|
205
|
+
wasm.cedarling_annotation_values(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
206
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
207
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
208
|
+
var v3 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
209
|
+
wasm.__wbindgen_export5(r0, r1 * 4, 4);
|
|
210
|
+
return v3;
|
|
211
|
+
} finally {
|
|
212
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Return the annotations of each given policy, grouped by policy ID
|
|
217
|
+
* the loss-free companion to `annotations_map`. Unknown policy IDs are
|
|
218
|
+
* silently skipped.
|
|
219
|
+
*
|
|
220
|
+
* # Arguments
|
|
221
|
+
*
|
|
222
|
+
* * `policy_ids` - List of policy IDs whose annotations should be returned
|
|
223
|
+
* grouped by policy ID. Typically `result.response.diagnostics.reason` from
|
|
224
|
+
* an authorization result.
|
|
225
|
+
*
|
|
226
|
+
* # Example
|
|
227
|
+
*
|
|
228
|
+
* ```javascript
|
|
229
|
+
* const byPolicy = cedarling.annotations_by_policy(result.response.diagnostics.reason);
|
|
230
|
+
* // { "5": { redirect: "/upgrade", tier: "premium" } }
|
|
231
|
+
* ```
|
|
232
|
+
* @param {string[]} policy_ids
|
|
233
|
+
* @returns {any}
|
|
234
|
+
*/
|
|
235
|
+
annotations_by_policy(policy_ids) {
|
|
236
|
+
try {
|
|
237
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
238
|
+
const ptr0 = passArrayJsValueToWasm0(policy_ids, wasm.__wbindgen_export);
|
|
239
|
+
const len0 = WASM_VECTOR_LEN;
|
|
240
|
+
wasm.cedarling_annotations_by_policy(retptr, this.__wbg_ptr, ptr0, len0);
|
|
241
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
242
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
243
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
244
|
+
if (r2) {
|
|
245
|
+
throw takeObject(r1);
|
|
246
|
+
}
|
|
247
|
+
return takeObject(r0);
|
|
248
|
+
} finally {
|
|
249
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Merge the annotations (`@key("value")`) of the given policies into a single object.
|
|
254
|
+
*
|
|
255
|
+
* Intended for resolving the determining policies of an authorization decision:
|
|
256
|
+
* pass `result.response.diagnostics.reason`.
|
|
257
|
+
*
|
|
258
|
+
* Lossy: if the same annotation key appears on several policies, one value wins
|
|
259
|
+
* arbitrarily. Use `annotation_values` / `annotations_by_policy` when duplicates
|
|
260
|
+
* matter. Unknown policy IDs are silently skipped.
|
|
261
|
+
*
|
|
262
|
+
* # Arguments
|
|
263
|
+
*
|
|
264
|
+
* * `policy_ids` - List of policy IDs whose annotations should be merged into
|
|
265
|
+
* a single object. Typically `result.response.diagnostics.reason` from an
|
|
266
|
+
* authorization result.
|
|
267
|
+
*
|
|
268
|
+
* # Example
|
|
269
|
+
*
|
|
270
|
+
* ```javascript
|
|
271
|
+
* const annotations = cedarling.annotations_map(result.response.diagnostics.reason);
|
|
272
|
+
* // { redirect: "/upgrade", tier: "premium" }
|
|
273
|
+
* ```
|
|
274
|
+
* @param {string[]} policy_ids
|
|
275
|
+
* @returns {any}
|
|
276
|
+
*/
|
|
277
|
+
annotations_map(policy_ids) {
|
|
278
|
+
try {
|
|
279
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
280
|
+
const ptr0 = passArrayJsValueToWasm0(policy_ids, wasm.__wbindgen_export);
|
|
281
|
+
const len0 = WASM_VECTOR_LEN;
|
|
282
|
+
wasm.cedarling_annotations_map(retptr, this.__wbg_ptr, ptr0, len0);
|
|
283
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
284
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
285
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
286
|
+
if (r2) {
|
|
287
|
+
throw takeObject(r1);
|
|
288
|
+
}
|
|
289
|
+
return takeObject(r0);
|
|
290
|
+
} finally {
|
|
291
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
176
294
|
/**
|
|
177
295
|
* Authorize multi-issuer request.
|
|
178
296
|
* Makes authorization decision based on multiple JWT tokens from different issuers.
|
|
@@ -712,12 +830,13 @@ export class Cedarling {
|
|
|
712
830
|
}
|
|
713
831
|
}
|
|
714
832
|
if (Symbol.dispose) Cedarling.prototype[Symbol.dispose] = Cedarling.prototype.free;
|
|
833
|
+
exports.Cedarling = Cedarling;
|
|
715
834
|
|
|
716
835
|
/**
|
|
717
836
|
* A WASM wrapper for the Rust `cedarling::DataEntry` struct.
|
|
718
837
|
* Represents a data entry in the DataStore with value and metadata.
|
|
719
838
|
*/
|
|
720
|
-
|
|
839
|
+
class DataEntry {
|
|
721
840
|
static __wrap(ptr) {
|
|
722
841
|
const obj = Object.create(DataEntry.prototype);
|
|
723
842
|
obj.__wbg_ptr = ptr;
|
|
@@ -906,12 +1025,13 @@ export class DataEntry {
|
|
|
906
1025
|
}
|
|
907
1026
|
}
|
|
908
1027
|
if (Symbol.dispose) DataEntry.prototype[Symbol.dispose] = DataEntry.prototype.free;
|
|
1028
|
+
exports.DataEntry = DataEntry;
|
|
909
1029
|
|
|
910
1030
|
/**
|
|
911
1031
|
* A WASM wrapper for the Rust `cedarling::DataStoreStats` struct.
|
|
912
1032
|
* Statistics about the DataStore.
|
|
913
1033
|
*/
|
|
914
|
-
|
|
1034
|
+
class DataStoreStats {
|
|
915
1035
|
static __wrap(ptr) {
|
|
916
1036
|
const obj = Object.create(DataStoreStats.prototype);
|
|
917
1037
|
obj.__wbg_ptr = ptr;
|
|
@@ -1085,6 +1205,7 @@ export class DataStoreStats {
|
|
|
1085
1205
|
}
|
|
1086
1206
|
}
|
|
1087
1207
|
if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.prototype.free;
|
|
1208
|
+
exports.DataStoreStats = DataStoreStats;
|
|
1088
1209
|
|
|
1089
1210
|
/**
|
|
1090
1211
|
* Diagnostics
|
|
@@ -1092,7 +1213,7 @@ if (Symbol.dispose) DataStoreStats.prototype[Symbol.dispose] = DataStoreStats.pr
|
|
|
1092
1213
|
*
|
|
1093
1214
|
* Provides detailed information about how a policy decision was made, including policies that contributed to the decision and any errors encountered during evaluation.
|
|
1094
1215
|
*/
|
|
1095
|
-
|
|
1216
|
+
class Diagnostics {
|
|
1096
1217
|
static __wrap(ptr) {
|
|
1097
1218
|
const obj = Object.create(Diagnostics.prototype);
|
|
1098
1219
|
obj.__wbg_ptr = ptr;
|
|
@@ -1149,8 +1270,9 @@ export class Diagnostics {
|
|
|
1149
1270
|
}
|
|
1150
1271
|
}
|
|
1151
1272
|
if (Symbol.dispose) Diagnostics.prototype[Symbol.dispose] = Diagnostics.prototype.free;
|
|
1273
|
+
exports.Diagnostics = Diagnostics;
|
|
1152
1274
|
|
|
1153
|
-
|
|
1275
|
+
class IntoUnderlyingByteSource {
|
|
1154
1276
|
__destroy_into_raw() {
|
|
1155
1277
|
const ptr = this.__wbg_ptr;
|
|
1156
1278
|
this.__wbg_ptr = 0;
|
|
@@ -1195,8 +1317,9 @@ export class IntoUnderlyingByteSource {
|
|
|
1195
1317
|
}
|
|
1196
1318
|
}
|
|
1197
1319
|
if (Symbol.dispose) IntoUnderlyingByteSource.prototype[Symbol.dispose] = IntoUnderlyingByteSource.prototype.free;
|
|
1320
|
+
exports.IntoUnderlyingByteSource = IntoUnderlyingByteSource;
|
|
1198
1321
|
|
|
1199
|
-
|
|
1322
|
+
class IntoUnderlyingSink {
|
|
1200
1323
|
__destroy_into_raw() {
|
|
1201
1324
|
const ptr = this.__wbg_ptr;
|
|
1202
1325
|
this.__wbg_ptr = 0;
|
|
@@ -1234,8 +1357,9 @@ export class IntoUnderlyingSink {
|
|
|
1234
1357
|
}
|
|
1235
1358
|
}
|
|
1236
1359
|
if (Symbol.dispose) IntoUnderlyingSink.prototype[Symbol.dispose] = IntoUnderlyingSink.prototype.free;
|
|
1360
|
+
exports.IntoUnderlyingSink = IntoUnderlyingSink;
|
|
1237
1361
|
|
|
1238
|
-
|
|
1362
|
+
class IntoUnderlyingSource {
|
|
1239
1363
|
__destroy_into_raw() {
|
|
1240
1364
|
const ptr = this.__wbg_ptr;
|
|
1241
1365
|
this.__wbg_ptr = 0;
|
|
@@ -1260,12 +1384,13 @@ export class IntoUnderlyingSource {
|
|
|
1260
1384
|
}
|
|
1261
1385
|
}
|
|
1262
1386
|
if (Symbol.dispose) IntoUnderlyingSource.prototype[Symbol.dispose] = IntoUnderlyingSource.prototype.free;
|
|
1387
|
+
exports.IntoUnderlyingSource = IntoUnderlyingSource;
|
|
1263
1388
|
|
|
1264
1389
|
/**
|
|
1265
1390
|
* A WASM wrapper for the Rust `cedarling::MultiIssuerAuthorizeResult` struct.
|
|
1266
1391
|
* Represents the result of a multi-issuer authorization request.
|
|
1267
1392
|
*/
|
|
1268
|
-
|
|
1393
|
+
class MultiIssuerAuthorizeResult {
|
|
1269
1394
|
static __wrap(ptr) {
|
|
1270
1395
|
const obj = Object.create(MultiIssuerAuthorizeResult.prototype);
|
|
1271
1396
|
obj.__wbg_ptr = ptr;
|
|
@@ -1369,6 +1494,7 @@ export class MultiIssuerAuthorizeResult {
|
|
|
1369
1494
|
}
|
|
1370
1495
|
}
|
|
1371
1496
|
if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = MultiIssuerAuthorizeResult.prototype.free;
|
|
1497
|
+
exports.MultiIssuerAuthorizeResult = MultiIssuerAuthorizeResult;
|
|
1372
1498
|
|
|
1373
1499
|
/**
|
|
1374
1500
|
* PolicyEvaluationError
|
|
@@ -1376,7 +1502,7 @@ if (Symbol.dispose) MultiIssuerAuthorizeResult.prototype[Symbol.dispose] = Multi
|
|
|
1376
1502
|
*
|
|
1377
1503
|
* Represents an error that occurred when evaluating a Cedar policy.
|
|
1378
1504
|
*/
|
|
1379
|
-
|
|
1505
|
+
class PolicyEvaluationError {
|
|
1380
1506
|
static __wrap(ptr) {
|
|
1381
1507
|
const obj = Object.create(PolicyEvaluationError.prototype);
|
|
1382
1508
|
obj.__wbg_ptr = ptr;
|
|
@@ -1435,6 +1561,7 @@ export class PolicyEvaluationError {
|
|
|
1435
1561
|
}
|
|
1436
1562
|
}
|
|
1437
1563
|
if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEvaluationError.prototype.free;
|
|
1564
|
+
exports.PolicyEvaluationError = PolicyEvaluationError;
|
|
1438
1565
|
|
|
1439
1566
|
/**
|
|
1440
1567
|
* Create a new instance of the Cedarling application.
|
|
@@ -1442,10 +1569,11 @@ if (Symbol.dispose) PolicyEvaluationError.prototype[Symbol.dispose] = PolicyEval
|
|
|
1442
1569
|
* @param {any} config
|
|
1443
1570
|
* @returns {Promise<Cedarling>}
|
|
1444
1571
|
*/
|
|
1445
|
-
|
|
1572
|
+
function init(config) {
|
|
1446
1573
|
const ret = wasm.init(addHeapObject(config));
|
|
1447
1574
|
return takeObject(ret);
|
|
1448
1575
|
}
|
|
1576
|
+
exports.init = init;
|
|
1449
1577
|
|
|
1450
1578
|
/**
|
|
1451
1579
|
* Create a new instance of the Cedarling application from archive bytes.
|
|
@@ -1467,10 +1595,11 @@ export function init(config) {
|
|
|
1467
1595
|
* @param {Uint8Array} archive_bytes
|
|
1468
1596
|
* @returns {Promise<Cedarling>}
|
|
1469
1597
|
*/
|
|
1470
|
-
|
|
1598
|
+
function init_from_archive_bytes(config, archive_bytes) {
|
|
1471
1599
|
const ret = wasm.init_from_archive_bytes(addHeapObject(config), addHeapObject(archive_bytes));
|
|
1472
1600
|
return takeObject(ret);
|
|
1473
1601
|
}
|
|
1602
|
+
exports.init_from_archive_bytes = init_from_archive_bytes;
|
|
1474
1603
|
function __wbg_get_imports() {
|
|
1475
1604
|
const import0 = {
|
|
1476
1605
|
__proto__: null,
|
|
@@ -1870,7 +1999,7 @@ function __wbg_get_imports() {
|
|
|
1870
1999
|
const a = state0.a;
|
|
1871
2000
|
state0.a = 0;
|
|
1872
2001
|
try {
|
|
1873
|
-
return
|
|
2002
|
+
return __wasm_bindgen_func_elem_8746(a, state0.b, arg0, arg1);
|
|
1874
2003
|
} finally {
|
|
1875
2004
|
state0.a = a;
|
|
1876
2005
|
}
|
|
@@ -2080,17 +2209,17 @@ function __wbg_get_imports() {
|
|
|
2080
2209
|
},
|
|
2081
2210
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2082
2211
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1196, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2083
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2212
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_12170);
|
|
2084
2213
|
return addHeapObject(ret);
|
|
2085
2214
|
},
|
|
2086
2215
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
2087
2216
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 995, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2088
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2217
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8691);
|
|
2089
2218
|
return addHeapObject(ret);
|
|
2090
2219
|
},
|
|
2091
2220
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
2092
2221
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 883, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2093
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
2222
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_8526);
|
|
2094
2223
|
return addHeapObject(ret);
|
|
2095
2224
|
},
|
|
2096
2225
|
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
@@ -2132,18 +2261,18 @@ function __wbg_get_imports() {
|
|
|
2132
2261
|
};
|
|
2133
2262
|
}
|
|
2134
2263
|
|
|
2135
|
-
function
|
|
2136
|
-
wasm.
|
|
2264
|
+
function __wasm_bindgen_func_elem_8526(arg0, arg1) {
|
|
2265
|
+
wasm.__wasm_bindgen_func_elem_8526(arg0, arg1);
|
|
2137
2266
|
}
|
|
2138
2267
|
|
|
2139
|
-
function
|
|
2140
|
-
wasm.
|
|
2268
|
+
function __wasm_bindgen_func_elem_12170(arg0, arg1, arg2) {
|
|
2269
|
+
wasm.__wasm_bindgen_func_elem_12170(arg0, arg1, addHeapObject(arg2));
|
|
2141
2270
|
}
|
|
2142
2271
|
|
|
2143
|
-
function
|
|
2272
|
+
function __wasm_bindgen_func_elem_8691(arg0, arg1, arg2) {
|
|
2144
2273
|
try {
|
|
2145
2274
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2146
|
-
wasm.
|
|
2275
|
+
wasm.__wasm_bindgen_func_elem_8691(retptr, arg0, arg1, addHeapObject(arg2));
|
|
2147
2276
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2148
2277
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2149
2278
|
if (r1) {
|
|
@@ -2154,8 +2283,8 @@ function __wasm_bindgen_func_elem_8668(arg0, arg1, arg2) {
|
|
|
2154
2283
|
}
|
|
2155
2284
|
}
|
|
2156
2285
|
|
|
2157
|
-
function
|
|
2158
|
-
wasm.
|
|
2286
|
+
function __wasm_bindgen_func_elem_8746(arg0, arg1, arg2, arg3) {
|
|
2287
|
+
wasm.__wasm_bindgen_func_elem_8746(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
2159
2288
|
}
|
|
2160
2289
|
|
|
2161
2290
|
|
|
@@ -2381,6 +2510,16 @@ function makeMutClosure(arg0, arg1, f) {
|
|
|
2381
2510
|
return real;
|
|
2382
2511
|
}
|
|
2383
2512
|
|
|
2513
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
2514
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
2515
|
+
const mem = getDataViewMemory0();
|
|
2516
|
+
for (let i = 0; i < array.length; i++) {
|
|
2517
|
+
mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);
|
|
2518
|
+
}
|
|
2519
|
+
WASM_VECTOR_LEN = array.length;
|
|
2520
|
+
return ptr;
|
|
2521
|
+
}
|
|
2522
|
+
|
|
2384
2523
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
2385
2524
|
if (realloc === undefined) {
|
|
2386
2525
|
const buf = cachedTextEncoder.encode(arg);
|
|
@@ -2426,15 +2565,7 @@ function takeObject(idx) {
|
|
|
2426
2565
|
|
|
2427
2566
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2428
2567
|
cachedTextDecoder.decode();
|
|
2429
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
2430
|
-
let numBytesDecoded = 0;
|
|
2431
2568
|
function decodeText(ptr, len) {
|
|
2432
|
-
numBytesDecoded += len;
|
|
2433
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
2434
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
2435
|
-
cachedTextDecoder.decode();
|
|
2436
|
-
numBytesDecoded = len;
|
|
2437
|
-
}
|
|
2438
2569
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
2439
2570
|
}
|
|
2440
2571
|
|
|
@@ -2453,95 +2584,8 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
2453
2584
|
|
|
2454
2585
|
let WASM_VECTOR_LEN = 0;
|
|
2455
2586
|
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
cachedDataViewMemory0 = null;
|
|
2462
|
-
cachedUint8ArrayMemory0 = null;
|
|
2463
|
-
return wasm;
|
|
2464
|
-
}
|
|
2465
|
-
|
|
2466
|
-
async function __wbg_load(module, imports) {
|
|
2467
|
-
if (typeof Response === 'function' && module instanceof Response) {
|
|
2468
|
-
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
2469
|
-
try {
|
|
2470
|
-
return await WebAssembly.instantiateStreaming(module, imports);
|
|
2471
|
-
} catch (e) {
|
|
2472
|
-
const validResponse = module.ok && expectedResponseType(module.type);
|
|
2473
|
-
|
|
2474
|
-
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
2475
|
-
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);
|
|
2476
|
-
|
|
2477
|
-
} else { throw e; }
|
|
2478
|
-
}
|
|
2479
|
-
}
|
|
2480
|
-
|
|
2481
|
-
const bytes = await module.arrayBuffer();
|
|
2482
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
2483
|
-
} else {
|
|
2484
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
2485
|
-
|
|
2486
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
2487
|
-
return { instance, module };
|
|
2488
|
-
} else {
|
|
2489
|
-
return instance;
|
|
2490
|
-
}
|
|
2491
|
-
}
|
|
2492
|
-
|
|
2493
|
-
function expectedResponseType(type) {
|
|
2494
|
-
switch (type) {
|
|
2495
|
-
case 'basic': case 'cors': case 'default': return true;
|
|
2496
|
-
}
|
|
2497
|
-
return false;
|
|
2498
|
-
}
|
|
2499
|
-
}
|
|
2500
|
-
|
|
2501
|
-
function initSync(module) {
|
|
2502
|
-
if (wasm !== undefined) return wasm;
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
if (module !== undefined) {
|
|
2506
|
-
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
2507
|
-
({module} = module)
|
|
2508
|
-
} else {
|
|
2509
|
-
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
2510
|
-
}
|
|
2511
|
-
}
|
|
2512
|
-
|
|
2513
|
-
const imports = __wbg_get_imports();
|
|
2514
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
2515
|
-
module = new WebAssembly.Module(module);
|
|
2516
|
-
}
|
|
2517
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
2518
|
-
return __wbg_finalize_init(instance, module);
|
|
2519
|
-
}
|
|
2520
|
-
|
|
2521
|
-
async function __wbg_init(module_or_path) {
|
|
2522
|
-
if (wasm !== undefined) return wasm;
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
if (module_or_path !== undefined) {
|
|
2526
|
-
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
2527
|
-
({module_or_path} = module_or_path)
|
|
2528
|
-
} else {
|
|
2529
|
-
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
2530
|
-
}
|
|
2531
|
-
}
|
|
2532
|
-
|
|
2533
|
-
if (module_or_path === undefined) {
|
|
2534
|
-
module_or_path = new URL('cedarling_wasm_bg.wasm', import.meta.url);
|
|
2535
|
-
}
|
|
2536
|
-
const imports = __wbg_get_imports();
|
|
2537
|
-
|
|
2538
|
-
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
2539
|
-
module_or_path = fetch(module_or_path);
|
|
2540
|
-
}
|
|
2541
|
-
|
|
2542
|
-
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
2543
|
-
|
|
2544
|
-
return __wbg_finalize_init(instance, module);
|
|
2545
|
-
}
|
|
2546
|
-
|
|
2547
|
-
export { initSync, __wbg_init as default };
|
|
2587
|
+
const wasmPath = `${__dirname}/cedarling_wasm_bg.wasm`;
|
|
2588
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
2589
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
2590
|
+
let wasmInstance = new WebAssembly.Instance(wasmModule, __wbg_get_imports());
|
|
2591
|
+
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.416-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
|
}
|