mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-10-30 04:55:21 +00:00
Merge branch 'security-stable-1.642' into security-stable-1.651
This commit is contained in:
commit
4baafc0951
10 files changed
+235
-11
No files matched your search
@@ -1752,7 +1752,16 @@ public class Functions {
|
||||
*/
|
||||
public String getPasswordValue(Object o) {
|
||||
if (o==null) return null;
|
||||
if (o instanceof Secret) return ((Secret)o).getEncryptedValue();
|
||||
if (o instanceof Secret) {
|
||||
StaplerRequest req = Stapler.getCurrentRequest();
|
||||
if (req != null) {
|
||||
Item item = req.findAncestorObject(Item.class);
|
||||
if (item != null && !item.hasPermission(Item.CONFIGURE)) {
|
||||
return "********";
|
||||
}
|
||||
}
|
||||
return ((Secret) o).getEncryptedValue();
|
||||
}
|
||||
if (getIsUnitTest()) {
|
||||
throw new SecurityException("attempted to render plaintext ‘" + o + "’ in password field; use a getter of type Secret instead");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user