Package io.jenkins.plugins.configsplice
Class ResolvedValue
java.lang.Object
io.jenkins.plugins.configsplice.ResolvedValue
- All Implemented Interfaces:
Serializable
A replacement value in flight, carried so that accidental string conversion cannot expose it.
Gate 2 measured two things that force this type to exist (ADR-003):
Secret.toString()returns the plaintext, so"value=" + secretleaks. The rule "never log a value" cannot be enforced by usingSecretas the carrying type.Secretdoes not encrypt under Java serialization, so this offers no wire protection either. It is not trying to: confidentiality over remoting rests on the channel's transport security and on the agent being trusted.
What this type does buy is that the plaintext is reachable only through plainText(),
a name that is conspicuous in review and impossible to reach by accident. Literals are wrapped too,
not just credentials, so there is exactly one path through the code and no "is this the safe one?"
judgement at each call site.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResolvedValuecredential(Secret secret) A value resolved from a Secret Text credential.booleanTrue when this came from a credential, which drives the security notice and type rules.static ResolvedValueA literal supplied in the Pipeline script.The plaintext.toString()
-
Method Details
-
literal
A literal supplied in the Pipeline script. Wrapped identically to a credential. -
credential
A value resolved from a Secret Text credential. -
plainText
The plaintext.Every call is a place a secret could escape. Callers must pass the result straight to serialisation or comparison and must never place it in a message, log line or exception.
-
fromCredential
public boolean fromCredential()True when this came from a credential, which drives the security notice and type rules. -
toString
-