pub struct Cedarling { /* private fields */ }Implementations§
Source§impl Cedarling
impl Cedarling
pub fn load_from_json(config: String) -> Result<Self, CedarlingError>
Sourcepub fn load_from_json_with_archive_bytes(
config: String,
archive_bytes: &[u8],
) -> Result<Self, CedarlingError>
pub fn load_from_json_with_archive_bytes( config: String, archive_bytes: &[u8], ) -> Result<Self, CedarlingError>
Loads Cedarling from bootstrap JSON plus a Cedar archive (.cjar) as raw bytes.
host cannot pass a filesystem path—for example Android assets loaded via AssetManager.
pub fn load_from_file(path: String) -> Result<Self, CedarlingError>
Authorize a batch of unsigned requests against one shared principal.
Setup work (principal build + pushed-data snapshot) runs once and each
item is evaluated in input order. Returns a
BatchAuthorizeUnsignedResponse with batch_id and per-item results.
Batch-level failures reject the whole call; per-item failures are returned
as BatchItemError entries that callers must inspect without affecting other items.
Authorize a batch of multi-issuer requests against one shared token set.
Tokens are validated and token/issuer entities built once, then each
item is evaluated in input order. Batch-level failures (validation,
JWT verification, status-list refresh) reject the whole call; per-item
failures are returned as BatchItemError entries that callers must inspect.
pub fn pop_logs(&self) -> Result<Vec<String>, LogError>
pub fn get_log_by_id(&self, id: &str) -> Result<String, LogError>
pub fn get_log_ids(&self) -> Vec<String>
Sourcepub fn get_logs_by_tag(&self, tag: &str) -> Result<Vec<String>, LogError>
pub fn get_logs_by_tag(&self, tag: &str) -> Result<Vec<String>, LogError>
Get logs by tag, like log_kind or log level.
Tag can be log_kind, log_level.
Sourcepub fn get_logs_by_request_id(
&self,
request_id: &str,
) -> Result<Vec<String>, LogError>
pub fn get_logs_by_request_id( &self, request_id: &str, ) -> Result<Vec<String>, LogError>
Get logs by request_id. Return log entries that match the given request_id.
Sourcepub fn get_logs_by_request_id_and_tag(
&self,
request_id: &str,
tag: &str,
) -> Result<Vec<String>, LogError>
pub fn get_logs_by_request_id_and_tag( &self, request_id: &str, tag: &str, ) -> Result<Vec<String>, LogError>
Get log by request_id and tag, like composite key request_id + log_kind.
Tag can be log_kind, log_level.
Return log entries that match the given request_id and tag.
Sourcepub fn shut_down(&self)
pub fn shut_down(&self)
Closes the connections to the Lock Server and pushes all available logs.
Sourcepub fn push_data_ctx(
&self,
key: String,
value: JsonValue,
ttl_secs: Option<i64>,
) -> Result<(), DataError>
pub fn push_data_ctx( &self, key: String, value: JsonValue, ttl_secs: Option<i64>, ) -> Result<(), DataError>
Push a value into the data store with an optional TTL. If the key already exists, the value will be replaced. If TTL is not provided, the default TTL from configuration is used.
Sourcepub fn get_data_ctx(&self, key: String) -> Result<Option<JsonValue>, DataError>
pub fn get_data_ctx(&self, key: String) -> Result<Option<JsonValue>, DataError>
Get a value from the data store by key. Returns None if the key doesn’t exist or the entry has expired.
Sourcepub fn get_data_entry_ctx(
&self,
key: String,
) -> Result<Option<DataEntry>, DataError>
pub fn get_data_entry_ctx( &self, key: String, ) -> Result<Option<DataEntry>, DataError>
Get a data entry with full metadata by key. Returns None if the key doesn’t exist or the entry has expired.
Sourcepub fn remove_data_ctx(&self, key: String) -> Result<bool, DataError>
pub fn remove_data_ctx(&self, key: String) -> Result<bool, DataError>
Remove a value from the data store by key. Returns true if the key existed and was removed, false otherwise.
Sourcepub fn clear_data_ctx(&self) -> Result<(), DataError>
pub fn clear_data_ctx(&self) -> Result<(), DataError>
Clear all entries from the data store.
Sourcepub fn list_data_ctx(&self) -> Result<Vec<DataEntry>, DataError>
pub fn list_data_ctx(&self) -> Result<Vec<DataEntry>, DataError>
List all entries with their metadata. Returns a list of DataEntry objects.
Sourcepub fn get_stats_ctx(&self) -> Result<DataStoreStats, DataError>
pub fn get_stats_ctx(&self) -> Result<DataStoreStats, DataError>
Get statistics about the data store.
Sourcepub fn drain_metrics(&self) -> Result<MetricsSnapshot, MetricsError>
pub fn drain_metrics(&self) -> Result<MetricsSnapshot, MetricsError>
Destructive read: returns the telemetry metrics snapshot and resets
the counters for the next interval. interval is a Duration with
sub-second precision (Python timedelta, Kotlin java.time.Duration,
Swift TimeInterval seconds).
Sourcepub fn policy_store_id(&self) -> Option<String>
pub fn policy_store_id(&self) -> Option<String>
Returns the ID of the currently published policy store, if it carries one.
None when the store carries no ID. The value is an opaque,
source-dependent string; it may change after a background refresh.
pub fn is_trusted_issuer_loaded_by_name(&self, issuer_name: &str) -> bool
pub fn is_trusted_issuer_loaded_by_iss(&self, iss_claim: &str) -> bool
pub fn total_issuers(&self) -> i64
pub fn loaded_trusted_issuers_count(&self) -> i64
pub fn loaded_trusted_issuer_ids(&self) -> Vec<String>
pub fn failed_trusted_issuer_ids(&self) -> Vec<String>
Trait Implementations§
Source§impl<UT> LowerError<UT> for Cedarling
impl<UT> LowerError<UT> for Cedarling
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for Cedarling
impl<UT> LowerReturn<UT> for Cedarling
Source§type ReturnType = <Arc<Cedarling> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<Cedarling> as LowerReturn<UniFfiTag>>::ReturnType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Auto Trait Implementations§
impl !RefUnwindSafe for Cedarling
impl !UnwindSafe for Cedarling
impl Freeze for Cedarling
impl Send for Cedarling
impl Sync for Cedarling
impl Unpin for Cedarling
impl UnsafeUnpin for Cedarling
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].