pub enum PolicyStoreSource {
Json(String),
Yaml(String),
LockServer(String),
FileJson(PathBuf),
FileYaml(PathBuf),
CjarFile(PathBuf),
CjarUrl(String),
Directory(PathBuf),
Uri(String),
ArchiveBytes(Vec<u8>),
}Expand description
PolicyStoreSource represents the source from which policies will be retrieved.
Variants§
Json(String)
Read the policy directly from a raw JSON string.
The string contains the raw JSON data representing the policy.
Yaml(String)
Read the policy directly from a raw YAML string.
The string contains the raw YAML data representing the policy. Mostly used only for testing purposes.
LockServer(String)
Fetch the policies from the Lock Master service using a specified identifier.
The string contains a URI where the policy store can be retrieved.
FileJson(PathBuf)
Read policy from a JSON File.
FileYaml(PathBuf)
Read policy from a YAML File.
CjarFile(PathBuf)
Read policy from a Cedar Archive (.cjar) file.
The path points to a .cjar archive containing the policy store
in the new directory structure format.
CjarUrl(String)
Read policy from a Cedar Archive (.cjar) fetched from a URL.
The string contains a URL where the .cjar archive can be downloaded.
Directory(PathBuf)
Read policy from a directory structure.
The path points to a directory containing the policy store
in the directory structure format (metadata.json, schema.cedarschema, policies/, etc.).
Uri(String)
An unresolved URI whose source type (archive vs lock server) is detected at load time via magic byte checking.
During loading, load_policy_store
resolves this by making an HTTP request to determine whether the URI points
to a Cedar Archive (.cjar) or a Lock Master endpoint.
ArchiveBytes(Vec<u8>)
Read policy from Cedar Archive bytes directly.
The bytes contain a .cjar archive (ZIP format) with the policy store.
This is particularly useful for:
- WASM environments with custom fetch logic
- Embedding archives in applications
- Loading from non-standard sources (databases, S3, etc.)
Trait Implementations§
Source§impl Clone for PolicyStoreSource
impl Clone for PolicyStoreSource
Source§fn clone(&self) -> PolicyStoreSource
fn clone(&self) -> PolicyStoreSource
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PolicyStoreSource
impl Debug for PolicyStoreSource
Source§impl<'de> Deserialize<'de> for PolicyStoreSource
impl<'de> Deserialize<'de> for PolicyStoreSource
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for PolicyStoreSource
impl PartialEq for PolicyStoreSource
Source§impl Serialize for PolicyStoreSource
impl Serialize for PolicyStoreSource
impl StructuralPartialEq for PolicyStoreSource
Auto Trait Implementations§
impl Freeze for PolicyStoreSource
impl RefUnwindSafe for PolicyStoreSource
impl Send for PolicyStoreSource
impl Sync for PolicyStoreSource
impl Unpin for PolicyStoreSource
impl UnsafeUnpin for PolicyStoreSource
impl UnwindSafe for PolicyStoreSource
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request