pub struct Secret {
pub id: String,
pub host: String,
pub header: String,
pub source: Source,
pub plain_http: bool,
pub port: Option<u16>,
}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.
port: Option<u16>The port of the plain-HTTP requests that get the value, 1 to 65535;
80 when unset. A request to another port of the host keeps the
placeholder. Only with plain_http.
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 plain_http_port(&self) -> u16
pub fn plain_http_port(&self) -> u16
The port of the plain-HTTP requests the value goes into: port, or 80.
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.