1   package com.atlassian.seraph.config;
2   
3   import com.atlassian.seraph.SecurityService;
4   import com.atlassian.seraph.auth.AuthenticationContext;
5   import com.atlassian.seraph.auth.Authenticator;
6   import com.atlassian.seraph.auth.RoleMapper;
7   import com.atlassian.seraph.controller.SecurityController;
8   import com.atlassian.seraph.elevatedsecurity.ElevatedSecurityGuard;
9   import com.atlassian.seraph.interceptor.Interceptor;
10  import com.atlassian.seraph.ioc.ComponentLocator;
11  import com.atlassian.seraph.service.rememberme.RememberMeService;
12  
13  import java.util.List;
14  
15  public interface SecurityConfig
16  {
17      String STORAGE_KEY = "seraph_config";
18      String BASIC_AUTH = "basic";
19  
20      List<SecurityService> getServices();
21  
22      String getLoginURL();
23  
24      String getLinkLoginURL();
25  
26      String getLogoutURL();
27  
28      String getOriginalURLKey();
29  
30      /**
31       * @return the {@link com.atlassian.seraph.auth.Authenticator} in play
32       */
33      Authenticator getAuthenticator();
34  
35      /**
36       * @return the {@link com.atlassian.seraph.auth.AuthenticationContext} in play
37       */
38      AuthenticationContext getAuthenticationContext();
39  
40      /**
41       * @return the {@link com.atlassian.seraph.controller.SecurityController} in play
42       */
43      SecurityController getController();
44  
45      /**
46       * @return the {@link com.atlassian.seraph.auth.RoleMapper} in play
47       */
48      RoleMapper getRoleMapper();
49  
50      /**
51       * @return the {@link com.atlassian.seraph.elevatedsecurity.ElevatedSecurityGuard} in play
52       */
53      ElevatedSecurityGuard getElevatedSecurityGuard();
54  
55      /**
56       * @return the {@link com.atlassian.seraph.ioc.ComponentLocator} in play
57       */
58      ComponentLocator getComponentLocator();
59  
60      /**
61       * @return the {@link com.atlassian.seraph.service.rememberme.RememberMeService} in play
62       */
63      RememberMeService getRememberMeService();
64  
65      /**
66       * Returns the configured RedirectPolicy, or the default if none is configured.
67       * Will never return null.
68       * @return The configured RedirectPolicy, or the default if none is configured.
69       */
70      RedirectPolicy getRedirectPolicy();
71  
72      <T extends Interceptor> List<T> getInterceptors(Class<T> desiredInterceptorClass);
73  
74      void destroy();
75  
76      /**
77       * @return the path that should be applied to the cookie
78       */
79      String getLoginCookiePath();
80  
81      /**
82       * The name of the remember me cookie
83       */
84      String getLoginCookieKey();
85  
86      /**
87       * returns true if the remember me cookie should never be set to secure
88       */
89      boolean isInsecureCookie();
90  
91      /**
92       * @return the maximum age of the remember me cookie
93       */
94      int getAutoLoginCookieAge();
95  
96      /**
97       * @deprecated replaced by the {@link com.atlassian.seraph.service.rememberme.RememberMeService} code
98       */
99      String getCookieEncoding();
100 
101     String getAuthType();
102 }