Skip to content
This repository was archived by the owner on Dec 15, 2018. It is now read-only.

Commit e22ba60

Browse files
committed
Renamed CsrfValid annotation to CsrfProtected
1 parent d4de35b commit e22ba60

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

core/src/main/java/org/mvcspec/ozark/security/CsrfProtectFilter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import javax.inject.Inject;
2222
import javax.mvc.Controller;
2323
import javax.mvc.security.Csrf;
24-
import javax.mvc.security.CsrfValid;
24+
import javax.mvc.security.CsrfProtected;
2525
import javax.ws.rs.Priorities;
2626
import javax.ws.rs.container.ContainerRequestContext;
2727
import javax.ws.rs.container.ContainerResponseContext;
@@ -38,7 +38,7 @@
3838
* <p>CSRF can be enabled by setting the property {@link javax.mvc.security.Csrf#CSRF_PROTECTION}
3939
* to {@link javax.mvc.security.Csrf.CsrfOptions#IMPLICIT}, to by setting it to
4040
* {@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
4242
* applies to controllers also annotated by {@link javax.ws.rs.POST}.</p>
4343
*
4444
* @author Santiago Pericas-Geertsen

core/src/main/java/org/mvcspec/ozark/security/CsrfValidateInterceptor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import javax.annotation.Priority;
2222
import javax.inject.Inject;
2323
import javax.mvc.Controller;
24-
import javax.mvc.security.CsrfValid;
24+
import javax.mvc.security.CsrfProtected;
2525
import javax.mvc.security.CsrfValidationException;
2626
import javax.ws.rs.POST;
2727
import javax.ws.rs.Priorities;
@@ -179,7 +179,7 @@ private boolean needsValidation(Method controller) {
179179
case IMPLICIT:
180180
return true;
181181
case EXPLICIT:
182-
return hasAnnotation(controller, CsrfValid.class);
182+
return hasAnnotation(controller, CsrfProtected.class);
183183
}
184184
return false;
185185
}

test/csrf/src/main/java/org/mvcspec/ozark/test/csrf/CsrfController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
package org.mvcspec.ozark.test.csrf;
1717

1818
import javax.mvc.Controller;
19-
import javax.mvc.security.CsrfValid;
19+
import javax.mvc.security.CsrfProtected;
2020
import javax.mvc.View;
2121
import javax.ws.rs.FormParam;
2222
import javax.ws.rs.GET;
@@ -38,7 +38,7 @@ public String getForm() {
3838
}
3939

4040
@POST
41-
@CsrfValid
41+
@CsrfProtected
4242
public String postForm(@FormParam("greeting") String greeting) {
4343
return "redirect:/csrf/ok";
4444
}

0 commit comments

Comments
 (0)