pub enum Operation {
Show 15 variants
Query,
Subscribe,
Write,
Create,
Publish,
Infer,
Train,
Context,
Serve,
Spawn,
Manage,
MeshInvoke,
MeshStage,
MeshDelta,
MeshStatus,
}Expand description
Operation types that can be controlled via policies
Variants§
Query
Query data (q)
Subscribe
Subscribe to a stream/notification (b)
Write
Write data (w)
Create
Create a resource (r)
Publish
Publish/broadcast to subscribers (l)
Infer
Run model inference (i)
Train
Train/fine-tune model (t)
Context
Context-augmented generation (c)
Serve
Serve via API (s)
Spawn
Spawn a process or task (p)
Manage
Admin operations (m)
MeshInvoke
Umbrella mesh invoke right — inference:peer-call / mesh:rpc (authority).
MeshStage
Submit an inference activation/stage to a peer host (authority).
MeshDelta
Submit a TTT delta to a peer/aggregator host (authority).
MeshStatus
Read a peer host’s mesh job/pipeline status (read-only).
Implementations§
Source§impl Operation
impl Operation
Sourcepub const fn from_scope_action(action: ScopeAction) -> Self
pub const fn from_scope_action(action: ScopeAction) -> Self
Convert a schema action to its runtime authorization operation.
The exhaustive match is intentional: adding a ScopeAction in the
schema makes this crate fail to compile until runtime enforcement is
defined for it.
Sourcepub const fn scope_action(self) -> Option<ScopeAction>
pub const fn scope_action(self) -> Option<ScopeAction>
Return the generated schema action represented by this operation.
MeshStatus is the sole runtime-only operation and reuses the query
capability token at authorization boundaries.
Sourcepub fn as_capability(&self) -> &'static str
pub fn as_capability(&self) -> &'static str
The unified scope-action vocabulary (S3, epic #547).
Returns this operation’s ScopeAction enumerant name — the SAME token used
by the $scope/$capability capnp annotation and stored in
[crate::auth::Scope::action]. There is one action vocabulary, not two:
the schema annotation, the runtime Scope, and this enum all agree.
This is the canonical bridge between the compile-time TE baseline (schema
annotation) and runtime enforcement. MeshStatus shares query because the
mesh read ability IS the canonical status read (#319), matching as_str().
Sourcepub fn from_capability(action: &str) -> Option<Self>
pub fn from_capability(action: &str) -> Option<Self>
Parse an Operation from a unified scope-action token (a ScopeAction
enumerant name — what the $scope/$capability annotation emits and what
[crate::auth::Scope::action] carries). The inverse of Self::as_capability.
Returns None for an unknown token; callers MUST fail closed (no default-allow).
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Get the dot-namespaced operation name for policy matching.
Returns the canonical dot-namespaced string for this operation variant.
Forwarded verbatim to the Casbin enforcer, which uses keyMatch to accept
both this format and legacy flat strings stored in policy files.
Note on Manage: This enum variant is a coarse gate over the ttt.*
namespace. as_str() returns "ttt.writeback" as a representative string,
but sub-actions (ttt.evict, ttt.zero) are all gated by the same Manage
variant. When callers need to enforce at sub-action granularity (e.g. in an
RPC handler), they should pass the specific dot-namespaced string directly to
check_with_domain rather than going through this method.
Operation::Manage.as_str() (i.e. "ttt.writeback") is intentionally used
only for gates that specifically require the highest privilege in the ttt.*
namespace, such as issuing tokens on behalf of another subject. Handlers that
only need any ttt.* permission (e.g. ttt.evict) must pass the specific
action string to avoid incorrectly denying callers who hold a lesser ttt.*
permission but not ttt.writeback.
Sourcepub fn from_dot_str(s: &str) -> Option<Self>
pub fn from_dot_str(s: &str) -> Option<Self>
Parse an operation from a dot-namespaced or legacy flat string.
Returns None for unrecognized strings. Handles both the new
dot-namespaced format ("infer.generate") and the old flat format
("infer") for migration compatibility.
Trait Implementations§
impl Copy for Operation
impl Eq for Operation
impl StructuralPartialEq for Operation
Auto Trait Implementations§
impl Freeze for Operation
impl RefUnwindSafe for Operation
impl Send for Operation
impl Sync for Operation
impl Unpin for Operation
impl UnsafeUnpin for Operation
impl UnwindSafe for Operation
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§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<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> JaggedSlice<T> for T
impl<T> JaggedSlice<T> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string()] Read more§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString]. Read more