Skip to main content

ClientMetadata

Struct ClientMetadata 

Source
pub struct ClientMetadata {
    pub redirect_uris: Vec<String>,
    pub token_endpoint_auth_method: Option<String>,
    pub grant_types: Option<Vec<String>>,
    pub response_types: Option<Vec<String>>,
    pub client_name: Option<String>,
    pub scope: Option<String>,
    pub software_statement: Option<String>,
}
Expand description

RFC 7591 section 2 client metadata: the registration request body, and the echoed half of the section 3.2.1 client information response.

Only the members this server actually acts on are modelled. RFC 7591 section 2 requires a server to IGNORE metadata it does not understand, which is what serde’s default handling of unknown fields does here, so a client that sends logo_uri is not refused for it.

Fields§

§redirect_uris: Vec<String>

Redirection URIs (RFC 6749 section 3.1.2). REQUIRED for a client registering the authorization code grant, since that grant has nowhere to deliver a code without one.

§token_endpoint_auth_method: Option<String>

How the client will authenticate at the token endpoint. Omitted means client_secret_basic, which is the default RFC 7591 section 2 states.

§grant_types: Option<Vec<String>>

The grants this client will use. OMITTED (None) means ["authorization_code"] (section 2), which is why this is an Option rather than a Vec that is empty when absent: section 2 gives omission a meaning, and an explicitly empty list means the opposite of that meaning. Collapsing the two would make {"grant_types": []} silently register the authorization code grant.

§response_types: Option<Vec<String>>

The authorization response types this client will use. Omitted (None) means ["code"] (section 2); see ClientMetadata::grant_types for why this is an Option.

§client_name: Option<String>

Human-readable name, shown to a resource owner. ATTACKER-CHOSEN when registration is open: it is echoed into this crate’s device verification page, which escapes it, and any host consent screen must do the same.

§scope: Option<String>

The space-delimited scope list (RFC 6749 section 3.3) this client may request.

§software_statement: Option<String>

RFC 7591 section 2.3. NOT evaluated by this server, and its presence is a refusal rather than an omission: see the module docs.

Trait Implementations§

Source§

impl Clone for ClientMetadata

Source§

fn clone(&self) -> ClientMetadata

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ClientMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ClientMetadata

Source§

fn default() -> ClientMetadata

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ClientMetadata

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ClientMetadata

Source§

impl PartialEq for ClientMetadata

Source§

fn eq(&self, other: &ClientMetadata) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ClientMetadata

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ClientMetadata

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
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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.