pub enum SecretRef {
Env {
env_var: String,
},
SecretsManager {
sm_path: String,
sm_json_path: Option<String>,
},
PlaintextDev {
plaintext_dev: String,
},
OAuthConfigDir {
dir: String,
},
Keychain {
service: String,
account: String,
},
}Expand description
Provider-specific credential reference. Stored as JSON in
db_accounts.secret_ref. backend is the discriminator.
The actual secret value is NEVER stored in the DB — only how to
look it up at launch time (env var, secrets-manager path, etc.).
PlaintextDev exists for local dev convenience and must never be
the default path in production builds.
Variants§
Env
SecretsManager
PlaintextDev
OAuthConfigDir
OAuth credentials stored as a filesystem pointer. The CLI
(Claude Code, codex, openclaw, …) reads its OAuth tokens from
this directory at spawn time — agentmux only holds the path,
never the tokens themselves. Token refresh is the CLI’s job;
the path stays stable across refreshes. Used by oauth-class
providers; the resolver (PR B) dispatches to a config-dir
env-var injection mode rather than the api-key env-var path.
See docs/specs/archive/SPEC_OAUTH_IDENTITY_BUNDLES_2026_05_22.md.
Explicit rename — the enum-wide rename_all = "snake_case" splits
at every capital letter, including inside “OAuth” itself, producing
o_auth_config_dir (verified: that’s what a live deserialization
failure actually expected). Every real account on disk was written
with oauth_config_dir (no extra underscore — how “OAuth” is
conventionally spelled), so the derived name silently stopped
matching stored data — this makes the wire format explicit instead
of relying on the derive macro to guess right for an acronym.
The alias keeps accepting the derive-produced o_auth_config_dir
tag too: any account persisted by a backend running between this
variant’s introduction and this fix would have round-tripped
self-consistently under that buggy tag, and identity_list() aborts
entirely on the first unparseable row — so dropping read support for
it would just move the “My Agents empty” incident to a different set
of accounts. Serialization always writes the canonical
oauth_config_dir; only deserialization accepts both.
ts-rs does NOT pick up the serde(rename) above — it emits the
derive-default o_auth_config_dir, i.e. exactly the legacy tag this
rename exists to stop writing. Without the ts(rename) below, the
generated binding would tell the frontend to discriminate on a tag the
server never serializes, silently reintroducing the “My Agents empty”
incident described above. No CI gate catches this: tsc passes (the
union simply never matches at runtime) and check-rpc-bindings passes
(the type exists and is current).
Fields
Keychain
API key / token stored in the OS-native secret store (macOS
Keychain / Windows Credential Manager / Linux Secret Service),
addressed by (service, account). The plaintext is NEVER held in
the DB — only this pointer. Written by the account key flow
after a successful live validation; resolved to the real value at
agent spawn time via crate::identity::secret_store. See
docs/specs/archive/SPEC_TRUST_CENTER_2026_06_15.md §7/§12.2.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SecretRef
impl<'de> Deserialize<'de> for SecretRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for SecretRef
impl StructuralPartialEq for SecretRef
Source§impl TS for SecretRef
impl TS for SecretRef
Source§type WithoutGenerics = SecretRef
type WithoutGenerics = SecretRef
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or (). The only requirement for these dummy types is that
EXPORT_TO must be None. Read moreSource§type OptionInnerType = SecretRef
type OptionInnerType = SecretRef
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete(cfg: &Config) -> String
fn decl_concrete(cfg: &Config) -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl(cfg: &Config) -> String
fn decl(cfg: &Config) -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline(cfg: &Config) -> String
fn inline(cfg: &Config) -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened(cfg: &Config) -> String
fn inline_flattened(cfg: &Config) -> String
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported, relative to the output directory.
The returned path does not include any base directory. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
§fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
fn dependencies(cfg: &Config) -> Vec<Dependency>where
Self: 'static,
§fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export_all]. Read more§fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
fn export_all(cfg: &Config) -> Result<(), ExportError>where
Self: 'static,
TS::export]. Read moreAuto Trait Implementations§
impl Freeze for SecretRef
impl RefUnwindSafe for SecretRef
impl Send for SecretRef
impl Sync for SecretRef
impl Unpin for SecretRef
impl UnsafeUnpin for SecretRef
impl UnwindSafe for SecretRef
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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