mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-06 16:45:58 +00:00
[FIXED SECURITY-93] PasswordParameterDefinition should serve existing default value in encrypted form.
And strengthen functional tests (using configRoundTrip) to ensure that the same mistake is not made elsewhere.
This commit is contained in:
1 parent
5548b5220c
commit
bf53919856
4 files changed
+54
-1
No files matched your search
@@ -1464,6 +1464,9 @@ public class Functions {
|
||||
public String getPasswordValue(Object o) {
|
||||
if (o==null) return null;
|
||||
if (o instanceof Secret) return ((Secret)o).getEncryptedValue();
|
||||
if (getIsUnitTest()) {
|
||||
throw new SecurityException("attempted to render plaintext ‘" + o + "’ in password field; use a getter of type Secret instead");
|
||||
}
|
||||
return o.toString();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user