Skip to main content

Cedarling

Struct Cedarling 

Source
pub struct Cedarling { /* private fields */ }

Implementations§

Source§

impl Cedarling

Source

pub fn load_from_json(config: String) -> Result<Self, CedarlingError>

Source

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.

Source

pub fn load_from_file(path: String) -> Result<Self, CedarlingError>

Source

pub fn authorize_unsigned( &self, principal: Option<Arc<EntityData>>, action: String, resource: Arc<EntityData>, context: JsonValue, options: Option<AuthorizeOptions>, ) -> Result<AuthorizeResult, AuthorizeError>

Source

pub fn authorize_multi_issuer( &self, tokens: Vec<TokenInput>, action: String, resource: Arc<EntityData>, context: Option<JsonValue>, options: Option<AuthorizeOptions>, ) -> Result<MultiIssuerAuthorizeResult, AuthorizeError>

Source

pub fn authorize_unsigned_batch( &self, principal: Option<Arc<EntityData>>, items: Vec<BatchItem>, options: Option<AuthorizeOptions>, ) -> Result<BatchAuthorizeUnsignedResponse, AuthorizeError>

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.

Source

pub fn authorize_multi_issuer_batch( &self, tokens: Vec<TokenInput>, items: Vec<BatchItem>, options: Option<AuthorizeOptions>, ) -> Result<BatchAuthorizeMultiIssuerResponse, AuthorizeError>

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.

Source

pub fn pop_logs(&self) -> Result<Vec<String>, LogError>

Source

pub fn get_log_by_id(&self, id: &str) -> Result<String, LogError>

Source

pub fn get_log_ids(&self) -> Vec<String>

Source

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.

Source

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.

Source

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.

Source

pub fn shut_down(&self)

Closes the connections to the Lock Server and pushes all available logs.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn clear_data_ctx(&self) -> Result<(), DataError>

Clear all entries from the data store.

Source

pub fn list_data_ctx(&self) -> Result<Vec<DataEntry>, DataError>

List all entries with their metadata. Returns a list of DataEntry objects.

Source

pub fn get_stats_ctx(&self) -> Result<DataStoreStats, DataError>

Get statistics about the data store.

Source

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).

Source

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.

Source

pub fn is_trusted_issuer_loaded_by_name(&self, issuer_name: &str) -> bool

Source

pub fn is_trusted_issuer_loaded_by_iss(&self, iss_claim: &str) -> bool

Source

pub fn total_issuers(&self) -> i64

Source

pub fn loaded_trusted_issuers_count(&self) -> i64

Source

pub fn loaded_trusted_issuer_ids(&self) -> Vec<String>

Source

pub fn failed_trusted_issuer_ids(&self) -> Vec<String>

Trait Implementations§

Source§

impl<UT> LiftRef<UT> for Cedarling

Source§

impl<UT> LowerError<UT> for Cedarling

Source§

fn lower_error(obj: Self) -> RustBuffer

Lower this value for scaffolding function return Read more
Source§

impl<UT> LowerReturn<UT> for Cedarling

Source§

type ReturnType = <Arc<Cedarling> as LowerReturn<UniFfiTag>>::ReturnType

The type that should be returned by scaffolding functions for this type. Read more
Source§

fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>

Lower the return value from an scaffolding call Read more
§

fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>

Lower the return value for failed argument lifts Read more
Source§

impl<UT> TypeId<UT> for Cedarling

Source§

const TYPE_ID_META: MetadataBuffer

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, UT> HandleAlloc<UT> for T
where T: Send + Sync,

§

fn new_handle(value: Arc<T>) -> Handle

Create a new handle for an Arc value Read more
§

unsafe fn clone_handle(handle: Handle) -> Handle

Clone a handle Read more
§

unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ

Consume a handle, getting back the initial Arc<> Read more
§

unsafe fn get_arc(handle: Handle) -> Arc<Self> ⓘ

Get a clone of the Arc<> using a “borrowed” handle. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in [Layered].
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more