pub struct PublishedAtprotoKeys { /* private fields */ }Expand description
A small, authority-checked set of verification keys from a DID document:
exactly one active #atproto slot and at most one bounded drain and lead
slot. Unknown DID verification methods are intentionally ignored.
Implementations§
Source§impl PublishedAtprotoKeys
impl PublishedAtprotoKeys
pub const MAX_SLOTS: usize = 3
Sourcepub fn single(key: VerifyingKey) -> Self
pub fn single(key: VerifyingKey) -> Self
Wrap a trusted single current key for existing resolver implementations.
Sourcepub fn from_published_slots(
active: VerifyingKey,
drain: Option<(VerifyingKey, i64, i64)>,
lead: Option<(VerifyingKey, i64, i64)>,
) -> Result<Self>
pub fn from_published_slots( active: VerifyingKey, drain: Option<(VerifyingKey, i64, i64)>, lead: Option<(VerifyingKey, i64, i64)>, ) -> Result<Self>
Construct the same bounded authority that a root DID document publishes.
This is for local resolvers whose trusted publication source is the
rotation store that feeds that document; remote resolvers must parse the
resolved DID document with Self::from_did_document.
pub fn live_keys(&self, now: i64) -> impl Iterator<Item = &VerifyingKey>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn from_did_document(doc: &Value, expected_did: &str) -> Result<Self>
pub fn from_did_document(doc: &Value, expected_did: &str) -> Result<Self>
Parse the active and bounded overlap slots from a resolved DID document.
Every recognised slot must have the expected full id, controller and
Multikey type; duplicates and malformed bounds fail closed.
Trait Implementations§
Source§impl Clone for PublishedAtprotoKeys
impl Clone for PublishedAtprotoKeys
Source§fn clone(&self) -> PublishedAtprotoKeys
fn clone(&self) -> PublishedAtprotoKeys
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PublishedAtprotoKeys
impl RefUnwindSafe for PublishedAtprotoKeys
impl Send for PublishedAtprotoKeys
impl Sync for PublishedAtprotoKeys
impl Unpin for PublishedAtprotoKeys
impl UnsafeUnpin for PublishedAtprotoKeys
impl UnwindSafe for PublishedAtprotoKeys
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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§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,
Apply a transformation to the response body. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more