pub struct ConsentRequest {
pub class: String,
pub key: String,
pub summary: String,
pub args: Cbor,
}Expand description
One request for authorization.
Fields§
§class: StringThe capability class this action belongs to, as a namespaced
identifier — “db:drop”, “browser:navigate”. It MUST be declared in the
component’s act:component capabilities; an undeclared class is denied
without a prompt.
Classes are the unit an operator grants, denies and reads in an audit trail, so they should name what a person would want to decide about. Splitting an irreversible action into its own class (“db:drop” apart from “db:ddl”) is what lets that action be refused without refusing the rest.
key: StringThe subject within the class — a database name, an origin, an account identifier.
It does three jobs at once, deliberately. It is what the host remembers
when a human approves (“allow this, don’t ask again”), it is what the
audit trail records, and it is a dimension policy constraints match
against. Because the same value serves all three, the operation a human
approved cannot differ from the operation policy authorized, and a
second key hidden inside args cannot shadow it.
An empty key means the decision is not subject-specific, so approving it approves the class. Prefer a real subject: a remembered “yes” to a whole class is exactly the blanket authorization this interface exists to avoid.
The component chooses this string, which makes it untrusted input. A class SHOULD fix the shape of its key — an origin rather than a full URL, a bare identifier rather than a path — so that operator patterns written against it mean what they appear to mean.
summary: StringOne line, in the component’s own words, describing the action to the human who may be asked to approve it.
Untrusted, and treated as such: the host attributes it to the component, strips control characters, truncates it, and never lets it stand alone as the question. It supplies detail the host cannot know — which rows, which account, why now — and it never determines the decision.
args: CborFurther dimensions policy may constrain, as a CBOR map — for example
{ "table": "events" }. Usually empty: key alone carries most
classes.
A value that is not a CBOR map carries no dimensions rather than being
an error; key still matches. Nothing here can widen what key and the
declared ceiling already permit.
Trait Implementations§
Source§impl Clone for ConsentRequest
impl Clone for ConsentRequest
Source§fn clone(&self) -> ConsentRequest
fn clone(&self) -> ConsentRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl ComponentType for ConsentRequest
Source§impl Debug for ConsentRequest
impl Debug for ConsentRequest
impl Lift for ConsentRequest
impl Lower for ConsentRequest
Auto Trait Implementations§
impl Freeze for ConsentRequest
impl RefUnwindSafe for ConsentRequest
impl Send for ConsentRequest
impl Sync for ConsentRequest
impl Unpin for ConsentRequest
impl UnsafeUnpin for ConsentRequest
impl UnwindSafe for ConsentRequest
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,
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