pub struct DecisionRecord {Show 13 fields
pub request_uri: String,
pub account: String,
pub client_origin: String,
pub client_key: ClientKey,
pub first_time: bool,
pub client_self: ClientSelf,
pub requested: ScopeSet,
pub verdict: Verdict,
pub token: Option<ConsentReference>,
pub created_at: OffsetDateTime,
pub expires_at: OffsetDateTime,
pub state: DecisionState,
pub sequence: u64,
}Expand description
One authorization request, as this server decided about it.
Fields§
§request_uri: StringThe pushed request this decides. The record’s identity.
account: StringThe account the request named, resolved at PAR. Only this account may see, approve or decline the record.
client_origin: StringWhere the client served its metadata document from — scheme, host and
port of client_id, which is the only part of it that is a fact
about the world.
client_key: ClientKeyThe content key of that document; see
crate::oauth::client_metadata::ClientKey.
first_time: boolWhether this account has not approved a request from this client key since this server started. Held in memory only, and forgotten wholesale once this server has recorded more approvals than it keeps track of — which makes every client look new again, the direction that fails safe.
Always true for a client at the local origin
(didbot_pds::policy::is_local_origin). Any process on that
client’s machine can send the same client_id, so an earlier
approval says nothing about who sent this one.
client_self: ClientSelfThe client’s own copy of its name, home page and logo. Logged, never
serialized; see ClientSelf.
requested: ScopeSetThe scope the client asked for.
verdict: VerdictWhat this server decided.
token: Option<ConsentReference>The one-time reference the named account approves or declines with.
The same ConsentReference plan/oauth.md’s consent seam already
mints, reused rather than joined by a second credential. Absent when
the verdict is Verdict::Deny: there is nothing to approve, so
nothing is minted that could approve it.
created_at: OffsetDateTimeWhen this record was minted.
expires_at: OffsetDateTimeWhen it stops being answerable — the pushed request’s own expiry, which is always sooner than the consent reference’s, so this is the deadline that binds.
state: DecisionStateWhere it is in its life; see DecisionState.
sequence: u64Where it sits in this store’s arrival order, for the long poll’s
cursor. Assigned by DecisionStore::put.
Implementations§
Source§impl DecisionRecord
impl DecisionRecord
Sourcepub fn granted(&self) -> ScopeSet
pub fn granted(&self) -> ScopeSet
What the ceiling granted of the request when this record was minted.
Sourcepub fn is_live(&self, now: OffsetDateTime) -> bool
pub fn is_live(&self, now: OffsetDateTime) -> bool
Whether this record is still answerable at now.
Sourcepub fn to_json(&self) -> Value
pub fn to_json(&self) -> Value
The record as the daemon and the consent page read it.
ClientSelf is not in here, and must not be: see this module’s doc
and plan/app-allowlist.md.
Trait Implementations§
Source§impl Clone for DecisionRecord
impl Clone for DecisionRecord
Source§fn clone(&self) -> DecisionRecord
fn clone(&self) -> DecisionRecord
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DecisionRecord
impl RefUnwindSafe for DecisionRecord
impl Send for DecisionRecord
impl Sync for DecisionRecord
impl Unpin for DecisionRecord
impl UnsafeUnpin for DecisionRecord
impl UnwindSafe for DecisionRecord
Blanket Implementations§
§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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 more