Class NegotiateSSO
- java.lang.Object
-
- hudson.model.Descriptor<GlobalConfiguration>
-
- jenkins.model.GlobalConfiguration
-
- com.github.farmgeek4life.jenkins.negotiatesso.NegotiateSSO
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<GlobalConfiguration>
,Saveable
,OnMaster
@Extension public final class NegotiateSSO extends GlobalConfiguration
The core of this Plugin. Handles the configuration of the Waffle NegotiateSecurityFilter It also starts / stops the filter at the user's request and data-binds to config.groovy.- Author:
- Bryson Gibbons;
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.model.Descriptor
clazz
-
-
Constructor Summary
Constructors Constructor Description NegotiateSSO()
Initializes and starts the filter, if enabled.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData)
When submit is pressed on the global config page and any settings for this plugin are changed, this method is called.ListBoxModel
doFillPrincipalFormatItems()
Used by groovy for data-binding.ListBoxModel
doFillProtocolsItems()
Used by groovy for data-binding.ListBoxModel
doFillProvidersItems()
Used by groovy for data-binding.ListBoxModel
doFillRoleFormatItems()
Used by groovy for data-binding.GlobalConfigurationCategory
getCategory()
Get the proper category for the settings locationString
getDisplayName()
The Plugin Display nameboolean
getEnabled()
Used by groovy for data-binding.static NegotiateSSO
getInstance()
Fetches the singleton instance of this plugin.String
getPrincipalFormat()
Used by groovy for data-binding.String
getProtocols()
Used by groovy for data-binding.String
getProviders()
Used by groovy for data-binding.String
getRedirect()
Used by groovy for data-binding.String
getRoleFormat()
Used by groovy for data-binding.boolean
isAllowImpersonate()
Used by groovy for data-binding.boolean
isAllowLocalhost()
Used by groovy for data-binding.boolean
isRedirectEnabled()
Used by groovy for data-binding.void
setPrincipalFormat(String format)
Used by groovy for data-binding.void
setProtocols(String protocol)
Used by groovy for data-binding.void
setProviders(String provider)
Used by groovy for data-binding.void
setRedirect(String redirect)
Used by groovy for data-binding.void
setRoleFormat(String format)
Used by groovy for data-binding.void
start()
Starts the plugin.-
Methods inherited from class jenkins.model.GlobalConfiguration
all, getDescriptor, getGlobalConfigPage
-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, 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, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
-
-
-
Method Detail
-
getInstance
public static NegotiateSSO getInstance()
Fetches the singleton instance of this plugin.- Returns:
- the instance.
-
getCategory
public GlobalConfigurationCategory getCategory()
Get the proper category for the settings location- Overrides:
getCategory
in classDescriptor<GlobalConfiguration>
- Returns:
- GlobalConfigurationCategory.Security
-
getDisplayName
public String getDisplayName()
The Plugin Display name- Overrides:
getDisplayName
in classDescriptor<GlobalConfiguration>
- Returns:
- Display name
-
start
public void start() throws javax.servlet.ServletException
Starts the plugin. Loads previous configuration if such exists.- Throws:
javax.servlet.ServletException
- if the Waffle NTLM/Kerberos filter cannot be added to Jenkins.
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject formData) throws Descriptor.FormException
When submit is pressed on the global config page and any settings for this plugin are changed, this method is called. It updates all the fields, restarts or stops the filter depending on configuration and saves the configuration to disk.- Overrides:
configure
in classGlobalConfiguration
- Parameters:
req
- the Stapler Request to serve.formData
- the JSON data containing the new configuration.- Returns:
- true if configuration successful; false otherwise
- Throws:
Descriptor.FormException
- if any data in the form is wrong.
-
getEnabled
public boolean getEnabled()
Used by groovy for data-binding.- Returns:
- whether the Filter is currently enabled or not.
-
getRoleFormat
public String getRoleFormat()
Used by groovy for data-binding.- Returns:
- the current role format
-
setRoleFormat
public void setRoleFormat(String format)
Used by groovy for data-binding.- Parameters:
format
- set the role format
-
getPrincipalFormat
public String getPrincipalFormat()
Used by groovy for data-binding.- Returns:
- the current principal format
-
setPrincipalFormat
public void setPrincipalFormat(String format)
Used by groovy for data-binding.- Parameters:
format
- set the principal format
-
getProtocols
public String getProtocols()
Used by groovy for data-binding.- Returns:
- the current protocols
-
setProtocols
public void setProtocols(String protocol)
Used by groovy for data-binding.- Parameters:
protocol
- set the principal format
-
getProviders
public String getProviders()
Used by groovy for data-binding.- Returns:
- the current providers
-
setProviders
public void setProviders(String provider)
Used by groovy for data-binding.- Parameters:
provider
- set the principal format
-
isAllowImpersonate
public boolean isAllowImpersonate()
Used by groovy for data-binding.- Returns:
- whether servlet delegation should be used.
-
isAllowLocalhost
public boolean isAllowLocalhost()
Used by groovy for data-binding.- Returns:
- whether localhost is allowed without authentication.
-
isRedirectEnabled
public boolean isRedirectEnabled()
Used by groovy for data-binding.- Returns:
- whether unauthenticated requests should be redirected
-
getRedirect
public String getRedirect()
Used by groovy for data-binding.- Returns:
- the site to redirect to
-
setRedirect
public void setRedirect(String redirect)
Used by groovy for data-binding.- Parameters:
redirect
- the site to redirect to
-
doFillRoleFormatItems
public ListBoxModel doFillRoleFormatItems()
Used by groovy for data-binding.- Returns:
- the allowed role format strings
-
doFillPrincipalFormatItems
public ListBoxModel doFillPrincipalFormatItems()
Used by groovy for data-binding.- Returns:
- the allowed principal format strings
-
doFillProtocolsItems
public ListBoxModel doFillProtocolsItems()
Used by groovy for data-binding.- Returns:
- the allowed protocol strings
-
doFillProvidersItems
public ListBoxModel doFillProvidersItems()
Used by groovy for data-binding.- Returns:
- the allowed provider strings
-
-