Skip to main content

Resolver

Struct Resolver 

Source
struct Resolver {
    inner: JacquardResolver<Client>,
}
Expand description

The identity resolution behind OperatorAuth.

jacquard-identity builds a did:web document URL by pasting the method-specific identifier after https://, so did:web:localhost%3A3415 becomes a request to a host literally named localhost%3A3415. atproto permits exactly that shape — a port, with its colon percent-encoded — for localhost and nowhere else, “only in testing and development”, and didbot_identity::did::AccountDid decodes it. This puts that answer in front of the library’s.

Only a DID that carries a port takes this path, and only a bare loopback hostname may carry one, so a deployment on a public zone never reaches it. Every such fetch is https:// like any other.

Fields§

§inner: JacquardResolver<Client>

Implementations§

Source§

impl Resolver

Source

fn new(http: Client) -> Self

Source

fn ported_document_url(&self, did: &str) -> Option<String>

Where did’s document is served, for a did:web this resolver reads itself rather than handing to the library.

Trait Implementations§

Source§

impl DpopExt for Resolver

§

fn dpop_server_call<'r, D>( &'r self, data_source: &'r mut D, ) -> DpopCall<'r, Self, D>
where Self: Sized, D: DpopDataSource,

Begin building a DPoP-protected request targeting an authorization server.
§

fn dpop_call<'r, N>(&'r self, data_source: &'r mut N) -> DpopCall<'r, Self, N>
where Self: Sized, N: DpopDataSource,

Begin building a DPoP-protected request targeting a resource server.
Source§

impl HttpClient for Resolver

Source§

type Error = IdentityError

Error type returned by the HTTP client
Source§

async fn send_http( &self, request: Request<Vec<u8>>, ) -> Result<Response<Vec<u8>>, Self::Error>

Send an HTTP request and return the response.
Source§

impl IdentityResolver for Resolver

Source§

fn options(&self) -> &ResolverOptions

Access options for validation decisions in default methods
Source§

async fn resolve_handle<S: BosStr + Sync>( &self, handle: &Handle<S>, ) -> Result<Did>

Resolve handle
Source§

async fn resolve_did_doc<S: BosStr + Sync>( &self, did: &Did<S>, ) -> Result<DidDocResponse>

Resolve DID document
§

fn resolve_ident<S>( &self, actor: &AtIdentifier<S>, ) -> impl Future<Output = Result<DidDocResponse, IdentityError>> + Send
where S: BosStr + Sync, Self: Sync,

Resolve DID doc from an identifier
§

fn resolve_ident_owned<S>( &self, actor: &AtIdentifier<S>, ) -> impl Future<Output = Result<DidDocument, IdentityError>> + Send
where S: BosStr + Sync, Self: Sync,

Resolve DID doc from an identifier
§

fn resolve_did_doc_owned<S>( &self, did: &Did<S>, ) -> impl Future<Output = Result<DidDocument, IdentityError>> + Send
where S: BosStr + Sync, Self: Sync,

Resolve the DID document and return an owned version
§

fn pds_for_did<S>( &self, did: &Did<S>, ) -> impl Future<Output = Result<Uri<String>, IdentityError>> + Send
where S: BosStr + Sync, Self: Sync,

Return the PDS url for a DID
§

fn pds_for_handle<S>( &self, handle: &Handle<S>, ) -> impl Future<Output = Result<(Did, Uri<String>), IdentityError>> + Send
where S: BosStr + Sync, Self: Sync,

Return the DID and PDS url for a handle
Source§

impl OAuthResolver for Resolver

§

fn verify_issuer<S>( &self, server_metadata: &OAuthAuthorizationServerMetadata, sub: &Did<S>, ) -> impl Future<Output = Result<Uri<String>, ResolverError>> + Send
where S: BosStr + Sync, Self: Sync,

Verify that the authorization server in server_metadata is the correct issuer for sub.
§

fn resolve_oauth( &self, input: &str, ) -> impl Future<Output = Result<(OAuthAuthorizationServerMetadata, Option<DidDocument>), ResolverError>> + Send
where Self: Sync,

Resolve input (a handle, DID, PDS URL, or entryway URL) to OAuth metadata. Read more
§

fn resolve_from_service( &self, input: &str, ) -> impl Future<Output = Result<OAuthAuthorizationServerMetadata, ResolverError>> + Send
where Self: Sync,

Resolve a service URL (PDS or entryway) to its authorization server metadata. Read more
§

fn resolve_from_identity( &self, input: &str, ) -> impl Future<Output = Result<(OAuthAuthorizationServerMetadata, DidDocument), ResolverError>> + Send
where Self: Sync,

Resolve an AT identifier (handle or DID) to its authorization server metadata and DID document.
§

fn get_authorization_server_metadata( &self, issuer: &str, ) -> impl Future<Output = Result<OAuthAuthorizationServerMetadata, ResolverError>> + Send
where Self: Sync,

Fetch and validate the authorization server metadata for the given issuer URL. Read more
§

fn get_resource_server_metadata( &self, pds: &str, ) -> impl Future<Output = Result<OAuthAuthorizationServerMetadata, ResolverError>> + Send
where Self: Sync,

Resolve a PDS base URL to its authorization server metadata.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> XrpcExt for T
where T: HttpClient,

§

fn xrpc<'a>(&'a self, base: Uri<&'a str>) -> XrpcCall<'a, Self>
where Self: Sized,

Start building an XRPC call for the given base URI.
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,