pub enum ServiceTier {
All,
Analytics,
ReadOnly,
}Expand description
RBAC service tier (trusty-agents #445).
Why: Different transports (CLI, Slack, Telegram, HTTP) expose the same
tool registry to users with different trust levels. Tools opt into
RBAC by listing the tiers that must be denied access. Defined here
(not in trusty-agents/rbac) because the ToolExecutor::restricted_tiers
signature returns &[ServiceTier] — external agent crates would not
be able to implement the trait without seeing the enum.
What: All (full access — controller / authenticated operator),
Analytics (read + analytical queries, no mutations), ReadOnly
(passive observation only, the strictest tier).
Serializes as snake_case so TOML/JSON authors can write
tier = "read_only" rather than the variant name. Default is
All so callsites that forget to set a tier degrade open at the
controller (unauthenticated transports MUST set a stricter default).
Test: trusty-agents/rbac covers serde + ordering; trusty-agents/tools/mod::dispatch_for_user_*
covers integration with dispatch.
Variants§
All
Full access — the controller / authenticated operator.
Analytics
Analytics-only tier — read + analytical queries, no mutations.
ReadOnly
Read-only tier — passive observation only. The strictest tier.
Trait Implementations§
Source§impl Clone for ServiceTier
impl Clone for ServiceTier
Source§fn clone(&self) -> ServiceTier
fn clone(&self) -> ServiceTier
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 ServiceTier
impl Debug for ServiceTier
Source§impl Default for ServiceTier
impl Default for ServiceTier
Source§fn default() -> ServiceTier
fn default() -> ServiceTier
Source§impl<'de> Deserialize<'de> for ServiceTier
impl<'de> Deserialize<'de> for ServiceTier
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ServiceTier, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ServiceTier, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for ServiceTier
Source§impl Hash for ServiceTier
impl Hash for ServiceTier
Source§impl PartialEq for ServiceTier
impl PartialEq for ServiceTier
Source§impl Serialize for ServiceTier
impl Serialize for ServiceTier
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 ServiceTier
Auto Trait Implementations§
impl Freeze for ServiceTier
impl RefUnwindSafe for ServiceTier
impl Send for ServiceTier
impl Sync for ServiceTier
impl Unpin for ServiceTier
impl UnsafeUnpin for ServiceTier
impl UnwindSafe for ServiceTier
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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