nxd_core/ports/secrets.rs
1//! Secret-resolution port (binding references only; action-scoped).
2
3use crate::contract::SecretBinding;
4use zeroize::Zeroizing;
5
6/// Resolve/store/delete through the external secret executable for one action.
7///
8/// Implementations must not read ambient secret repositories or return values
9/// except for the supplied action identity.
10pub trait SecretsPort: Send + Sync {
11 fn resolve(&self, binding: &SecretBinding, action_id: &str)
12 -> Result<Zeroizing<Vec<u8>>, String>;
13
14 fn store(
15 &self,
16 binding: &SecretBinding,
17 action_id: &str,
18 value: &[u8],
19 allow_overwrite: bool,
20 ) -> Result<String, String>;
21
22 fn delete(&self, binding: &SecretBinding, action_id: &str) -> Result<String, String>;
23}