#[non_exhaustive]pub enum CredentialSource {
MacosKeychainPrimary,
MacosKeychainMultiAccount {
service: String,
mdat: Option<String>,
},
EnvDir {
path: PathBuf,
},
XdgConfig {
path: PathBuf,
},
ClaudeLegacy {
path: PathBuf,
},
}Expand description
Where resolve_credentials found the token.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
MacosKeychainPrimary
security find-generic-password -s "Claude Code-credentials".
MacosKeychainMultiAccount
security dump-keychain scan for
Claude Code-credentials<suffix> entries; newest mdat wins.
EnvDir
$CLAUDE_CONFIG_DIR/.credentials.json.
XdgConfig
$XDG_CONFIG_HOME/claude/.credentials.json (fallback to
~/.config/claude/.credentials.json).
ClaudeLegacy
~/.claude/.credentials.json (Claude Code’s legacy path).
Trait Implementations§
Source§impl Clone for CredentialSource
impl Clone for CredentialSource
Source§fn clone(&self) -> CredentialSource
fn clone(&self) -> CredentialSource
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 moreSource§impl Debug for CredentialSource
impl Debug for CredentialSource
Source§impl PartialEq for CredentialSource
impl PartialEq for CredentialSource
impl Eq for CredentialSource
impl StructuralPartialEq for CredentialSource
Auto Trait Implementations§
impl Freeze for CredentialSource
impl RefUnwindSafe for CredentialSource
impl Send for CredentialSource
impl Sync for CredentialSource
impl Unpin for CredentialSource
impl UnsafeUnpin for CredentialSource
impl UnwindSafe for CredentialSource
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.