Class SecretPatterns
java.lang.Object
org.jenkinsci.plugins.credentialsbinding.masking.SecretPatterns
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Delegating output stream that masks occurrences of a set of secrets. -
Method Summary
Modifier and TypeMethodDescriptionstatic Pattern
getAggregateSecretPattern
(Collection<String> inputs) Constructs a regular expression to match against all known forms that the given collection of input strings may appear.
-
Method Details
-
getAggregateSecretPattern
Constructs a regular expression to match against all known forms that the given collection of input strings may appear. This pattern is optimized such that longer masks are checked before shorter masks. By doing so, this makes inputs that are substrings of other inputs be masked as the longer input, though there is no guarantee this will work in every possible situation. Another consequence of this ordering is that inputs that require quoting will be masked before a substring of the input was matched, thus avoiding leakage of information. For example,bash -x
will only quote arguments echoed when necessary. To avoid leaking the presence or absence of quoting, the longer form is masked.
-