pub struct Secret {
pub id: String,
pub host: String,
pub header: String,
pub source: Source,
pub plain_http: bool,
}Expand description
One brokered secret. Its Debug output names only the id: where the value
lives and where it goes say which secrets exist.
Fields§
§id: StringStable identifier: lowercase letters, digits and -. It names the
placeholder and appears in audit rows; the value never does.
host: StringThe one host (a lowercase DNS name or IPv4 literal, no pattern) whose requests receive the secret.
header: StringThe request header the secret goes in (Authorization, X-Api-Key).
source: SourceWhere OpenMoat reads the value, written { env: NAME } and so on.
plain_http: boolAlso inject into plain-HTTP requests, which carry the value in clear text. Off unless set: without it a plain-HTTP request keeps the placeholder.
Implementations§
Source§impl Secret
impl Secret
Sourcepub fn placeholder(&self) -> String
pub fn placeholder(&self) -> String
What the agent holds instead of the value: moat-secret:<id>:placeholder.
Ids cannot contain :, so no placeholder occurs inside another.
Sourcepub fn is_loopback(&self) -> bool
pub fn is_loopback(&self) -> bool
True when the host is this machine: localhost, a name under it, or
127.0.0.0/8. Hosts are validated lowercase DNS names or IPv4. The
address type comes from core, which parses and does no I/O.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Secret
impl<'de> Deserialize<'de> for Secret
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 Secret
impl StructuralPartialEq for Secret
Auto Trait Implementations§
impl Freeze for Secret
impl RefUnwindSafe for Secret
impl Send for Secret
impl Sync for Secret
impl Unpin for Secret
impl UnsafeUnpin for Secret
impl UnwindSafe for Secret
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>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.