pub enum PermissionScope {
All,
Bifrost(BifrostPermissionScope),
Gateway(GatewayAccess),
Verifier(CardUid),
Tool(BuiltinTool),
}Expand description
Objects one permission grant reaches.
Domain-tagged rather than a shared string object language: a future Wyrd domain that needs object scope adds its own typed variant instead of overloading someone else’s identity spelling.
Variants§
All
Every object of the covered resource and action.
Bifrost(BifrostPermissionScope)
One Bifrost schema or table.
Gateway(GatewayAccess)
One gateway deployment or exact deployment/model pair.
Verifier(CardUid)
One Verifier Card, by its exact UID.
Tool(BuiltinTool)
One exact built-in Agent tool, never a prefix or path.
Implementations§
Source§impl PermissionScope
impl PermissionScope
Sourcepub fn covers(&self, required: &PermissionScope) -> bool
pub fn covers(&self, required: &PermissionScope) -> bool
True when this scope’s objects include every object required names.
Self::All covers everything; a Bifrost scope never covers All,
because “all objects” is strictly wider than any single schema or table.
A Verifier or tool scope covers only the same Verifier UID or tool.
Sourcepub const fn is_bifrost(&self) -> bool
pub const fn is_bifrost(&self) -> bool
True when this scope names a Bifrost object rather than every object.
Sourcepub const fn is_gateway(&self) -> bool
pub const fn is_gateway(&self) -> bool
True when this scope names a gateway deployment or model.
Sourcepub fn validate(&self) -> Result<(), PermissionScopeError>
pub fn validate(&self) -> Result<(), PermissionScopeError>
Rejects a scope whose object identity is malformed.
§Errors
Returns PermissionScopeError::InvalidIdentifier when a catalog or
schema segment is empty, longer than 63 characters, or contains anything
other than ASCII alphanumerics, _, or -. Gateway identities are
validated when their typed ids decode, so a gateway, Verifier, or tool
scope is always valid.
Trait Implementations§
Source§impl Clone for PermissionScope
impl Clone for PermissionScope
Source§fn clone(&self) -> PermissionScope
fn clone(&self) -> PermissionScope
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 PermissionScope
impl Debug for PermissionScope
Source§impl<'de> Deserialize<'de> for PermissionScope
impl<'de> Deserialize<'de> for PermissionScope
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PermissionScope, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PermissionScope, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for PermissionScope
Source§impl Hash for PermissionScope
impl Hash for PermissionScope
Source§impl JsonSchema for PermissionScope
impl JsonSchema for PermissionScope
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for PermissionScope
impl PartialEq for PermissionScope
Source§impl Serialize for PermissionScope
impl Serialize for PermissionScope
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for PermissionScope
Auto Trait Implementations§
impl Freeze for PermissionScope
impl RefUnwindSafe for PermissionScope
impl Send for PermissionScope
impl Sync for PermissionScope
impl Unpin for PermissionScope
impl UnsafeUnpin for PermissionScope
impl UnwindSafe for PermissionScope
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.