-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: Move access checker and @AnonymousAllowed to flow-server (#…
…10758) * Move access checker and @AnonymousAllowed to flow-server This allows them to be used for view access control also * Rename test classes from *Endpoint to *Class
- Loading branch information
Showing
18 changed files
with
404 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
147 changes: 73 additions & 74 deletions
147
...ect/auth/AccessAnnotationCheckerTest.java → ...ver/auth/AccessAnnotationCheckerTest.java
Large diffs are not rendered by default.
Oops, something went wrong.
235 changes: 235 additions & 0 deletions
235
flow-server/src/test/java/com/vaadin/flow/server/auth/AccessControlTestClasses.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,235 @@ | ||
package com.vaadin.flow.server.auth; | ||
|
||
import javax.annotation.security.DenyAll; | ||
import javax.annotation.security.PermitAll; | ||
import javax.annotation.security.RolesAllowed; | ||
|
||
public class AccessControlTestClasses { | ||
|
||
public static class NoAnnotationClass { | ||
|
||
public void noAnnotation() { | ||
|
||
} | ||
|
||
@AnonymousAllowed | ||
public void anonymousAllowed() { | ||
|
||
} | ||
|
||
@PermitAll | ||
public void permitAll() { | ||
|
||
} | ||
|
||
@DenyAll | ||
public void denyAll() { | ||
|
||
} | ||
|
||
@RolesAllowed("user") | ||
public void rolesAllowedUser() { | ||
|
||
} | ||
|
||
@RolesAllowed("admin") | ||
public void rolesAllowedAdmin() { | ||
|
||
} | ||
|
||
@RolesAllowed({ "user", "admin" }) | ||
public void rolesAllowedUserAdmin() { | ||
} | ||
|
||
} | ||
|
||
@AnonymousAllowed | ||
public static class AnonymousAllowedClass { | ||
|
||
public void noAnnotation() { | ||
|
||
} | ||
|
||
@AnonymousAllowed | ||
public void anonymousAllowed() { | ||
|
||
} | ||
|
||
@PermitAll | ||
public void permitAll() { | ||
|
||
} | ||
|
||
@DenyAll | ||
public void denyAll() { | ||
|
||
} | ||
|
||
@RolesAllowed("user") | ||
public void rolesAllowedUser() { | ||
|
||
} | ||
|
||
@RolesAllowed("admin") | ||
public void rolesAllowedAdmin() { | ||
|
||
} | ||
|
||
@RolesAllowed({ "user", "admin" }) | ||
public void rolesAllowedUserAdmin() { | ||
} | ||
|
||
} | ||
|
||
@PermitAll | ||
public static class PermitAllClass { | ||
|
||
public void noAnnotation() { | ||
|
||
} | ||
|
||
@AnonymousAllowed | ||
public void anonymousAllowed() { | ||
|
||
} | ||
|
||
@PermitAll | ||
public void permitAll() { | ||
|
||
} | ||
|
||
@DenyAll | ||
public void denyAll() { | ||
|
||
} | ||
|
||
@RolesAllowed("user") | ||
public void rolesAllowedUser() { | ||
|
||
} | ||
|
||
@RolesAllowed("admin") | ||
public void rolesAllowedAdmin() { | ||
|
||
} | ||
|
||
@RolesAllowed({ "user", "admin" }) | ||
public void rolesAllowedUserAdmin() { | ||
} | ||
|
||
} | ||
|
||
@DenyAll | ||
public static class DenyAllClass { | ||
|
||
public void noAnnotation() { | ||
|
||
} | ||
|
||
@AnonymousAllowed | ||
public void anonymousAllowed() { | ||
|
||
} | ||
|
||
@PermitAll | ||
public void permitAll() { | ||
|
||
} | ||
|
||
@DenyAll | ||
public void denyAll() { | ||
|
||
} | ||
|
||
@RolesAllowed("user") | ||
public void rolesAllowedUser() { | ||
|
||
} | ||
|
||
@RolesAllowed("admin") | ||
public void rolesAllowedAdmin() { | ||
|
||
} | ||
|
||
@RolesAllowed({ "user", "admin" }) | ||
public void rolesAllowedUserAdmin() { | ||
} | ||
|
||
} | ||
|
||
@RolesAllowed("user") | ||
public static class RolesAllowedUserClass { | ||
|
||
public void noAnnotation() { | ||
|
||
} | ||
|
||
@AnonymousAllowed | ||
public void anonymousAllowed() { | ||
|
||
} | ||
|
||
@PermitAll | ||
public void permitAll() { | ||
|
||
} | ||
|
||
@DenyAll | ||
public void denyAll() { | ||
|
||
} | ||
|
||
@RolesAllowed("user") | ||
public void rolesAllowedUser() { | ||
|
||
} | ||
|
||
@RolesAllowed("admin") | ||
public void rolesAllowedAdmin() { | ||
|
||
} | ||
|
||
@RolesAllowed({ "user", "admin" }) | ||
public void rolesAllowedUserAdmin() { | ||
} | ||
|
||
} | ||
|
||
@RolesAllowed("admin") | ||
public static class RolesAllowedAdminClass { | ||
|
||
public void noAnnotation() { | ||
|
||
} | ||
|
||
@AnonymousAllowed | ||
public void anonymousAllowed() { | ||
|
||
} | ||
|
||
@PermitAll | ||
public void permitAll() { | ||
|
||
} | ||
|
||
@DenyAll | ||
public void denyAll() { | ||
|
||
} | ||
|
||
@RolesAllowed("user") | ||
public void rolesAllowedUser() { | ||
|
||
} | ||
|
||
@RolesAllowed("admin") | ||
public void rolesAllowedAdmin() { | ||
|
||
} | ||
|
||
@RolesAllowed({ "user", "admin" }) | ||
public void rolesAllowedUserAdmin() { | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.