|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kohsuke.stapler.CrumbIssuer
public abstract class CrumbIssuer
Generates a nonce value that allows us to protect against cross-site request forgery (CSRF) attacks.
We send this with each JavaScript proxy and verify them when we receive a request.
WebApp.getCrumbIssuer()
,
WebApp.setCrumbIssuer(CrumbIssuer)
Field Summary | |
---|---|
static CrumbIssuer |
DEFAULT
Default crumb issuer. |
Constructor Summary | |
---|---|
CrumbIssuer()
|
Method Summary | |
---|---|
HttpResponse |
doCrumb()
Sends the crumb value in plain text, enabling retrieval through XmlHttpRequest. |
String |
issueCrumb()
|
abstract String |
issueCrumb(StaplerRequest request)
Issues a crumb for the given request. |
void |
validateCrumb(StaplerRequest request,
String submittedCrumb)
Validates a crumb that was submitted along with the request. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final CrumbIssuer DEFAULT
Constructor Detail |
---|
public CrumbIssuer()
Method Detail |
---|
public abstract String issueCrumb(StaplerRequest request)
public final String issueCrumb()
public HttpResponse doCrumb()
public void validateCrumb(StaplerRequest request, String submittedCrumb)
request
- The request that submitted the crumbsubmittedCrumb
- The submitted crumb value to be validated.
Exception
- If the crumb doesn't match and the request processing should abort.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |