#[non_exhaustive]pub struct OAuthConfig { /* private fields */ }Expand description
Ppoppo Accounts OAuth2 configuration.
Required fields are constructor parameters — no runtime “missing field” errors.
ⓘ
use ppoppo_sdk::OAuthConfig;
let config = OAuthConfig::new("my-client-id", "https://my-app.com/callback".parse()?);
// Optional overrides via chaining:
let config = config
.with_auth_url("https://custom.example.com/authorize".parse()?);Implementations§
Source§impl OAuthConfig
impl OAuthConfig
Sourcepub fn new(client_id: impl Into<String>, redirect_uri: Url) -> Self
pub fn new(client_id: impl Into<String>, redirect_uri: Url) -> Self
Create a new OAuth2 configuration.
Required fields are parameters — compile-time enforcement, no Result.
Sourcepub fn with_auth_url(self, url: Url) -> Self
pub fn with_auth_url(self, url: Url) -> Self
Override the PAS authorization endpoint.
Sourcepub fn with_token_url(self, url: Url) -> Self
pub fn with_token_url(self, url: Url) -> Self
Override the PAS token endpoint.
Sourcepub fn with_userinfo_url(self, url: Url) -> Self
pub fn with_userinfo_url(self, url: Url) -> Self
Override the PAS userinfo endpoint.
Sourcepub fn with_scopes(self, scopes: Vec<String>) -> Self
pub fn with_scopes(self, scopes: Vec<String>) -> Self
Override the OAuth2 scopes (default: ["profile"]).
Sourcepub fn userinfo_url(&self) -> &Url
pub fn userinfo_url(&self) -> &Url
User info endpoint URL.
Sourcepub fn redirect_uri(&self) -> &Url
pub fn redirect_uri(&self) -> &Url
OAuth2 redirect URI.
Trait Implementations§
Source§impl Clone for OAuthConfig
impl Clone for OAuthConfig
Source§fn clone(&self) -> OAuthConfig
fn clone(&self) -> OAuthConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for OAuthConfig
impl RefUnwindSafe for OAuthConfig
impl Send for OAuthConfig
impl Sync for OAuthConfig
impl Unpin for OAuthConfig
impl UnsafeUnpin for OAuthConfig
impl UnwindSafe for OAuthConfig
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