pub struct CodexAuth {
pub mode: AuthMode,
/* private fields */
}
Fields§
§mode: AuthMode
Implementations§
Source§impl CodexAuth
impl CodexAuth
pub fn from_api_key(api_key: &str) -> Self
pub async fn refresh_token(&self) -> Result<String, Error>
Sourcepub fn from_codex_home(
codex_home: &Path,
preferred_auth_method: AuthMode,
) -> Result<Option<CodexAuth>>
pub fn from_codex_home( codex_home: &Path, preferred_auth_method: AuthMode, ) -> Result<Option<CodexAuth>>
Loads the available auth information from the auth.json or OPENAI_API_KEY environment variable.
pub async fn get_token_data(&self) -> Result<TokenData, Error>
pub async fn get_token(&self) -> Result<String, Error>
pub fn get_account_id(&self) -> Option<String>
pub fn get_plan_type(&self) -> Option<String>
Sourcepub fn create_dummy_chatgpt_auth_for_testing() -> Self
pub fn create_dummy_chatgpt_auth_for_testing() -> Self
Consider this private to integration tests.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CodexAuth
impl RefUnwindSafe for CodexAuth
impl Send for CodexAuth
impl Sync for CodexAuth
impl Unpin for CodexAuth
impl UnwindSafe for CodexAuth
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