#[non_exhaustive]pub enum Capability {
Show 39 variants
Network {
allow: Vec<SmolStr>,
},
Filesystem {
read: Vec<SmolStr>,
write: Vec<SmolStr>,
},
HostQuery {
read_only: bool,
scopes: Vec<SmolStr>,
},
Kms {
key_ids: Vec<SmolStr>,
},
Secret {
ids: Vec<SmolStr>,
},
Lock {
granularity: LockGranularity,
},
Config {
keys: Vec<SmolStr>,
},
PluginStorage,
ScalarFn,
AggregateFn,
WindowFn,
Procedure,
ProcedureWrites,
ProcedureSchema,
ProcedureDbms,
LocyAggregate,
LocyPredicate,
Operator,
Index,
Storage,
Algorithm,
Crdt,
Hook,
Trigger,
BackgroundJob {
max_concurrent: u32,
},
Type,
Auth,
Authz,
Connector,
Collation,
Cdc,
Catalog,
PluginDeclare,
MemoryBytes(u64),
FuelPerCall(u64),
WallClockMillisPerCall(u64),
ConcurrentInstances(u32),
TotalMemoryBytes(u64),
MaxResultRows(u64),
}Expand description
A single permission grant.
Capability is the leaf node of the permission model. A
CapabilitySet is a collection of capabilities.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Network
HTTP / TCP egress; allow-list of URI patterns.
Fields
Filesystem
Filesystem read / write access with per-direction path patterns.
Fields
HostQuery
Invoking Cypher / Locy queries back into the host session.
Fields
Kms
KMS access for sign / verify operations.
Secret
Acquiring named secret handles (opaque to the plugin).
Lock
Explicit lock primitives (host.lock_nodes, host.lock_edges).
Fields
granularity: LockGranularityGranularity of locks permitted.
Config
Scoped configuration K/V access (host.config_get).
PluginStorage
Per-plugin K/V store (scoped namespace).
ScalarFn
Register Cypher scalar functions.
AggregateFn
Register Cypher aggregate functions.
WindowFn
Register Cypher window functions.
Procedure
Register Cypher procedures (read-only mode).
ProcedureWrites
Register procedures that may mutate the graph.
ProcedureSchema
Register procedures that may issue DDL.
ProcedureDbms
Register administrative procedures.
LocyAggregate
Register Locy aggregate functions.
LocyPredicate
Register Locy predicates (including neural).
Operator
Register physical operators / optimizer rules.
Index
Register index kinds.
Storage
Register storage backends by URI scheme.
Algorithm
Register graph algorithms.
Crdt
Register CRDT kinds.
Hook
Register session / query lifecycle hooks.
Trigger
Register fine-grained mutation triggers.
BackgroundJob
Register background / scheduled jobs.
Type
Register logical (Arrow extension) types.
Auth
Register authentication providers.
Authz
Register authorization policies.
Connector
Register wire / connector protocols.
Collation
Register collations (sort orders).
Cdc
Register CDC output sinks.
Catalog
Register catalogs / virtual schemas.
PluginDeclare
Authority to call meta-procedures (uni.plugin.declare*).
MemoryBytes(u64)
Maximum wasm linear memory per instance.
FuelPerCall(u64)
Maximum wasmtime fuel per call.
WallClockMillisPerCall(u64)
Maximum wall-clock milliseconds per call.
ConcurrentInstances(u32)
Maximum concurrent instances in the wasm pool.
TotalMemoryBytes(u64)
Maximum total memory across all instances.
MaxResultRows(u64)
Cap on rows yielded by a procedure.
Implementations§
Source§impl Capability
impl Capability
Sourcepub fn network_allows(&self, url: &str) -> bool
pub fn network_allows(&self, url: &str) -> bool
True if this is a Capability::Network grant whose allow-list
matches url.
Used for layer-3 (call-time) attenuation of uni.http.* host fns: a
granted Network { allow } only permits URLs matching one of its
patterns. Non-Network capabilities never match.
Sourcepub fn kms_allows(&self, key_id: &str) -> bool
pub fn kms_allows(&self, key_id: &str) -> bool
True if this is a Capability::Kms grant permitting key_id.
Sourcepub fn secret_allows(&self, id: &str) -> bool
pub fn secret_allows(&self, id: &str) -> bool
True if this is a Capability::Secret grant permitting id.
Sourcepub fn filesystem_read_allows(&self, path: &str) -> bool
pub fn filesystem_read_allows(&self, path: &str) -> bool
True if this is a Capability::Filesystem grant whose read
allow-list matches path.
Patterns are matched with wildcard_match (path-opaque — * and **
both span /), which suits the /data/**-style grants in use.
Sourcepub fn filesystem_write_allows(&self, path: &str) -> bool
pub fn filesystem_write_allows(&self, path: &str) -> bool
True if this is a Capability::Filesystem grant whose write
allow-list matches path.
Trait Implementations§
Source§impl Clone for Capability
impl Clone for Capability
Source§fn clone(&self) -> Capability
fn clone(&self) -> Capability
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 Capability
impl Debug for Capability
Source§impl<'de> Deserialize<'de> for Capability
impl<'de> Deserialize<'de> for Capability
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>,
impl Eq for Capability
Source§impl Ord for Capability
impl Ord for Capability
Source§fn cmp(&self, other: &Capability) -> Ordering
fn cmp(&self, other: &Capability) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for Capability
impl PartialEq for Capability
Source§fn eq(&self, other: &Capability) -> bool
fn eq(&self, other: &Capability) -> bool
self and other values to be equal, and is used by ==.Source§impl PartialOrd for Capability
impl PartialOrd for Capability
Source§impl Serialize for Capability
impl Serialize for Capability
impl StructuralPartialEq for Capability
Auto Trait Implementations§
impl Freeze for Capability
impl RefUnwindSafe for Capability
impl Send for Capability
impl Sync for Capability
impl Unpin for Capability
impl UnsafeUnpin for Capability
impl UnwindSafe for Capability
Blanket Implementations§
impl<T> Allocation for T
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.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§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 more