Package hudson.plugins.git
Class GitStatus
- java.lang.Object
-
- hudson.plugins.git.GitStatus
-
- All Implemented Interfaces:
ExtensionPoint
,Action
,ModelObject
,RootAction
,UnprotectedRootAction
@Extension public class GitStatus extends Object implements UnprotectedRootAction
Root action that requests the plugin to poll for changes in remote repositories.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
GitStatus.CommitHookCause
static class
GitStatus.JenkinsAbstractProjectListener
Handle standardSCMTriggerItem
instances with a standardSCMTrigger
.static class
GitStatus.Listener
Other plugins may be interested in listening for these updates.static class
GitStatus.MessageResponseContributor
A response contributor that just adds a simple message to the body.static class
GitStatus.ResponseContributor
Contributes to adoNotifyCommit(HttpServletRequest, String, String, String, String)
response.-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
ALLOW_NOTIFY_COMMIT_PARAMETERS
Allow arbitrary notify commit parameters.static Pattern
CLEANER_SHA1_PATTERN
static String
SAFE_PARAMETERS
Allow specifically declared safe parameters.static Pattern
SHA1_PATTERN
-
Constructor Summary
Constructors Constructor Description GitStatus()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.kohsuke.stapler.HttpResponse
doNotifyCommit(javax.servlet.http.HttpServletRequest request, String url, String branches, String sha1, String token)
String
getDisplayName()
String
getIconFileName()
String
getUrlName()
static boolean
looselyMatches(org.eclipse.jgit.transport.URIish lhs, org.eclipse.jgit.transport.URIish rhs)
Used to test if what we have in the job configuration matches what was submitted to the notification endpoint.String
toString()
-
-
-
Field Detail
-
SHA1_PATTERN
public static final Pattern SHA1_PATTERN
-
CLEANER_SHA1_PATTERN
public static final Pattern CLEANER_SHA1_PATTERN
-
ALLOW_NOTIFY_COMMIT_PARAMETERS
public static final boolean ALLOW_NOTIFY_COMMIT_PARAMETERS
Allow arbitrary notify commit parameters. SECURITY-275 detected that allowing arbitrary parameters through the notifyCommit URL allows an unauthenticated user to set environment variables for a job. If this property is set to true, then the bug exposed by SECURITY-275 will be brought back. Only enable this if you trust all unauthenticated users to not pass harmful arguments to your jobs. -Dhudson.plugins.git.GitStatus.allowNotifyCommitParameters=true on command line Also honors the global Jenkins security setting "hudson.model.ParametersAction.keepUndefinedParameters" if it is set to true.
-
SAFE_PARAMETERS
public static final String SAFE_PARAMETERS
Allow specifically declared safe parameters. SECURITY-275 detected that allowing arbitrary parameters through the notifyCommit URL allows an unauthenticated user to set environment variables for a job. If this property is set to a comma separated list of parameters, then those parameters will be allowed for any job. Only set this value for parameters you trust in all the jobs in your system. -Dhudson.plugins.git.GitStatus.safeParameters=PARM1,PARM1 on command line Also honors the global Jenkins safe parameter list "hudson.model.ParametersAction.safeParameters" if set.
-
-
Method Detail
-
getDisplayName
public String getDisplayName()
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
getIconFileName
public String getIconFileName()
- Specified by:
getIconFileName
in interfaceAction
-
getUrlName
public String getUrlName()
- Specified by:
getUrlName
in interfaceAction
-
doNotifyCommit
public org.kohsuke.stapler.HttpResponse doNotifyCommit(javax.servlet.http.HttpServletRequest request, @QueryParameter(required=true) String url, @QueryParameter String branches, @QueryParameter String sha1, @QueryParameter String token)
-
looselyMatches
public static boolean looselyMatches(org.eclipse.jgit.transport.URIish lhs, org.eclipse.jgit.transport.URIish rhs)
Used to test if what we have in the job configuration matches what was submitted to the notification endpoint. It is better to match loosely and wastes a few polling calls than to be pedantic and miss the push notification, especially given that Git tends to support multiple access protocols.- Parameters:
lhs
- left-hand side of comparisonrhs
- right-hand side of comparison- Returns:
- true if left-hand side loosely matches right-hand side
-
-