org.jvnet.hudson.test
Class TestCrumbIssuer
java.lang.Object
hudson.security.csrf.CrumbIssuer
org.jvnet.hudson.test.TestCrumbIssuer
- All Implemented Interfaces:
- ExtensionPoint, Describable<CrumbIssuer>
public class TestCrumbIssuer
- extends CrumbIssuer
A crumb issuer that issues a constant crumb value. Used for unit testing.
- Author:
- dty
Method Summary |
protected String |
issueCrumb(javax.servlet.ServletRequest request,
String salt)
Create a crumb value based on user specific information in the request. |
boolean |
validateCrumb(javax.servlet.ServletRequest request,
String salt,
String crumb)
Validate a previously created crumb against information in the current request. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TestCrumbIssuer
public TestCrumbIssuer()
issueCrumb
protected String issueCrumb(javax.servlet.ServletRequest request,
String salt)
- Description copied from class:
CrumbIssuer
- Create a crumb value based on user specific information in the request.
The crumb should be generated by building a cryptographic hash of:
- relevant information in the request that can uniquely identify the client
- the salt value
- an implementation specific guarded secret.
- Specified by:
issueCrumb
in class CrumbIssuer
- Returns:
validateCrumb
public boolean validateCrumb(javax.servlet.ServletRequest request,
String salt,
String crumb)
- Description copied from class:
CrumbIssuer
- Validate a previously created crumb against information in the current request.
- Specified by:
validateCrumb
in class CrumbIssuer
crumb
- The previously generated crumb to validate against information in the current request
- Returns:
Copyright © 2004-2013. All Rights Reserved.