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, Loadable, 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;
  • Constructor Details

    • NegotiateSSO

      public NegotiateSSO()
      Initializes and starts the filter, if enabled.
  • Method Details

    • 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 class Descriptor<GlobalConfiguration>
      Returns:
      GlobalConfigurationCategory.Security
    • getDisplayName

      public String getDisplayName()
      The Plugin Display name
      Overrides:
      getDisplayName in class Descriptor<GlobalConfiguration>
      Returns:
      Display name
    • start

      public void start() throws jakarta.servlet.ServletException
      Starts the plugin. Loads previous configuration if such exists.
      Throws:
      jakarta.servlet.ServletException - if the Waffle NTLM/Kerberos filter cannot be added to Jenkins.
    • configure

      public boolean configure(org.kohsuke.stapler.StaplerRequest2 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 class GlobalConfiguration
      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: provides a name and java classpath for an HTML 'select' element Suppressed warnings (for security scans): * permission check: the configuration page is restricted to 'ADMINISTER' permissions, but this function is only providing the potential choices, not changing settings * csrf: We do not provide routable URLs, only a text name (with spaces) and a java classpath reference for internal use
      Returns:
      the allowed provider strings