|
12 | 12 | * See the License for the specific language governing permissions and |
13 | 13 | * limitations under the License. |
14 | 14 | */ |
15 | | -package grails.plugin.springsecurity |
| 15 | +package grails.plugin.springsecurity; |
16 | 16 |
|
17 | 17 | /** |
18 | 18 | * Stores the default order numbers of all Spring Security filters for use in configuration. |
|
22 | 22 | * |
23 | 23 | * @author Burt Beckwith |
24 | 24 | */ |
25 | | -enum SecurityFilterPosition { |
26 | | - /** First */ |
| 25 | +enum SecurityFilterPosition { |
| 26 | + |
27 | 27 | FIRST(Integer.MIN_VALUE), |
28 | | - /** HTTP/HTTPS channel filter */ |
| 28 | + |
| 29 | + DISABLE_ENCODE_URL_FILTER, |
| 30 | + |
| 31 | + FORCE_EAGER_SESSION_FILTER, |
| 32 | + |
29 | 33 | CHANNEL_FILTER, |
30 | | - /** Concurrent Sessions */ |
31 | | - CONCURRENT_SESSION_FILTER, |
32 | | - /** Populates the SecurityContextHolder */ |
| 34 | + |
33 | 35 | SECURITY_CONTEXT_FILTER, |
34 | | - /** Logout */ |
| 36 | + |
| 37 | + CONCURRENT_SESSION_FILTER, |
| 38 | + |
| 39 | + WEB_ASYNC_MANAGER_FILTER, |
| 40 | + |
| 41 | + HEADERS_FILTER, |
| 42 | + |
| 43 | + CORS_FILTER, |
| 44 | + |
| 45 | + SAML2_LOGOUT_REQUEST_FILTER, |
| 46 | + |
| 47 | + SAML2_LOGOUT_RESPONSE_FILTER, |
| 48 | + |
| 49 | + CSRF_FILTER, |
| 50 | + |
| 51 | + SAML2_LOGOUT_FILTER, |
| 52 | + |
35 | 53 | LOGOUT_FILTER, |
36 | | - /** x509 certs */ |
| 54 | + |
| 55 | + OAUTH2_AUTHORIZATION_REQUEST_FILTER, |
| 56 | + |
| 57 | + SAML2_AUTHENTICATION_REQUEST_FILTER, |
| 58 | + |
37 | 59 | X509_FILTER, |
38 | | - /** Pre-auth */ |
| 60 | + |
39 | 61 | PRE_AUTH_FILTER, |
40 | | - /** CAS */ |
| 62 | + |
41 | 63 | CAS_FILTER, |
42 | | - /** UsernamePasswordAuthenticationFilter */ |
| 64 | + |
| 65 | + OAUTH2_LOGIN_FILTER, |
| 66 | + |
| 67 | + SAML2_AUTHENTICATION_FILTER, |
| 68 | + |
43 | 69 | FORM_LOGIN_FILTER, |
44 | | - /** OpenID */ |
45 | | - OPENID_FILTER, |
46 | | - /** Not used, generates a dynamic login form */ |
| 70 | + |
47 | 71 | LOGIN_PAGE_FILTER, |
48 | | - /** Digest auth */ |
| 72 | + |
| 73 | + LOGOUT_PAGE_FILTER, |
| 74 | + |
49 | 75 | DIGEST_AUTH_FILTER, |
50 | | - /** Basic Auth */ |
| 76 | + |
| 77 | + BEARER_TOKEN_AUTH_FILTER, |
| 78 | + |
51 | 79 | BASIC_AUTH_FILTER, |
52 | | - /** saved request filter */ |
| 80 | + |
53 | 81 | REQUEST_CACHE_FILTER, |
54 | | - /** SecurityContextHolderAwareRequestFilter */ |
| 82 | + |
55 | 83 | SERVLET_API_SUPPORT_FILTER, |
56 | | - /** Remember-me cookie */ |
| 84 | + |
| 85 | + JAAS_API_SUPPORT_FILTER, |
| 86 | + |
57 | 87 | REMEMBER_ME_FILTER, |
58 | | - /** Anonymous auth */ |
| 88 | + |
59 | 89 | ANONYMOUS_FILTER, |
60 | | - /** SessionManagementFilter */ |
| 90 | + |
| 91 | + OAUTH2_AUTHORIZATION_CODE_GRANT_FILTER, |
| 92 | + |
| 93 | + WELL_KNOWN_CHANGE_PASSWORD_REDIRECT_FILTER, |
| 94 | + |
61 | 95 | SESSION_MANAGEMENT_FILTER, |
62 | | - /** Spring FormContentFilter allows www-url-form-encoded content-types to provide params in PUT requests */ |
63 | | - FORM_CONTENT_FILTER, |
64 | | - /** ExceptionTranslationFilter */ |
| 96 | + |
65 | 97 | EXCEPTION_TRANSLATION_FILTER, |
66 | | - /** FilterSecurityInterceptor */ |
| 98 | + |
67 | 99 | FILTER_SECURITY_INTERCEPTOR, |
68 | | - /** Switch user */ |
| 100 | + |
69 | 101 | SWITCH_USER_FILTER, |
70 | | - /** Last */ |
71 | | - LAST(Integer.MAX_VALUE) |
72 | 102 |
|
73 | | - private static final int INTERVAL = 100 |
| 103 | + LAST(Integer.MAX_VALUE); |
| 104 | + |
| 105 | + private static final int INTERVAL = 100; |
74 | 106 |
|
75 | | - /** The position in the chain. */ |
76 | | - final int order |
| 107 | + private final int order; |
77 | 108 |
|
78 | | - private SecurityFilterPosition() { |
79 | | - order = ordinal() * INTERVAL |
| 109 | + SecurityFilterPosition() { |
| 110 | + this.order = ordinal() * INTERVAL; |
80 | 111 | } |
81 | 112 |
|
82 | | - private SecurityFilterPosition(int filterOrder) { |
83 | | - order = filterOrder |
| 113 | + SecurityFilterPosition(int order) { |
| 114 | + this.order = order; |
84 | 115 | } |
| 116 | + |
| 117 | + public int getOrder() { |
| 118 | + return this.order; |
| 119 | + } |
| 120 | + |
85 | 121 | } |
0 commit comments