#[non_exhaustive]pub struct ProviderInfo {
pub provider_name: ProviderName,
pub display_name: &'static str,
pub button_class: &'static str,
pub icon_slug: &'static str,
pub button_color: Option<&'static str>,
pub button_hover_color: Option<&'static str>,
pub css_var_suffix: Option<&'static str>,
}Expand description
Public information about a single enabled OAuth2 provider.
Returned by enabled_providers. The
framework-integration crate (oauth2_passkey_axum) uses these fields to
render provider buttons without maintaining its own presentation table —
the source of truth lives on ProviderConfig inside this crate.
For generic OIDC slots (Custom{1..8}), display_name / button_class /
button_color / button_hover_color come from OAUTH2_CUSTOM{N}_* env
vars. For named providers they are compile-time literals.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.provider_name: ProviderNameProvider identifier used in URL routing (/oauth2/{provider_name}/),
DB rows (oauth2_accounts.provider), OAuth2 state (StateParams.provider),
and templates. E.g. "google", "auth0", or an operator-configured
value like "my-sso" for a custom slot.
display_name: &'static strHuman-readable label for login buttons (e.g. "Google", "Microsoft").
CSS classes for the login button (e.g. "btn-oauth2 btn-google").
icon_slug: &'static strSVG basename served under {O2P_ROUTE_PREFIX}/icons/{icon_slug}.svg.
Named providers use their own slug; custom slots use "openid" (the
neutral OpenID Connect mark).
Inline CSS background-color for the button. None for named
providers (colored via --o2p-<name> variables in the base CSS /
theme files). Some(color) for custom slots, injected via a
:root { --o2p-customN: ...; } block in the login template.
Inline CSS background-color for the :hover state. None for
named providers; Some(color) for custom slots.
css_var_suffix: Option<&'static str>Suffix used in the --o2p-{suffix} / --o2p-{suffix}-hover CSS
variables the login template injects for this provider. None for
named providers (styled via .btn-<name> rules + theme variables);
for custom slots this is "custom1".."custom8". The framework crate
uses this to build the :root { ... } block without re-parsing
button_class.
Trait Implementations§
Source§impl Clone for ProviderInfo
impl Clone for ProviderInfo
Source§fn clone(&self) -> ProviderInfo
fn clone(&self) -> ProviderInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ProviderInfo
impl RefUnwindSafe for ProviderInfo
impl Send for ProviderInfo
impl Sync for ProviderInfo
impl Unpin for ProviderInfo
impl UnsafeUnpin for ProviderInfo
impl UnwindSafe for ProviderInfo
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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