pub struct ProviderAuthService { /* private fields */ }Implementations§
Source§impl ProviderAuthService
impl ProviderAuthService
pub fn new(config_dir: &Path) -> Self
pub fn store(&self) -> &ProviderAuthStore
pub async fn load_profiles(&self) -> Result<ProviderAuthProfilesData>
pub async fn store_openai_codex_tokens( &self, profile_name: &str, token_set: ProviderTokenSet, ) -> Result<ProviderAuthProfile>
pub async fn store_oauth_profile( &self, provider: &str, profile_name: &str, state: OAuthProfileState, set_active: bool, ) -> Result<ProviderAuthProfile>
pub async fn get_profile( &self, provider: &str, profile_override: Option<&str>, ) -> Result<Option<ProviderAuthProfile>>
pub async fn get_active_profile( &self, provider: &str, ) -> Result<Option<ProviderAuthProfile>>
pub async fn get_provider_bearer_token( &self, provider: &str, profile_override: Option<&str>, ) -> Result<Option<String>>
pub async fn get_valid_openai_codex_access_token( &self, profile_override: Option<&str>, ) -> Result<Option<String>>
pub async fn refresh_openai_codex_tokens( &self, profile_override: Option<&str>, ) -> Result<ProviderAuthProfile>
pub async fn refresh_oauth_profile( &self, provider: &str, profile_override: Option<&str>, token_manager: &dyn OAuthTokenManager, ) -> Result<ProviderAuthProfile>
pub async fn set_active_profile( &self, provider: &str, profile_name: &str, ) -> Result<String>
pub async fn remove_profile( &self, provider: &str, profile_name: &str, ) -> Result<bool>
Trait Implementations§
Source§impl Clone for ProviderAuthService
impl Clone for ProviderAuthService
Source§fn clone(&self) -> ProviderAuthService
fn clone(&self) -> ProviderAuthService
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 ProviderAuthService
impl !RefUnwindSafe for ProviderAuthService
impl Send for ProviderAuthService
impl Sync for ProviderAuthService
impl Unpin for ProviderAuthService
impl UnsafeUnpin for ProviderAuthService
impl !UnwindSafe for ProviderAuthService
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
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>
Converts
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>
Converts
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