@@ -18,27 +18,20 @@ public class SECURITY {
1818 public SECURITY (
1919 @ Value ("${token.secret}" ) String tokenSecret ,
2020 @ Value ("${token.expiration-in-hours}" ) Integer tokenExpirationInHours ,
21- @ Value ("${token.refresh.expiration-in-days}" ) Integer refreshTokenExpirationInDays
21+ @ Value ("${token.refresh.expiration-in-days}" ) Integer refreshTokenExpirationInDays ,
22+ @ Value ("${server.servlet.session.cookie.name}" ) String sessionCookieName ,
23+ @ Value ("${swagger.is-private}" ) Boolean privateSwagger
2224 ) {
2325 SECURITY .TOKEN_SECRET = tokenSecret ;
2426 SECURITY .TOKEN_EXPIRATION_IN_HOURS = tokenExpirationInHours ;
2527 SECURITY .REFRESH_TOKEN_EXPIRATION_IN_DAYS = refreshTokenExpirationInDays ;
28+ SECURITY .SESSION_COOKIE_NAME = sessionCookieName ;
29+ SECURITY .PRIVATE_SWAGGER = privateSwagger ;
2630 }
2731
28- public static final String [] STATIC_FILES = {
29- "/robots.txt" ,
30- "/font/**" ,
31- "/css/**" ,
32- "/webjars/**" ,
33- "/js/**" ,
34- "/favicon.ico" ,
35- "/**.html" ,
36- "/documentation/**"
37- };
38-
3932 public static final PublicRoutes PUBLIC_API_ROUTES = create ()
40- .add (GET , "/api" , "/api/documentation/**" )
41- .add (POST , "/api/users" , "/api/sessions/**" , "/api/recoveries/**" , "/api/documentation/**" );
33+ .add (GET , "/api" )
34+ .add (POST , "/api/users" , "/api/sessions/**" , "/api/recoveries/**" );
4235
4336 public static final Integer DAY_MILLISECONDS = 86400 ;
4437 public static final JsonWebToken JWT = new JsonWebToken ();
@@ -52,6 +45,9 @@ public SECURITY(
5245 public static Integer TOKEN_EXPIRATION_IN_HOURS ;
5346 public static Integer REFRESH_TOKEN_EXPIRATION_IN_DAYS ;
5447
48+ public static String SESSION_COOKIE_NAME ;
49+ public static Boolean PRIVATE_SWAGGER ;
50+
5551 public static final String USERNAME_PARAMETER = "email" ;
5652 public static final String PASSWORD_PARAMETER = "password" ;
5753
@@ -61,8 +57,6 @@ public SECURITY(
6157 public static final String ACESSO_NEGADO_URL = LOGIN_URL + "?denied=true" ;
6258 public static final String LOGOUT_URL = "/app/logout" ;
6359
64- public static final String SESSION_COOKIE_NAME = "JSESSIONID" ;
65-
6660 public static final String SECURITY_TYPE = "Bearer" ;
6761 public static final String AUTHORIZATION_HEADER = "Authorization" ;
6862 public static final String ACCEPTABLE_TOKEN_TYPE = SECURITY_TYPE + " " ;
0 commit comments