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 a
CredentialsStore
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
A wrapper object to bind and exposeCredentials
instances into the web UI.static class
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
Modifier and TypeFieldDescriptionstatic final Permission
ExposeCredentialsProvider.CREATE
for Jelly.static final Permission
ExposeCredentialsProvider.DELETE
for Jelly.static final XStream2
AnXStream2
that replacesSecret
andSecretBytes
instances with a hash of the secret and omits fields that should be excluded from credentials fingerprinting.static final Permission
ExposeCredentialsProvider.MANAGE_DOMAINS
for Jelly.static final XStream2
static final Permission
ExposeCredentialsProvider.UPDATE
for Jelly.static final Permission
ExposeCredentialsProvider.VIEW
for Jelly. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
checkPermission
(Permission permission) doChildrenContextMenu
(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) doContextMenu
(org.kohsuke.stapler.StaplerRequest request, org.kohsuke.stapler.StaplerResponse response) org.kohsuke.stapler.HttpResponse
doCreateDomain
(org.kohsuke.stapler.StaplerRequest req) Creates a domain.getACL()
Any additional actions to display for thisCredentialsStore
.getApi()
Expose the action'sApi
.getChildrenContextMenu
(String prefix) Creates the children context menu with the supplied prefix to all URLs.getContextMenu
(String prefix) Creates the context menu with the supplied prefix to all URLs.Gets the namedCredentialsStoreAction.DomainWrapper
.ExposesCredentialsStoreAction.DomainWrapper.DescriptorImpl
for Jelly.Returns the map ofCredentialsStoreAction.DomainWrapper
instances.getDynamic
(String token) Exposes thegetActions()
for Stapler.final String
Returns theItem.getFullDisplayName()
or nearest approximation.final String
Returns theItem.getFullName()
or nearest approximation.Gets all theDomainSpecification
descriptors.abstract CredentialsStore
getStore()
Returns theCredentialsStore
backing this action.boolean
hasPermission
(Permission permission) boolean
ExposesCredentialsStore.isDomainsModifiable()
for Jelly.boolean
Checks if this action should be visible.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 Details
-
VIEW
ExposeCredentialsProvider.VIEW
for Jelly. -
CREATE
ExposeCredentialsProvider.CREATE
for Jelly. -
UPDATE
ExposeCredentialsProvider.UPDATE
for Jelly. -
DELETE
ExposeCredentialsProvider.DELETE
for Jelly. -
MANAGE_DOMAINS
ExposeCredentialsProvider.MANAGE_DOMAINS
for Jelly. -
SECRETS_REDACTED
- Since:
- 2.1.1
-
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
-
-
Constructor Details
-
CredentialsStoreAction
public CredentialsStoreAction()
-
-
Method Details
-
getStore
Returns theCredentialsStore
backing this action.- Returns:
- the
CredentialsStore
.
-
getIconFileName
- Specified by:
getIconFileName
in interfaceAction
-
getDisplayName
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getActions
Any additional actions to display for thisCredentialsStore
.- Returns:
- Any additional actions to display for this
CredentialsStore
. - Since:
- 2.0
-
getDynamic
Exposes thegetActions()
for Stapler.- Parameters:
token
- the name of the action.- Returns:
- the
Action
ornull
- Since:
- 2.0
-
getContextMenu
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
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
- Specified by:
getUrlName
in interfaceAction
-
getApi
Expose the action'sApi
.- Returns:
- the action's
Api
.
-
isVisible
public boolean isVisible()Checks if this action should be visible.- Returns:
true
if the action should be visible.
-
getIconClassName
- Specified by:
getIconClassName
in interfaceIconSpec
-
getFullName
Returns theItem.getFullName()
or nearest approximation.- Returns:
- the
Item.getFullName()
or nearest approximation.
-
getFullDisplayName
Returns theItem.getFullDisplayName()
or nearest approximation.- Returns:
- the
Item.getFullDisplayName()
or nearest approximation.
-
getDomains
Returns the map ofCredentialsStoreAction.DomainWrapper
instances.- Returns:
- the map of
CredentialsStoreAction.DomainWrapper
instances.
-
getDomain
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
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
- Specified by:
getACL
in interfaceAccessControlled
-
checkPermission
public void checkPermission(@NonNull Permission permission) throws org.springframework.security.access.AccessDeniedException - Specified by:
checkPermission
in interfaceAccessControlled
- Throws:
org.springframework.security.access.AccessDeniedException
-
hasPermission
- Specified by:
hasPermission
in interfaceAccessControlled
-