pub struct RunAs {
pub roles: Vec<String>,
pub scopes: Vec<String>,
pub tenant: Option<String>,
}Expand description
The least-privilege authority ceiling a scheduled source’s background mutations
run under (#573) — the source’s run_as.
This is a ceiling: the source can never exceed these roles/scopes. It is
authored on @source/@fraiseql.source and compiled into
SourceDefinition::run_as. A SourceDefinition with no run_as runs
fail-closed (no authority → RLS/authz deny), so granting a ceiling is a
deliberate operator act.
tenant scopes writes for a single-tenant or global source; a multi-tenant
source leaves it unset and re-scopes each write per message at runtime (only the
handler knows which tenant a given payload belongs to).
Fields§
§roles: Vec<String>Roles granted to the source’s background identity (the RBAC ceiling).
scopes: Vec<String>Scopes granted to the source’s background identity.
tenant: Option<String>The single tenant this source’s writes are scoped to, if any. Unset ⇒ global/system (NULL tenant) or a multi-tenant source that re-scopes per message.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RunAs
impl<'de> Deserialize<'de> for RunAs
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 RunAs
impl StructuralPartialEq for RunAs
Auto Trait Implementations§
impl Freeze for RunAs
impl RefUnwindSafe for RunAs
impl Send for RunAs
impl Sync for RunAs
impl Unpin for RunAs
impl UnsafeUnpin for RunAs
impl UnwindSafe for RunAs
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.