@janssenproject/cedarling_wasm 0.0.343-nodejs → 0.0.344

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/README.md CHANGED
@@ -240,6 +240,15 @@ export class Cedarling {
240
240
  * ```
241
241
  */
242
242
  get_stats_ctx(): DataStoreStats;
243
+ /**
244
+ * Trusted issuer loading status helpers.
245
+ */
246
+ is_trusted_issuer_loaded_by_name(issuer_id: string): boolean;
247
+ is_trusted_issuer_loaded_by_iss(iss_claim: string): boolean;
248
+ total_issuers(): number;
249
+ loaded_trusted_issuers_count(): number;
250
+ loaded_trusted_issuer_ids(): Array<string>;
251
+ failed_trusted_issuer_ids(): Array<string>;
243
252
  }
244
253
 
245
254
  /**
@@ -587,3 +596,16 @@ permit(
587
596
  ```
588
597
 
589
598
  The data is injected into the evaluation context before policy evaluation, allowing policies to make decisions based on dynamically pushed data.
599
+
600
+ ## Trusted Issuer Loading Info
601
+
602
+ When a policy store contains `trusted-issuers/` entries, you can inspect loading status:
603
+
604
+ ```javascript
605
+ const loaded = cedarling.is_trusted_issuer_loaded_by_name("issuer_id");
606
+ const loadedByIss = cedarling.is_trusted_issuer_loaded_by_iss("https://issuer.example.org");
607
+ const total = cedarling.total_issuers();
608
+ const loadedCount = cedarling.loaded_trusted_issuers_count();
609
+ const loadedIds = cedarling.loaded_trusted_issuer_ids();
610
+ const failedIds = cedarling.failed_trusted_issuer_ids();
611
+ ```
@@ -81,6 +81,16 @@ export class Cedarling {
81
81
  * ```
82
82
  */
83
83
  clear_data_ctx(): void;
84
+ /**
85
+ * Get trusted issuer identifiers that failed to load.
86
+ *
87
+ * # Example
88
+ *
89
+ * ```javascript
90
+ * const ids = cedarling.failed_trusted_issuer_ids();
91
+ * ```
92
+ */
93
+ failed_trusted_issuer_ids(): Array<any>;
84
94
  /**
85
95
  * Get a value from the data store by key.
86
96
  * Returns null if the key doesn't exist or the entry has expired.
@@ -160,6 +170,34 @@ export class Cedarling {
160
170
  * ```
161
171
  */
162
172
  get_stats_ctx(): DataStoreStats;
173
+ /**
174
+ * Check whether a trusted issuer was loaded by `iss` claim.
175
+ *
176
+ * # Arguments
177
+ *
178
+ * * `iss_claim` - Issuer `iss` claim value to check.
179
+ *
180
+ * # Example
181
+ *
182
+ * ```javascript
183
+ * const ok = cedarling.is_trusted_issuer_loaded_by_iss("https://issuer.example.org");
184
+ * ```
185
+ */
186
+ is_trusted_issuer_loaded_by_iss(iss_claim: string): boolean;
187
+ /**
188
+ * Check whether a trusted issuer was loaded by issuer identifier.
189
+ *
190
+ * # Arguments
191
+ *
192
+ * * `issuer_id` - Trusted issuer identifier to check.
193
+ *
194
+ * # Example
195
+ *
196
+ * ```javascript
197
+ * const ok = cedarling.is_trusted_issuer_loaded_by_name("issuer_id");
198
+ * ```
199
+ */
200
+ is_trusted_issuer_loaded_by_name(issuer_id: string): boolean;
163
201
  /**
164
202
  * List all entries with their metadata.
165
203
  * Returns an array of DataEntry objects.
@@ -174,6 +212,26 @@ export class Cedarling {
174
212
  * ```
175
213
  */
176
214
  list_data_ctx(): Array<any>;
215
+ /**
216
+ * Get trusted issuer identifiers loaded successfully.
217
+ *
218
+ * # Example
219
+ *
220
+ * ```javascript
221
+ * const ids = cedarling.loaded_trusted_issuer_ids();
222
+ * ```
223
+ */
224
+ loaded_trusted_issuer_ids(): Array<any>;
225
+ /**
226
+ * Get the number of trusted issuers loaded successfully.
227
+ *
228
+ * # Example
229
+ *
230
+ * ```javascript
231
+ * const loadedCount = cedarling.loaded_trusted_issuers_count();
232
+ * ```
233
+ */
234
+ loaded_trusted_issuers_count(): number;
177
235
  /**
178
236
  * Create a new instance of the Cedarling application.
179
237
  * Assume that config is `Object`
@@ -230,6 +288,16 @@ export class Cedarling {
230
288
  * Closes the connections to the Lock Server and pushes all available logs.
231
289
  */
232
290
  shut_down(): Promise<void>;
291
+ /**
292
+ * Get the total number of trusted issuer entries discovered.
293
+ *
294
+ * # Example
295
+ *
296
+ * ```javascript
297
+ * const total = cedarling.total_issuers();
298
+ * ```
299
+ */
300
+ total_issuers(): number;
233
301
  }
234
302
 
235
303
  /**
@@ -448,3 +516,151 @@ export function init(config: any): Promise<Cedarling>;
448
516
  * ```
449
517
  */
450
518
  export function init_from_archive_bytes(config: any, archive_bytes: Uint8Array): Promise<Cedarling>;
519
+
520
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
521
+
522
+ export interface InitOutput {
523
+ readonly memory: WebAssembly.Memory;
524
+ readonly __wbg_cedarling_free: (a: number, b: number) => void;
525
+ readonly __wbg_multiissuerauthorizeresult_free: (a: number, b: number) => void;
526
+ readonly __wbg_get_multiissuerauthorizeresult_response: (a: number) => number;
527
+ readonly __wbg_set_multiissuerauthorizeresult_response: (a: number, b: number) => void;
528
+ readonly __wbg_get_multiissuerauthorizeresult_decision: (a: number) => number;
529
+ readonly __wbg_set_multiissuerauthorizeresult_decision: (a: number, b: number) => void;
530
+ readonly __wbg_get_multiissuerauthorizeresult_request_id: (a: number) => [number, number];
531
+ readonly __wbg_set_multiissuerauthorizeresult_request_id: (a: number, b: number, c: number) => void;
532
+ readonly multiissuerauthorizeresult_json_string: (a: number) => [number, number];
533
+ readonly init: (a: any) => any;
534
+ readonly init_from_archive_bytes: (a: any, b: any) => any;
535
+ readonly cedarling_new: (a: any) => any;
536
+ readonly cedarling_new_from_map: (a: any) => any;
537
+ readonly cedarling_authorize_unsigned: (a: number, b: any) => any;
538
+ readonly cedarling_authorize_multi_issuer: (a: number, b: any) => any;
539
+ readonly cedarling_pop_logs: (a: number) => [number, number, number];
540
+ readonly cedarling_get_log_by_id: (a: number, b: number, c: number) => [number, number, number];
541
+ readonly cedarling_get_log_ids: (a: number) => any;
542
+ readonly cedarling_get_logs_by_tag: (a: number, b: number, c: number) => [number, number, number, number];
543
+ readonly cedarling_get_logs_by_request_id: (a: number, b: number, c: number) => [number, number, number, number];
544
+ readonly cedarling_get_logs_by_request_id_and_tag: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
545
+ readonly cedarling_shut_down: (a: number) => any;
546
+ readonly cedarling_push_data_ctx: (a: number, b: number, c: number, d: any, e: number, f: bigint) => [number, number];
547
+ readonly cedarling_get_data_ctx: (a: number, b: number, c: number) => [number, number, number];
548
+ readonly cedarling_get_data_entry_ctx: (a: number, b: number, c: number) => [number, number, number];
549
+ readonly cedarling_remove_data_ctx: (a: number, b: number, c: number) => [number, number, number];
550
+ readonly cedarling_clear_data_ctx: (a: number) => [number, number];
551
+ readonly cedarling_list_data_ctx: (a: number) => [number, number, number];
552
+ readonly cedarling_get_stats_ctx: (a: number) => [number, number, number];
553
+ readonly cedarling_is_trusted_issuer_loaded_by_name: (a: number, b: number, c: number) => number;
554
+ readonly cedarling_is_trusted_issuer_loaded_by_iss: (a: number, b: number, c: number) => number;
555
+ readonly cedarling_total_issuers: (a: number) => number;
556
+ readonly cedarling_loaded_trusted_issuers_count: (a: number) => number;
557
+ readonly cedarling_loaded_trusted_issuer_ids: (a: number) => any;
558
+ readonly cedarling_failed_trusted_issuer_ids: (a: number) => any;
559
+ readonly __wbg_authorizeresult_free: (a: number, b: number) => void;
560
+ readonly __wbg_get_authorizeresult_decision: (a: number) => number;
561
+ readonly __wbg_set_authorizeresult_decision: (a: number, b: number) => void;
562
+ readonly __wbg_get_authorizeresult_request_id: (a: number) => [number, number];
563
+ readonly __wbg_set_authorizeresult_request_id: (a: number, b: number, c: number) => void;
564
+ readonly authorizeresult_json_string: (a: number) => [number, number];
565
+ readonly authorizeresult_principal: (a: number, b: number, c: number) => number;
566
+ readonly __wbg_authorizeresultresponse_free: (a: number, b: number) => void;
567
+ readonly authorizeresultresponse_decision: (a: number) => number;
568
+ readonly authorizeresultresponse_diagnostics: (a: number) => number;
569
+ readonly __wbg_diagnostics_free: (a: number, b: number) => void;
570
+ readonly diagnostics_reason: (a: number) => [number, number];
571
+ readonly diagnostics_errors: (a: number) => [number, number];
572
+ readonly __wbg_policyevaluationerror_free: (a: number, b: number) => void;
573
+ readonly policyevaluationerror_id: (a: number) => [number, number];
574
+ readonly policyevaluationerror_error: (a: number) => [number, number];
575
+ readonly __wbg_dataentry_free: (a: number, b: number) => void;
576
+ readonly __wbg_get_dataentry_key: (a: number) => [number, number];
577
+ readonly __wbg_set_dataentry_key: (a: number, b: number, c: number) => void;
578
+ readonly __wbg_get_dataentry_data_type: (a: number) => [number, number];
579
+ readonly __wbg_set_dataentry_data_type: (a: number, b: number, c: number) => void;
580
+ readonly __wbg_get_dataentry_created_at: (a: number) => [number, number];
581
+ readonly __wbg_set_dataentry_created_at: (a: number, b: number, c: number) => void;
582
+ readonly __wbg_get_dataentry_expires_at: (a: number) => [number, number];
583
+ readonly __wbg_set_dataentry_expires_at: (a: number, b: number, c: number) => void;
584
+ readonly __wbg_get_dataentry_access_count: (a: number) => bigint;
585
+ readonly __wbg_set_dataentry_access_count: (a: number, b: bigint) => void;
586
+ readonly dataentry_value: (a: number) => [number, number, number];
587
+ readonly dataentry_json_string: (a: number) => [number, number];
588
+ readonly __wbg_datastorestats_free: (a: number, b: number) => void;
589
+ readonly __wbg_get_datastorestats_entry_count: (a: number) => number;
590
+ readonly __wbg_set_datastorestats_entry_count: (a: number, b: number) => void;
591
+ readonly __wbg_get_datastorestats_max_entries: (a: number) => number;
592
+ readonly __wbg_set_datastorestats_max_entries: (a: number, b: number) => void;
593
+ readonly __wbg_get_datastorestats_max_entry_size: (a: number) => number;
594
+ readonly __wbg_set_datastorestats_max_entry_size: (a: number, b: number) => void;
595
+ readonly __wbg_get_datastorestats_metrics_enabled: (a: number) => number;
596
+ readonly __wbg_set_datastorestats_metrics_enabled: (a: number, b: number) => void;
597
+ readonly __wbg_get_datastorestats_total_size_bytes: (a: number) => number;
598
+ readonly __wbg_set_datastorestats_total_size_bytes: (a: number, b: number) => void;
599
+ readonly __wbg_get_datastorestats_avg_entry_size_bytes: (a: number) => number;
600
+ readonly __wbg_set_datastorestats_avg_entry_size_bytes: (a: number, b: number) => void;
601
+ readonly __wbg_get_datastorestats_capacity_usage_percent: (a: number) => number;
602
+ readonly __wbg_set_datastorestats_capacity_usage_percent: (a: number, b: number) => void;
603
+ readonly __wbg_get_datastorestats_memory_alert_threshold: (a: number) => number;
604
+ readonly __wbg_set_datastorestats_memory_alert_threshold: (a: number, b: number) => void;
605
+ readonly __wbg_get_datastorestats_memory_alert_triggered: (a: number) => number;
606
+ readonly __wbg_set_datastorestats_memory_alert_triggered: (a: number, b: number) => void;
607
+ readonly datastorestats_json_string: (a: number) => [number, number];
608
+ readonly __wbg_intounderlyingbytesource_free: (a: number, b: number) => void;
609
+ readonly intounderlyingbytesource_type: (a: number) => number;
610
+ readonly intounderlyingbytesource_autoAllocateChunkSize: (a: number) => number;
611
+ readonly intounderlyingbytesource_start: (a: number, b: any) => void;
612
+ readonly intounderlyingbytesource_pull: (a: number, b: any) => any;
613
+ readonly intounderlyingbytesource_cancel: (a: number) => void;
614
+ readonly __wbg_intounderlyingsource_free: (a: number, b: number) => void;
615
+ readonly intounderlyingsource_pull: (a: number, b: any) => any;
616
+ readonly intounderlyingsource_cancel: (a: number) => void;
617
+ readonly __wbg_intounderlyingsink_free: (a: number, b: number) => void;
618
+ readonly intounderlyingsink_write: (a: number, b: any) => any;
619
+ readonly intounderlyingsink_close: (a: number) => any;
620
+ readonly intounderlyingsink_abort: (a: number, b: any) => any;
621
+ readonly rust_zstd_wasm_shim_qsort: (a: number, b: number, c: number, d: number) => void;
622
+ readonly rust_zstd_wasm_shim_malloc: (a: number) => number;
623
+ readonly rust_zstd_wasm_shim_memcmp: (a: number, b: number, c: number) => number;
624
+ readonly rust_zstd_wasm_shim_calloc: (a: number, b: number) => number;
625
+ readonly rust_zstd_wasm_shim_free: (a: number) => void;
626
+ readonly rust_zstd_wasm_shim_memcpy: (a: number, b: number, c: number) => number;
627
+ readonly rust_zstd_wasm_shim_memmove: (a: number, b: number, c: number) => number;
628
+ readonly rust_zstd_wasm_shim_memset: (a: number, b: number, c: number) => number;
629
+ readonly wasm_bindgen__convert__closures_____invoke__haed62cf3e2984162: (a: number, b: number, c: any) => [number, number];
630
+ readonly wasm_bindgen__convert__closures_____invoke__h7b228b9e08b1988a: (a: number, b: number, c: any, d: any) => void;
631
+ readonly wasm_bindgen__convert__closures_____invoke__h7bfdbb08164f06ae: (a: number, b: number, c: any) => void;
632
+ readonly wasm_bindgen__convert__closures_____invoke__h57b5907d3b936f99: (a: number, b: number) => void;
633
+ readonly wasm_bindgen__convert__closures_____invoke__hc120bfaa77467242: (a: number, b: number) => void;
634
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
635
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
636
+ readonly __wbindgen_exn_store: (a: number) => void;
637
+ readonly __externref_table_alloc: () => number;
638
+ readonly __wbindgen_externrefs: WebAssembly.Table;
639
+ readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
640
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
641
+ readonly __externref_table_dealloc: (a: number) => void;
642
+ readonly __externref_drop_slice: (a: number, b: number) => void;
643
+ readonly __wbindgen_start: () => void;
644
+ }
645
+
646
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
647
+
648
+ /**
649
+ * Instantiates the given `module`, which can either be bytes or
650
+ * a precompiled `WebAssembly.Module`.
651
+ *
652
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
653
+ *
654
+ * @returns {InitOutput}
655
+ */
656
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
657
+
658
+ /**
659
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
660
+ * for everything else, calls `WebAssembly.instantiate` directly.
661
+ *
662
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
663
+ *
664
+ * @returns {Promise<InitOutput>}
665
+ */
666
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;