Skip to main content

RegistrationConfig

Struct RegistrationConfig 

Source
#[non_exhaustive]
pub struct RegistrationConfig { pub registration_endpoint: Option<String>, pub allowed_grant_types: Vec<GrantType>, pub allowed_scopes: ScopeSet, pub client_secret_ttl: Option<Duration>, pub management_enabled: bool, }
Expand description

What dynamic registration is allowed to produce here. Held behind crate::server::ServerConfig::registration, which is None (registration off) by default.

Every bound below is a CEILING on what an anonymous, or merely policy-approved, registrant can obtain. The defaults are the narrow ones on purpose; see RegistrationConfig::new. #[non_exhaustive]: this struct’s field set VARIES WITH CARGO FEATURES, so a host that writes a full struct literal has a build that breaks the day anything in their dependency graph enables a feature they did not ask for. Construct with new() and assign the fields you want. This is the one attribute on this type that cannot be added after publication, because by then somebody’s struct literal is in production.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§registration_endpoint: Option<String>

RFC 8414 section 2 registration_endpoint. None derives {issuer}/register.

§allowed_grant_types: Vec<GrantType>

The grants a registration may ask for. Anything outside this list is invalid_client_metadata.

§allowed_scopes: ScopeSet

The ceiling on a registration’s scope. A request outside it is invalid_client_metadata; the default is EMPTY, so a host must say what a registrant may reach.

§client_secret_ttl: Option<Duration>

How long an issued client secret lives. None (the default) means it never expires, which is what client_secret_expires_at: 0 says on the wire (RFC 7591 section 3.2.1).

§management_enabled: bool

Whether RFC 7592 read, update and delete are offered at all. true by default: a client that can be created and never corrected or deleted leaves the host doing registration lifecycle by hand.

Implementations§

Source§

impl RegistrationConfig

Source

pub fn new() -> Self

The narrow defaults: the authorization code grant with refresh, no scopes, management on.

client_credentials and the device grant are deliberately absent. A client_credentials registration mints tokens with NO resource owner anywhere in the picture, so an open registration endpoint that grants it is an open token endpoint; the device grant makes the registrant able to allocate user codes, which RFC 8628 section 5.1 says are only adequate in combination with rate limiting. Both are one line for a host to add, with its eyes open.

Source

pub fn endpoint(&self, issuer: &str) -> String

The advertised registration endpoint for issuer.

Trait Implementations§

Source§

impl Clone for RegistrationConfig

Source§

fn clone(&self) -> RegistrationConfig

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 RegistrationConfig

Source§

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

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

impl Default for RegistrationConfig

Source§

fn default() -> Self

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

impl Eq for RegistrationConfig

Source§

impl PartialEq for RegistrationConfig

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RegistrationConfig

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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.