This repository was archived by the owner on Dec 15, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed
core/src/main/java/org/mvcspec/ozark/security
test/csrf/src/main/java/org/mvcspec/ozark/test/csrf Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 21
21
import javax .inject .Inject ;
22
22
import javax .mvc .Controller ;
23
23
import javax .mvc .security .Csrf ;
24
- import javax .mvc .security .CsrfValid ;
24
+ import javax .mvc .security .CsrfProtected ;
25
25
import javax .ws .rs .Priorities ;
26
26
import javax .ws .rs .container .ContainerRequestContext ;
27
27
import javax .ws .rs .container .ContainerResponseContext ;
38
38
* <p>CSRF can be enabled by setting the property {@link javax.mvc.security.Csrf#CSRF_PROTECTION}
39
39
* to {@link javax.mvc.security.Csrf.CsrfOptions#IMPLICIT}, to by setting it to
40
40
* {@link javax.mvc.security.Csrf.CsrfOptions#EXPLICIT} and annotating the desired
41
- * controllers with {@link CsrfValid }. Note that validation only
41
+ * controllers with {@link CsrfProtected }. Note that validation only
42
42
* applies to controllers also annotated by {@link javax.ws.rs.POST}.</p>
43
43
*
44
44
* @author Santiago Pericas-Geertsen
Original file line number Diff line number Diff line change 21
21
import javax .annotation .Priority ;
22
22
import javax .inject .Inject ;
23
23
import javax .mvc .Controller ;
24
- import javax .mvc .security .CsrfValid ;
24
+ import javax .mvc .security .CsrfProtected ;
25
25
import javax .mvc .security .CsrfValidationException ;
26
26
import javax .ws .rs .POST ;
27
27
import javax .ws .rs .Priorities ;
@@ -179,7 +179,7 @@ private boolean needsValidation(Method controller) {
179
179
case IMPLICIT :
180
180
return true ;
181
181
case EXPLICIT :
182
- return hasAnnotation (controller , CsrfValid .class );
182
+ return hasAnnotation (controller , CsrfProtected .class );
183
183
}
184
184
return false ;
185
185
}
Original file line number Diff line number Diff line change 16
16
package org .mvcspec .ozark .test .csrf ;
17
17
18
18
import javax .mvc .Controller ;
19
- import javax .mvc .security .CsrfValid ;
19
+ import javax .mvc .security .CsrfProtected ;
20
20
import javax .mvc .View ;
21
21
import javax .ws .rs .FormParam ;
22
22
import javax .ws .rs .GET ;
@@ -38,7 +38,7 @@ public String getForm() {
38
38
}
39
39
40
40
@ POST
41
- @ CsrfValid
41
+ @ CsrfProtected
42
42
public String postForm (@ FormParam ("greeting" ) String greeting ) {
43
43
return "redirect:/csrf/ok" ;
44
44
}
You can’t perform that action at this time.
0 commit comments