pub trait HostWithStore<T>: HasData + Send {
// Required methods
fn list_secrets(
accessor: &Accessor<T, Self>,
session: Option<String>,
) -> impl Future<Output = Result<Vec<SecretInfo>, SecretError>> + Send;
fn get_secret(
accessor: &Accessor<T, Self>,
session: String,
want: SecretRequest,
) -> impl Future<Output = Result<Secret, SecretError>> + Send;
}Required Methods§
Sourcefn list_secrets(
accessor: &Accessor<T, Self>,
session: Option<String>,
) -> impl Future<Output = Result<Vec<SecretInfo>, SecretError>> + Send
fn list_secrets( accessor: &Accessor<T, Self>, session: Option<String>, ) -> impl Future<Output = Result<Vec<SecretInfo>, SecretError>> + Send
Enumerate the credentials this component may ask for, without their material.
session, when present, must name a live session — it is checked,
not used to narrow the result. There is no per-session compartment:
the listing covers this component’s whole profile either way.
Components use this to discover which keys exist before requesting
one, so a missing credential is a first-class answer rather than a
failed call.
Sourcefn get_secret(
accessor: &Accessor<T, Self>,
session: String,
want: SecretRequest,
) -> impl Future<Output = Result<Secret, SecretError>> + Send
fn get_secret( accessor: &Accessor<T, Self>, session: String, want: SecretRequest, ) -> impl Future<Output = Result<Secret, SecretError>> + Send
Request one credential.
session names the session the request is made under. It does NOT
select which credentials are visible: the compartment is the calling
component’s profile, and that is the boundary the design rests on. The
session bounds the credential’s lifetime and anchors the audit record,
and the host rejects an id it did not issue with invalid-session.
The host MAY prompt, MAY refuse, and MUST record the request in the
audit trail. Returned material is never logged.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".