Remove unused property domain. Add swagger info at readme

This commit is contained in:
kostis30fyllou 2021-07-08 13:19:45 +03:00
parent 481e68d32d
commit 959ba82d44
2 changed files with 6 additions and 18 deletions

View File

@ -19,6 +19,10 @@ revoke roles from them.
redis.host = localhost redis.host = localhost
redis.port = 6379 redis.port = 6379
redis.password = redis.password =
webbapp.front.domain=.di.uoa.gr
### Use Swagger
Project supports swagger UI in order to make testing easy to the developers.
In order to disable swagger for production environment,
a specific profile named "swagger" must be used on dev mode.

View File

@ -3,13 +3,10 @@ package eu.dnetlib.dnetrolemanagement.config.security;
import eu.dnetlib.dnetrolemanagement.config.properties.RedisProperties; import eu.dnetlib.dnetrolemanagement.config.properties.RedisProperties;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession; import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.web.http.CookieSerializer;
import org.springframework.session.web.http.DefaultCookieSerializer;
import org.springframework.session.web.http.HeaderHttpSessionStrategy; import org.springframework.session.web.http.HeaderHttpSessionStrategy;
import org.springframework.session.web.http.HttpSessionStrategy; import org.springframework.session.web.http.HttpSessionStrategy;
@ -18,10 +15,7 @@ import org.springframework.session.web.http.HttpSessionStrategy;
public class RedisConfig { public class RedisConfig {
private static final Logger logger = Logger.getLogger(RedisConfig.class); private static final Logger logger = Logger.getLogger(RedisConfig.class);
private RedisProperties redisProperties; private final RedisProperties redisProperties;
@Value("${webbapp.front.domain:openaire.eu}")
private String domain;
@Autowired @Autowired
public RedisConfig(RedisProperties redisProperties) { public RedisConfig(RedisProperties redisProperties) {
@ -42,14 +36,4 @@ public class RedisConfig {
headerHttpSessionStrategy.setHeaderName("Session"); headerHttpSessionStrategy.setHeaderName("Session");
return headerHttpSessionStrategy; return headerHttpSessionStrategy;
} }
/*@Bean
public CookieSerializer cookieSerializer() {
System.out.println("Cookie Serializer: Domain is " + domain);
DefaultCookieSerializer serializer = new DefaultCookieSerializer();
serializer.setCookieName("openAIRESession"); // <1>
serializer.setCookiePath("/"); // <2>
serializer.setDomainNamePattern("^.+?\\.(\\w+\\.[a-z]+)$");
return serializer;
}*/
} }