java.lang.Object
org.jenkinsci.plugins.ParameterizedRemoteTrigger.JenkinsCrumb

public class JenkinsCrumb extends Object
If the remote Jenkins server uses the "Prevent Cross Site Request Forgery exploits" security option, a CSRF protection token must be sent in the header of the request to trigger the remote job. This token is called crumb.
  • Constructor Details

    • JenkinsCrumb

      public JenkinsCrumb()
      New JenkinsCrumb object indicating that CSRF is disabled in the remote Jenkins (no crumb needed).
    • JenkinsCrumb

      public JenkinsCrumb(String headerId, String crumbValue)
      New JenkinsCrumb object with the header ID and crumb value to use in subsequent requests.
      Parameters:
      headerId - the header ID to be used in the subsequent requests.
      crumbValue - the crumb value to be used in the header of subsequent requests.
  • Method Details

    • getHeaderId

      public String getHeaderId()
      Returns:
      the header ID to be used in the subsequent requests. Null if CSRF is disabled in the remote Jenkins.
    • getCrumbValue

      public String getCrumbValue()
      Returns:
      the crumb value to be used in the header of subsequent requests. Null if CSRF is disabled in the remote Jenkins.
    • isEnabledOnRemote

      public boolean isEnabledOnRemote()
      Returns:
      true if CSRF is enabled on the remote Jenkins, false otherwise.