pub struct AccountIdentity {
pub source: String,
pub credential: String,
pub identity_fp: String,
}Expand description
Namespace of one kept account. Every field is non-secret display text.
Fields§
§source: StringBroker source: local:<auth.json path> or remote:<endpoint>.
credential: StringStorage key: provider or provider@label.
identity_fp: StringProvider-side identity fingerprint: a strong seat:<digest> (see
AccountIdentity::seat_fingerprint) or a weak preview from
AccountIdentity::fingerprint. Only a strong fingerprint is an
identity; a weak one is a discriminator for read-only tracking.
Implementations§
Source§impl AccountIdentity
impl AccountIdentity
Sourcepub fn key(&self) -> String
pub fn key(&self) -> String
Map key. Changing any component yields a fresh state entry.
With a strong seat fingerprint the key is canonical across
aliases (source|provider|seat:…, the label is not part of it), so
two labels pointing at one provider seat share ONE attempt ledger and
a sequential alias switch can never spend a second activation on the
same generation. With a weak fingerprint the key stays label-scoped.
Sourcepub fn ledger_scope(&self) -> String
pub fn ledger_scope(&self) -> String
The credential component of the key: the provider alone for a strong
seat identity, the full provider@label otherwise.
Sourcepub fn is_strong(&self) -> bool
pub fn is_strong(&self) -> bool
Whether this identity is a full provider seat identity (established from the credential itself), as opposed to a metadata preview.
Sourcepub fn seat_fingerprint(
provider: OAuthProviderId,
account_id: &str,
) -> Option<String>
pub fn seat_fingerprint( provider: OAuthProviderId, account_id: &str, ) -> Option<String>
Strong seat fingerprint from the FULL provider account id carried by
the credential (e.g. the Codex chatgpt_account_id claim of the token
the broker vends for exactly this slot). Same recipe as the broker’s
listed AccountSummary::seat_fingerprint
(super::seat_fingerprint), so a listing value and a token-derived
value compare equal. Digest only — the state file never stores the
id itself. None for an empty id.
Sourcepub fn strong_from_listed(listed: impl AsRef<str>) -> String
pub fn strong_from_listed(listed: impl AsRef<str>) -> String
Wrap a broker-listed seat fingerprint as a strong identity value.
Sourcepub fn fingerprint(
account_id_prefix: Option<&str>,
identity: Option<&str>,
added_at: Option<u64>,
) -> String
pub fn fingerprint( account_id_prefix: Option<&str>, identity: Option<&str>, added_at: Option<u64>, ) -> String
WEAK fingerprint from non-secret provider metadata. Prefers the
provider account-id prefix, then a hash of the identity string, then
the login time. Providers exposing none of these yield unknown,
which is reported so the operator knows re-login inheritance is
possible. A prefix is not an identity: activation requires
seat_fingerprint.
Trait Implementations§
Source§impl Clone for AccountIdentity
impl Clone for AccountIdentity
Source§fn clone(&self) -> AccountIdentity
fn clone(&self) -> AccountIdentity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AccountIdentity
impl Debug for AccountIdentity
Source§impl<'de> Deserialize<'de> for AccountIdentity
impl<'de> Deserialize<'de> for AccountIdentity
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<AccountIdentity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<AccountIdentity, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for AccountIdentity
Source§impl Ord for AccountIdentity
impl Ord for AccountIdentity
Source§fn cmp(&self, other: &AccountIdentity) -> Ordering
fn cmp(&self, other: &AccountIdentity) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for AccountIdentity
impl PartialEq for AccountIdentity
Source§impl PartialOrd for AccountIdentity
impl PartialOrd for AccountIdentity
Source§impl Serialize for AccountIdentity
impl Serialize for AccountIdentity
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for AccountIdentity
Auto Trait Implementations§
impl Freeze for AccountIdentity
impl RefUnwindSafe for AccountIdentity
impl Send for AccountIdentity
impl Sync for AccountIdentity
impl Unpin for AccountIdentity
impl UnsafeUnpin for AccountIdentity
impl UnwindSafe for AccountIdentity
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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
key and return true if they are equal.