Class WebhookConfiguration
java.lang.Object
hudson.model.Descriptor<GlobalConfiguration>
jenkins.model.GlobalConfiguration
io.jenkins.plugins.webhookexternalstore.WebhookConfiguration
- All Implemented Interfaces:
ExtensionPoint,Describable<GlobalConfiguration>,Saveable,Loadable,OnMaster
@Extension
@Symbol("webhookSecretStore")
public class WebhookConfiguration
extends GlobalConfiguration
Global configuration for webhook credentials provider, including Bearer token authentication.
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.SelfNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.Descriptor
clazz -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanconfigure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject formData) static WebhookConfigurationGet the singleton instance of this configuration.getToken()Get the token.booleanCheck if a Bearer token is configured.booleanisValidBearerToken(String providedToken) Validate the provided Bearer token against the configured one.voidSet the Bearer token.Methods inherited from class jenkins.model.GlobalConfiguration
all, configure, getDescriptor, getGlobalConfigPageMethods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, doHelp, find, find, findByDescribableClassName, findById, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
WebhookConfiguration
public WebhookConfiguration()
-
-
Method Details
-
getInstance
Get the singleton instance of this configuration.- Returns:
- the WebhookConfiguration instance
-
getToken
Get the token.- Returns:
- the token as a Secret, or null if not configured
-
setToken
Set the Bearer token.- Parameters:
token- the Bearer token to set
-
isTokenConfigured
public boolean isTokenConfigured()Check if a Bearer token is configured.- Returns:
- true if a Bearer token is configured, false otherwise
-
isValidBearerToken
Validate the provided Bearer token against the configured one.- Parameters:
providedToken- the token provided in the Authorization header- Returns:
- true if the token is valid, false otherwise
-
getCategory
- Overrides:
getCategoryin classDescriptor<GlobalConfiguration>
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject formData) throws Descriptor.FormException - Overrides:
configurein classGlobalConfiguration- Throws:
Descriptor.FormException
-
getDisplayName
- Overrides:
getDisplayNamein classDescriptor<GlobalConfiguration>
-