pub struct ClientMetadataDocument {
pub client_id: String,
pub application_type: ApplicationType,
pub client_name: Option<String>,
pub client_uri: Option<String>,
pub logo_uri: Option<String>,
pub redirect_uris: Vec<String>,
pub grant_types: Vec<String>,
pub response_types: Vec<String>,
pub authentication: ClientAuthentication,
pub scope: Option<String>,
pub dpop_bound_access_tokens: bool,
}Expand description
A validated client metadata document.
Reduced to the fields this server’s endpoints and plan/app-allowlist.md
need. plan/app-allowlist.md also asks that client_name, client_uri
and logo_uri be recorded and never displayed, since showing an
untrusted client’s own self-description to anyone is how impersonation
works — this server has no human to show them to, so that requirement is
met by construction, and they are kept here only for the log line that
records them.
Fields§
§client_id: StringMust equal the URL it was fetched from; checked in validate.
application_type: ApplicationTypeWhat kind of client this is, which decides the redirects it may
register. Left out of the content key when it is the default, so a
document that says web and one that says nothing hash alike.
client_name: Option<String>The applicant’s own name for itself. Never displayed; see the module doc.
client_uri: Option<String>The applicant’s own homepage. Never displayed.
logo_uri: Option<String>The applicant’s own logo. Never displayed.
redirect_uris: Vec<String>Where an authorization code may be delivered. Never empty after validation.
grant_types: Vec<String>OAuth grant types this client uses. Defaults to
["authorization_code"] when absent.
response_types: Vec<String>OAuth response types this client uses. Defaults to ["code"].
authentication: ClientAuthenticationHow this client authenticates at par and token; see
crate::oauth::client_auth.
scope: Option<String>The scope this client declares it may ask for, if it published one.
dpop_bound_access_tokens: boolMust be true: the atproto OAuth profile requires every access token
to be DPoP-bound, and a client that has not opted into that is not
one this server’s tokens can be issued to.
Implementations§
Source§impl ClientMetadataDocument
impl ClientMetadataDocument
Sourcepub fn admits_redirect_uri(&self, requested: &str) -> bool
pub fn admits_redirect_uri(&self, requested: &str) -> bool
Whether a push may name requested as its redirect.
Exact, except for a loopback redirect (http://127.0.0.1 or
http://[::1]), which matches on everything but the port. A native
client listens on whatever port it is handed when it starts: RFC 8252
§7.3 says “the authorization server MUST allow any port to be
specified at the time of the request for loopback IP redirect URIs”,
and the atproto profile says of its loopback clients “Path components
must match, but port numbers are not matched.”
Trait Implementations§
Source§impl Clone for ClientMetadataDocument
impl Clone for ClientMetadataDocument
Source§fn clone(&self) -> ClientMetadataDocument
fn clone(&self) -> ClientMetadataDocument
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClientMetadataDocument
impl Debug for ClientMetadataDocument
Source§impl<'de> Deserialize<'de> for ClientMetadataDocument
impl<'de> Deserialize<'de> for ClientMetadataDocument
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>,
Source§impl PartialEq for ClientMetadataDocument
impl PartialEq for ClientMetadataDocument
Source§fn eq(&self, other: &ClientMetadataDocument) -> bool
fn eq(&self, other: &ClientMetadataDocument) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for ClientMetadataDocument
impl Serialize for ClientMetadataDocument
impl Eq for ClientMetadataDocument
impl StructuralPartialEq for ClientMetadataDocument
Auto Trait Implementations§
impl Freeze for ClientMetadataDocument
impl RefUnwindSafe for ClientMetadataDocument
impl Send for ClientMetadataDocument
impl Sync for ClientMetadataDocument
impl Unpin for ClientMetadataDocument
impl UnsafeUnpin for ClientMetadataDocument
impl UnwindSafe for ClientMetadataDocument
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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