pub struct ProviderDescriptorBuilder {
pub id: ProviderId,
pub authorization_endpoint: Option<Url>,
pub token_endpoint: Option<Url>,
pub revocation_endpoint: Option<Url>,
pub supported_grants: SupportedGrants,
pub preferred_client_auth_method: ClientAuthMethod,
pub quirks: ProviderQuirks,
}Expand description
Builder for ProviderDescriptor values.
Fields§
§id: ProviderIdIdentifier for the descriptor being constructed.
Optional authorization endpoint (required for Authorization Code flows).
token_endpoint: Option<Url>Token endpoint used for exchanges and refreshes.
revocation_endpoint: Option<Url>Optional revocation endpoint.
supported_grants: SupportedGrantsGrants enabled for the provider.
preferred_client_auth_method: ClientAuthMethodPreferred client authentication method for the token endpoint.
quirks: ProviderQuirksProvider-specific quirks.
Implementations§
Source§impl ProviderDescriptorBuilder
impl ProviderDescriptorBuilder
Sourcepub fn new(id: ProviderId) -> Self
pub fn new(id: ProviderId) -> Self
Creates a new builder seeded with the provided identifier.
Sets the authorization endpoint.
Sourcepub fn token_endpoint(self, url: Url) -> Self
pub fn token_endpoint(self, url: Url) -> Self
Sets the token endpoint.
Sourcepub fn revocation_endpoint(self, url: Url) -> Self
pub fn revocation_endpoint(self, url: Url) -> Self
Sets the optional revocation endpoint.
Sourcepub fn support_grant(self, grant: GrantType) -> Self
pub fn support_grant(self, grant: GrantType) -> Self
Marks a single grant type as supported.
Sourcepub fn support_grants<I>(self, grants: I) -> Selfwhere
I: IntoIterator<Item = GrantType>,
pub fn support_grants<I>(self, grants: I) -> Selfwhere
I: IntoIterator<Item = GrantType>,
Marks multiple grants as supported.
Sourcepub fn preferred_client_auth_method(self, method: ClientAuthMethod) -> Self
pub fn preferred_client_auth_method(self, method: ClientAuthMethod) -> Self
Overrides the preferred client authentication method.
Sourcepub fn quirks(self, quirks: ProviderQuirks) -> Self
pub fn quirks(self, quirks: ProviderQuirks) -> Self
Overrides the provider quirks.
Sourcepub fn build(self) -> Result<ProviderDescriptor, ProviderDescriptorError>
pub fn build(self) -> Result<ProviderDescriptor, ProviderDescriptorError>
Consumes the builder and validates the resulting descriptor.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ProviderDescriptorBuilder
impl RefUnwindSafe for ProviderDescriptorBuilder
impl Send for ProviderDescriptorBuilder
impl Sync for ProviderDescriptorBuilder
impl Unpin for ProviderDescriptorBuilder
impl UnwindSafe for ProviderDescriptorBuilder
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