#[non_exhaustive]pub struct TdmGrant {
pub agree_env_var: String,
pub agreed_at: DateTime<Utc>,
}Expand description
A successful TDM grant.
Carries the validated API key (docs/CAPABILITY.md §1) so that the key
flows from the startup capability gate into the source, rather than each
TDM source re-reading the env var at fetch time (issue #153 — an env
mutation between startup and fetch is otherwise undetectable).
The api_key field exists only when at least one tdm-* Cargo feature
is compiled in (the secrecy dependency is optional = true and gated
on those features per ADR-0002, so default release binaries contain no
TDM code path at all). The struct is #[non_exhaustive]; the
tdm-*-gated api_key field is therefore additive, not breaking, for
builds that toggle the feature set.
docs/CAPABILITY.md §1 specifies the type as Secret<String>; that is
the secrecy 0.9 spelling. The workspace pins secrecy 0.10, whose
equivalent owned-string secret type is secrecy::SecretString
(= SecretBox<str>). CAPABILITY.md §1 has been updated to match the
0.10 API. Debug redacts the value.
Implements Default so in-crate test fixtures using
TdmGrant { agree_env_var: ..., ..Default::default() } keep compiling;
the default api_key is an empty secret.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.agree_env_var: StringWhich env var the user used to acknowledge the publisher’s ToS.
agreed_at: DateTime<Utc>When the agreement env var was first observed at startup.