Class CredentialsStoreAction
- java.lang.Object
-
- com.cloudbees.plugins.credentials.CredentialsStoreAction
-
- All Implemented Interfaces:
Action
,ModelObject
,AccessControlled
,ModelObjectWithChildren
,ModelObjectWithContextMenu
,IconSpec
- Direct Known Subclasses:
SystemCredentialsProvider.UserFacingAction
,UserCredentialsProvider.UserFacingAction
@ExportedBean public abstract class CredentialsStoreAction extends Object implements Action, IconSpec, AccessControlled, ModelObjectWithContextMenu, ModelObjectWithChildren
An action for aCredentialsStore
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CredentialsStoreAction.CredentialsWrapper
A wrapper object to bind and exposeCredentials
instances into the web UI.static class
CredentialsStoreAction.DomainWrapper
A wrapper object to bind and exposeDomain
instances into the web UI.-
Nested classes/interfaces inherited from interface jenkins.model.ModelObjectWithContextMenu
ModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItem, ModelObjectWithContextMenu.MenuItemType
-
-
Field Summary
Fields Modifier and Type Field Description static Permission
CREATE
ExposeCredentialsProvider.CREATE
for Jelly.static Permission
DELETE
ExposeCredentialsProvider.DELETE
for Jelly.static XStream2
FINGERPRINT_XML
AnXStream2
that replacesSecret
andSecretBytes
instances with a hash of the secret and omits fields that should be excluded from credentials fingerprinting.static Permission
MANAGE_DOMAINS
ExposeCredentialsProvider.MANAGE_DOMAINS
for Jelly.static XStream2
SECRETS_REDACTED
static Permission
UPDATE
ExposeCredentialsProvider.UPDATE
for Jelly.static Permission
VIEW
ExposeCredentialsProvider.VIEW
for Jelly.
-
Constructor Summary
Constructors Constructor Description CredentialsStoreAction()
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, hasAnyPermission, hasPermission, hasPermission2
-
-
-
-
Field Detail
-
VIEW
public static final Permission VIEW
ExposeCredentialsProvider.VIEW
for Jelly.
-
CREATE
public static final Permission CREATE
ExposeCredentialsProvider.CREATE
for Jelly.
-
UPDATE
public static final Permission UPDATE
ExposeCredentialsProvider.UPDATE
for Jelly.
-
DELETE
public static final Permission DELETE
ExposeCredentialsProvider.DELETE
for Jelly.
-
MANAGE_DOMAINS
public static final Permission MANAGE_DOMAINS
ExposeCredentialsProvider.MANAGE_DOMAINS
for Jelly.
-
SECRETS_REDACTED
public static final XStream2 SECRETS_REDACTED
- Since:
- 2.1.1
-
FINGERPRINT_XML
public static final XStream2 FINGERPRINT_XML
AnXStream2
that replacesSecret
andSecretBytes
instances with a hash of the secret and omits fields that should be excluded from credentials fingerprinting.- Since:
- 2.1.15
-
-
Method Detail
-
getStore
@NonNull public abstract CredentialsStore getStore()
Returns theCredentialsStore
backing this action.- Returns:
- the
CredentialsStore
.
-
getIconFileName
public String getIconFileName()
- Specified by:
getIconFileName
in interfaceAction
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getActions
@NonNull public List<Action> getActions()
Any additional actions to display for thisCredentialsStore
.- Returns:
- Any additional actions to display for this
CredentialsStore
. - Since:
- 2.0
-
getDynamic
@CheckForNull public Object getDynamic(String token)
Exposes thegetActions()
for Stapler.- Parameters:
token
- the name of the action.- Returns:
- the
Action
ornull
- Since:
- 2.0
-
getContextMenu
@CheckForNull public ModelObjectWithContextMenu.ContextMenu getContextMenu(String prefix)
Creates the context menu with the supplied prefix to all URLs.- Parameters:
prefix
- the prefix to prepend to relative urls.- Returns:
- the
ModelObjectWithContextMenu.ContextMenu
ornull
- Since:
- 2.0
-
getChildrenContextMenu
@CheckForNull public ModelObjectWithContextMenu.ContextMenu getChildrenContextMenu(String prefix)
Creates the children context menu with the supplied prefix to all URLs.- Parameters:
prefix
- the prefix to prepend to relative urls.- Returns:
- the
ModelObjectWithContextMenu.ContextMenu
ornull
- Since:
- 2.0
-
doContextMenu
public ModelObjectWithContextMenu.ContextMenu doContextMenu(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
- Specified by:
doContextMenu
in interfaceModelObjectWithContextMenu
-
doChildrenContextMenu
public ModelObjectWithContextMenu.ContextMenu doChildrenContextMenu(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response)
- Specified by:
doChildrenContextMenu
in interfaceModelObjectWithChildren
-
getUrlName
public String getUrlName()
- Specified by:
getUrlName
in interfaceAction
-
isVisible
public boolean isVisible()
Checks if this action should be visible.- Returns:
true
if the action should be visible.
-
getIconClassName
public String getIconClassName()
- Specified by:
getIconClassName
in interfaceIconSpec
-
getFullName
public final String getFullName()
Returns theItem.getFullName()
or nearest approximation.- Returns:
- the
Item.getFullName()
or nearest approximation.
-
getFullDisplayName
public final String getFullDisplayName()
Returns theItem.getFullDisplayName()
or nearest approximation.- Returns:
- the
Item.getFullDisplayName()
or nearest approximation.
-
getDomains
@Exported @NonNull public Map<String,CredentialsStoreAction.DomainWrapper> getDomains()
Returns the map ofCredentialsStoreAction.DomainWrapper
instances.- Returns:
- the map of
CredentialsStoreAction.DomainWrapper
instances.
-
getDomain
@CheckForNull public CredentialsStoreAction.DomainWrapper getDomain(String name)
Gets the namedCredentialsStoreAction.DomainWrapper
.- Parameters:
name
- the name.- Returns:
- the named
CredentialsStoreAction.DomainWrapper
.
-
isDomainsModifiable
public boolean isDomainsModifiable()
ExposesCredentialsStore.isDomainsModifiable()
for Jelly.- Returns:
CredentialsStore.isDomainsModifiable()
.
-
getDomainDescriptor
public CredentialsStoreAction.DomainWrapper.DescriptorImpl getDomainDescriptor()
ExposesCredentialsStoreAction.DomainWrapper.DescriptorImpl
for Jelly.
-
getSpecificationDescriptors
public DescriptorExtensionList<DomainSpecification,Descriptor<DomainSpecification>> getSpecificationDescriptors()
Gets all theDomainSpecification
descriptors.- Returns:
- all the
DomainSpecification
descriptors.
-
doCreateDomain
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public org.kohsuke.stapler.HttpResponse doCreateDomain(org.kohsuke.stapler.StaplerRequest req) throws javax.servlet.ServletException, IOException
Creates a domain.- Parameters:
req
- the request.- Returns:
- the response.
- Throws:
javax.servlet.ServletException
- if something goes wrong.IOException
- if something goes wrong.
-
getACL
@NonNull public ACL getACL()
- Specified by:
getACL
in interfaceAccessControlled
-
checkPermission
public void checkPermission(@NonNull Permission permission) throws AccessDeniedException
- Specified by:
checkPermission
in interfaceAccessControlled
- Throws:
AccessDeniedException
-
hasPermission
public boolean hasPermission(@NonNull Permission permission)
- Specified by:
hasPermission
in interfaceAccessControlled
-
-