Expand description
Host side of act:credentials/store.
Session handling lives here rather than in the transports so both MCP and
HTTP get identical behaviour; runtime/sessions.rs is the single point both
already pass through.
§Two layers, on purpose
CredentialHost is synchronous, owns no wasmtime types, and is the whole
of the credential logic: compartment projection, session liveness, the audit
record. It is unit-testable against a real store with no engine, no linker
and no guest.
Around it sits the generated-trait bridge. act:credentials/store’s two
functions are async func in WIT, so bindgen lowers them through
func_wrap_concurrent: the generated HostWithStore<T> methods are
associated functions taking a wasmtime::component::Accessor, not methods on &self, and
the impl target is the HasData marker rather than HostState. The bridge
reaches host state through the accessor, resolves the capability decision
(which may await a human), and then calls the synchronous host. Nothing
about the credential logic itself has to be written twice, or written async.
Structs§
- Credential
Host - Refresh
Request - What the runtime knows and a refresher needs.
- Refreshed
- What a renewal produced.
Enums§
- Host
Error - Why the host refused, in the terms
CredentialHostcan decide in. Maps onto the WITsecret-errorvariants and nothing else, through this type’s privateto_wit.
Traits§
- Credential
Refresher - How a credential too close to expiry is renewed.
Functions§
- add_
to_ linker - Register both
act:credentialsinstances in the linker. - backend_
root - The directory a
BackendChoicelives in. Amatchrather than an irrefutablelet, so a second variant is a compile error here instead of a silent assumption at every call site. - default_
store_ root - Where the file backend lives when the operator has not named one.
- issuer_
slot - Where the issuer of a
std:oauth2field is kept, alongside its refresh token:<field key>:std:issuerand<field key>:std:refresh-token. - refresh_
token_ slot - resolve_
backend - Parse
--credentials-backend, or fall back todefault_store_root.