public class MaskPasswordsConfig extends Object
Constructor and Description |
---|
MaskPasswordsConfig() |
Modifier and Type | Method and Description |
---|---|
void |
addGlobalVarMaskRegex(MaskPasswordsBuildWrapper.VarMaskRegex varMaskRegex)
Adds a regex at the global level.
|
void |
addGlobalVarPasswordPair(MaskPasswordsBuildWrapper.VarPasswordPair varPasswordPair)
Adds a name/password pair at the global level.
|
void |
addMaskedPasswordParameterDefinition(String className) |
void |
clear() |
List<MaskPasswordsBuildWrapper.VarMaskRegex> |
getGlobalVarMaskRegexes()
Returns the list of regexes defined at the global level.
|
List<MaskPasswordsBuildWrapper.VarPasswordPair> |
getGlobalVarPasswordPairs()
Returns the list of name/password pairs defined at the global level.
|
static MaskPasswordsConfig |
getInstance() |
static Map<String,String> |
getParameterDefinitions()
Returns a map of all
ParameterDefinition s that can be used in
jobs. |
boolean |
isEnabledGlobally()
Returns whether the plugin is enabled globally for ALL BUILDS.
|
boolean |
isMasked(hudson.model.ParameterValue value,
String paramValueClassName)
Returns true if the specified parameter value class name corresponds to
a parameter definition class name selected in Jenkins' main
configuration screen.
|
boolean |
isMasked(String paramValueClassName)
Deprecated.
There is a high risk of false-negatives. Use
isMasked(hudson.model.ParameterValue, java.lang.String) at least |
boolean |
isSelected(String paramDefClassName)
Returns true if the specified parameter definition class name has been
selected in Jenkins main configuration screen.
|
static MaskPasswordsConfig |
load() |
void |
reset()
Resets configuration to the default state.
|
static void |
save(MaskPasswordsConfig config) |
void |
setGlobalVarEnabledGlobally(boolean state) |
public void addGlobalVarPasswordPair(MaskPasswordsBuildWrapper.VarPasswordPair varPasswordPair)
If either name or password is blank (as defined per the Commons Lang library), then the pair is not added.
public void addGlobalVarMaskRegex(MaskPasswordsBuildWrapper.VarMaskRegex varMaskRegex)
If regex is blank (as defined per the Commons Lang library), then the pair is not added.
public void addMaskedPasswordParameterDefinition(String className)
className
- The class name of a ParameterDefinition.ParameterDescriptor
to be added
to the list of parameters which will prevent the rebuild
action to be enabled for a buildpublic void setGlobalVarEnabledGlobally(boolean state)
@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public final void reset()
public void clear()
public static MaskPasswordsConfig getInstance()
public List<MaskPasswordsBuildWrapper.VarPasswordPair> getGlobalVarPasswordPairs()
Modifications broughts to the returned list has no impact on this
configuration (the returned value is a copy). Also, the list can be
empty but never null
.
public List<MaskPasswordsBuildWrapper.VarMaskRegex> getGlobalVarMaskRegexes()
Modifications broughts to the returned list has no impact on this
configuration (the returned value is a copy). Also, the list can be
empty but never null
.
public static Map<String,String> getParameterDefinitions()
ParameterDefinition
s that can be used in
jobs.
The key is the class name of the ParameterDefinition
, the value
is its display name.
public boolean isEnabledGlobally()
@Deprecated public boolean isMasked(@Nonnull String paramValueClassName)
isMasked(hudson.model.ParameterValue, java.lang.String)
at leastparamValueClassName
- Class name of the ParameterValue
true
if the parameter value should be masked.
false
if the plugin is not sure, may be false-negativepublic boolean isMasked(@CheckForNull hudson.model.ParameterValue value, @Nonnull String paramValueClassName)
value
- Parameter value. Without it there is a high risk of false negatives.paramValueClassName
- Class name of the ParameterValue
class implementationtrue
if the parameter value should be masked.
false
if the plugin is not sure, may be false-negative especially if the value is null
.public boolean isSelected(String paramDefClassName)
public static MaskPasswordsConfig load()
public static void save(MaskPasswordsConfig config) throws IOException
IOException
Copyright © 2016–2017. All rights reserved.