cleaned up and made properties consistent

This commit is contained in:
Antonis Lempesis 2021-10-23 20:51:56 +00:00
parent a2bb25fe07
commit 71e85e84e0
19 changed files with 101 additions and 164 deletions

View File

@ -24,22 +24,22 @@ import java.util.*;
@EnableWebSecurity @EnableWebSecurity
public class AaiSecurityConfiguration extends WebSecurityConfigurerAdapter { public class AaiSecurityConfiguration extends WebSecurityConfigurerAdapter {
@Value("${webapp.dev.front}") @Value("${services.provide.aai.oidc.webURL}")
private String logoutSuccessUrl; private String logoutSuccessUrl;
@Value("${oidc.issuer}") @Value("${services.provide.aai.oidc.issuer}")
private String oidcIssuer; private String oidcIssuer;
@Value("${oidc.id}") @Value("${services.provide.aai.oidc.id}")
private String oidcId; private String oidcId;
@Value("${oidc.secret}") @Value("${services.provide.aai.oidc.secret}")
private String oidcSecret; private String oidcSecret;
@Value("${oidc.dev.home}") @Value("${services.provide.aai.oidc.redirectURL}")
private String oidcDevHome; private String oidcDevHome;
@Value("${webapp.dev.front}") @Value("${services.provide.aai.oidc.webURL}")
private String webAppFrontEnd; private String webAppFrontEnd;
@Bean @Bean

View File

@ -20,10 +20,10 @@ import org.springframework.context.annotation.*;
@Configuration @Configuration
public class Config { public class Config {
@Value("${ISLookUpService.url}") @Value("${services.provide.iSLookUpService.url}")
private String lookupURL; private String lookupURL;
@Value("${ValidatorService.url}") @Value("${services.provide.validatorService.url}")
private String validatorUrl; private String validatorUrl;
@Bean(name="vocabularyLoader") @Bean(name="vocabularyLoader")

View File

@ -14,16 +14,16 @@ public class DatasourceConfiguration {
private static Logger LOGGER = Logger.getLogger(DatasourceConfiguration.class); private static Logger LOGGER = Logger.getLogger(DatasourceConfiguration.class);
@Value("${services.repomanager.db.driverClassName}") @Value("${services.provide.db.driverClassName}")
private String driverClassname; private String driverClassname;
@Value("${services.repomanager.db.url}") @Value("${services.provide.db.url}")
private String URL; private String URL;
@Value("${services.repomanager.db.username}") @Value("${services.provide.db.username}")
private String username; private String username;
@Value("${services.repomanager.db.password}") @Value("${services.provide.db.password}")
private String password; private String password;
@Bean @Bean

View File

@ -30,8 +30,8 @@ public class FrontEndLinkURIAuthenticationSuccessHandler implements Authenticati
} }
@Value("${aai.mode}") @Value("${services.provide.aai.oidc.domain}")
private String aai_mode; private String domain;
@Override @Override
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException { public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws IOException, ServletException {
@ -47,8 +47,7 @@ public class FrontEndLinkURIAuthenticationSuccessHandler implements Authenticati
} else { } else {
accessToken.setMaxAge(3600); accessToken.setMaxAge(3600);
} }
if (aai_mode.equalsIgnoreCase("production") || aai_mode.equalsIgnoreCase("beta")) accessToken.setDomain(domain);
accessToken.setDomain(".openaire.eu");
accessToken.setPath("/"); accessToken.setPath("/");
response.addCookie(accessToken); response.addCookie(accessToken);

View File

@ -8,31 +8,31 @@ import org.springframework.context.annotation.Configuration;
@Configuration @Configuration
public class MailConfig { public class MailConfig {
@Value("${services.repomanager.mail.host}") @Value("${services.provide.mail.host}")
private String host; private String host;
@Value("${services.repomanager.mail.port}") @Value("${services.provide.mail.port}")
private int port; private int port;
@Value("${services.repomanager.mail.authenticate}") @Value("${services.provide.mail.authenticate}")
private boolean authenticate; private boolean authenticate;
@Value("${services.repomanager.mail.username}") @Value("${services.provide.mail.username}")
private String username; private String username;
@Value("${services.repomanager.mail.password}") @Value("${services.provide.mail.password}")
private String password; private String password;
@Value("${services.repomanager.mail.from}") @Value("${services.provide.mail.from}")
private String from; private String from;
@Value("${services.repomanager.mail.replyTo}") @Value("${services.provide.mail.replyTo}")
private String replyTo; private String replyTo;
@Value("${services.repomanager.mail.mode}") @Value("${services.provide.mail.mode}")
private String mode; private String mode;
@Value("${services.repomanager.mail.debug}") @Value("${services.provide.mail.debug}")
private boolean debug; private boolean debug;
@Bean @Bean

View File

@ -20,7 +20,7 @@ public class OpenAIREAuthoritiesMapper implements OIDCAuthoritiesMapper {
private static final Logger logger = Logger.getLogger(OpenAIREAuthoritiesMapper.class); private static final Logger logger = Logger.getLogger(OpenAIREAuthoritiesMapper.class);
@Value("${services.repo-manager.adminEmail}") @Value("${services.provide.adminEmail}")
String adminEmail; String adminEmail;
@Override @Override

View File

@ -23,17 +23,17 @@ public class RedisConfiguration {
private static Logger LOGGER = Logger.getLogger(RedisConfiguration.class); private static Logger LOGGER = Logger.getLogger(RedisConfiguration.class);
@Value("${redis.host}") @Value("${services.provide.redis.host}")
private String host; private String host;
@Value("${redis.port:6379}") @Value("${services.provide.redis.port:6379}")
private String port; private String port;
@Value("${redis.password}") @Value("${services.provide.redis.password}")
private String password; private String password;
@Value("${aai.mode}") @Value("${services.provide.aai.oidc.domain}")
private String aai_mode; private String domain;
@PostConstruct @PostConstruct
private void init(){ private void init(){
@ -56,9 +56,7 @@ public class RedisConfiguration {
DefaultCookieSerializer serializer = new DefaultCookieSerializer(); DefaultCookieSerializer serializer = new DefaultCookieSerializer();
serializer.setCookieName("openAIRESession"); serializer.setCookieName("openAIRESession");
serializer.setCookiePath("/"); serializer.setCookiePath("/");
if(aai_mode.equalsIgnoreCase("production") || aai_mode.equalsIgnoreCase("beta")) serializer.setDomainName(domain);
serializer.setDomainName(".openaire.eu");
// serializer.setDomainName(".athenarc.gr");
LOGGER.info("Serializer : " + serializer); LOGGER.info("Serializer : " + serializer);
return serializer; return serializer;
} }

View File

@ -18,9 +18,9 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response; import javax.ws.rs.core.Response;
import java.util.Collection; import java.util.Collection;
@RestController //@RestController
@RequestMapping(value = "/role-management") //@RequestMapping(value = "/role-management")
@Api(description = "Role Management", value = "role-management") //@Api(description = "Role Management", value = "role-management")
public class UserRoleController { public class UserRoleController {
private final AaiRegistryService aaiRegistryService; private final AaiRegistryService aaiRegistryService;

View File

@ -33,11 +33,11 @@ public class BrokerServiceImpl implements BrokerService {
@Autowired @Autowired
private RepositoryServiceImpl repoAPI; private RepositoryServiceImpl repoAPI;
@Value("${services.broker.url}:${services.broker.port}/${services.broker.api}${services.broker.openaire}") @Value("${services.provide.broker.url}:${services.provide.broker.port}/${services.provide.broker.api}${services.provide.broker.openaire}")
private String openairePath; private String openairePath;
@Value("${services.broker.url}:${services.broker.port}/${services.broker.api}") @Value("${services.provide.broker.url}:${services.provide.broker.port}/${services.provide.broker.api}")
private String apiPath; private String apiPath;
@Value("${topic_types.url}") @Value("${services.provide.topic_types.url}")
private String topicsURL; private String topicsURL;
private static final org.apache.log4j.Logger LOGGER = org.apache.log4j.Logger private static final org.apache.log4j.Logger LOGGER = org.apache.log4j.Logger

View File

@ -26,16 +26,16 @@ public class EmailUtilsImpl implements EmailUtils {
private final MailLibrary mailLibrary; private final MailLibrary mailLibrary;
private final RepositoryService repositoryService; private final RepositoryService repositoryService;
@Value("${services.repomanager.baseUrl}") @Value("${services.provide.baseUrl}")
private String baseUrl; private String baseUrl;
@Value("${services.repomanager.usagestats.adminEmail}") @Value("${services.provide.usagestats.adminEmail}")
private String usageStatsAdminEmail; private String usageStatsAdminEmail;
@Value("${services.repomanager.provide.adminEmail}") @Value("${services.repomanager.provide.adminEmail}")
private String provideAdminEmail; private String provideAdminEmail;
@Value("${validator.results.url}") @Value("${services.provide.validator.results.url}")
private String valBaseUrl; private String valBaseUrl;
@Autowired @Autowired

View File

@ -36,7 +36,7 @@ public class PiWikServiceImpl implements PiWikService {
private DataSource dataSource; private DataSource dataSource;
@Value("${services.repomanager.analyticsURL}") @Value("${services.provide.analyticsURL}")
private String analyticsURL; private String analyticsURL;

View File

@ -19,7 +19,6 @@ import eu.dnetlib.repo.manager.service.security.RoleMappingService;
import eu.dnetlib.repo.manager.utils.Converter; import eu.dnetlib.repo.manager.utils.Converter;
import gr.uoa.di.driver.enabling.vocabulary.VocabularyLoader; import gr.uoa.di.driver.enabling.vocabulary.VocabularyLoader;
import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.codec.digest.DigestUtils;
import org.apache.http.entity.ContentType;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.json.JSONArray; import org.json.JSONArray;
import org.json.JSONException; import org.json.JSONException;
@ -34,7 +33,6 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert
import org.springframework.security.core.Authentication; import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.MimeType;
import org.springframework.web.client.HttpClientErrorException; import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponents; import org.springframework.web.util.UriComponents;
@ -62,16 +60,16 @@ public class RepositoryServiceImpl implements RepositoryService {
private final EmailUtils emailUtils; private final EmailUtils emailUtils;
private final ValidatorService validatorService; private final ValidatorService validatorService;
@Value("${api.baseAddress}") @Value("${services.provide.clients.dsm}")
private String baseAddress; private String baseAddress;
@Value("${services.repo-manager.adminEmail}") @Value("${services.provide.adminEmail}")
private String adminEmail; private String adminEmail;
@Value("${services.repomanager.usageStatisticsDiagramsBaseURL}") @Value("${services.provide.usageStatisticsDiagramsBaseURL}")
private String usageStatisticsDiagramsBaseURL; private String usageStatisticsDiagramsBaseURL;
@Value("${services.repomanager.usageStatisticsNumbersBaseURL}") @Value("${services.provide.usageStatisticsNumbersBaseURL}")
private String usageStatisticsNumbersBaseURL; private String usageStatisticsNumbersBaseURL;

View File

@ -15,11 +15,11 @@ public class StatsServiceImpl implements StatsService {
@Autowired @Autowired
RestTemplate restTemplate; RestTemplate restTemplate;
@Value("${search.api.baseAddress}") @Value("${services.provide.clients.search}")
private String baseAddress; private String baseAddress;
@Value("${search.api.usagestats}") @Value("${services.provide.clients.usagestats}")
private String usagestatsBaseAddress; private String usagestatsBaseAddress;
@Value("${search.api.usageEvents}") @Value("${services.provide.clients.usageEvents}")
private String usagestatsEvents; private String usagestatsEvents;
@Override @Override

View File

@ -19,7 +19,7 @@ import java.util.List;
public class SushiliteServiceImpl implements SushiliteService { public class SushiliteServiceImpl implements SushiliteService {
@Value("${services.repomanager.usagestats.sushiliteEndpoint}") @Value("${services.provide.usagestats.sushiliteEndpoint}")
private String usagestatsSushiliteEndpoint; private String usagestatsSushiliteEndpoint;
private static final org.apache.log4j.Logger LOGGER = org.apache.log4j.Logger.getLogger(SushiliteServiceImpl.class); private static final org.apache.log4j.Logger LOGGER = org.apache.log4j.Logger.getLogger(SushiliteServiceImpl.class);

View File

@ -19,9 +19,6 @@ public class UserServiceImpl implements UserService {
private static final org.apache.log4j.Logger LOGGER = org.apache.log4j.Logger private static final org.apache.log4j.Logger LOGGER = org.apache.log4j.Logger
.getLogger(UserServiceImpl.class); .getLogger(UserServiceImpl.class);
@Value("${oidc.issuer}")
private String oidc_issuer;
@Override @Override
public ResponseEntity<Object> login() { public ResponseEntity<Object> login() {
OIDCAuthenticationToken authentication = (OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication(); OIDCAuthenticationToken authentication = (OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication();

View File

@ -30,7 +30,7 @@ public class RegistryCalls implements AaiRegistryService {
public final RegistryUtils jsonUtils; public final RegistryUtils jsonUtils;
@Autowired @Autowired
RegistryCalls(@Value("${aai.registry.coid:2}") String coid, RegistryCalls(@Value("${services.provide.aai.registry.coid:2}") String coid,
HttpUtils httpUtils, RegistryUtils registryUtils) { HttpUtils httpUtils, RegistryUtils registryUtils) {
this.coid = coid; this.coid = coid;
this.httpUtils = httpUtils; this.httpUtils = httpUtils;

View File

@ -16,7 +16,7 @@ public class AaiRoleMappingService implements RoleMappingService {
private static final Logger logger = Logger.getLogger(AaiRoleMappingService.class); private static final Logger logger = Logger.getLogger(AaiRoleMappingService.class);
@Value("${aai.registry.production:true}") @Value("${services.provide.aai.registry.production:true}")
private boolean production; private boolean production;

View File

@ -18,13 +18,13 @@ public class HttpUtils {
private static final Logger logger = Logger.getLogger(HttpUtils.class); private static final Logger logger = Logger.getLogger(HttpUtils.class);
@Value("${aai.registry.url}") @Value("${services.provide.aai.registry.url}")
private String registryUrl; private String registryUrl;
@Value("${aai.registry.authentication.username}") @Value("${services.provide.aai.registry.username}")
private String user; private String user;
@Value("${aai.registry.authentication.password}") @Value("${services.provide.aai.registry.password}")
private String password; private String password;
public JsonElement post(String path, JsonObject body) { public JsonElement post(String path, JsonObject body) {

View File

@ -1,113 +1,58 @@
#container.hostname = dl114.madgik.di.uoa.gr
#container.hostname = mpagasas.di.uoa.gr
#container.hostname = adonis.athenarc.gr
container.hostname = estella.athenarc.gr
provider.endpoint=http://estella.athenarc.gr:8480/uoa-repository-manager-service
# EMAIL SETTINGS # EMAIL SETTINGS
services.repomanager.mail.host = smtp.gmail.com services.provide.mail.host = smtp.gmail.com
services.repomanager.mail.port = 465 services.provide.mail.port = 465
services.repomanager.mail.username = test.openaire@gmail.com services.provide.mail.username = test.openaire@gmail.com
services.repomanager.mail.password = ^($*@$)*!$ services.provide.mail.password = ^($*@$)*!$
services.repomanager.mail.authenticate = true services.provide.mail.authenticate = true
services.repomanager.mail.debug = false services.provide.mail.debug = false
services.repomanager.mail.mode = ssl services.provide.mail.mode = ssl
services.repomanager.mail.from = test.openaire@gmail.com services.provide.mail.from = test.openaire@gmail.com
services.repomanager.mail.replyTo = test.openaire@gmail.com services.provide.mail.replyTo = test.openaire@gmail.com
# IS # IS
ISLookUpService.url = https://dev-openaire.d4science.org:443/is/services/isLookUp services.provide.iSLookUpService.url = https://dev-openaire.d4science.org:443/is/services/isLookUp
ValidatorService.url=http://88.197.53.69:8080/uoa-validator-service/services/validatorWebService services.provide.validatorService.url = http://88.197.53.69:8080/uoa-validator-service/services/validatorWebService
# LDAP
#services.validator.ldap.address = 88.197.53.113
#services.validator.ldap.address = 194.197.192.119
#services.validator.ldap.port = 389
#services.validator.ldap.username = cn=admin,dc=openaire,dc=eu
#services.validator.ldap.password = serenata
#services.validator.ldap.usersDN = ou=users,dc=openaire,dc=eu
#
#services.users.ldap.address = 194.177.192.119
#services.users.ldap.port = 389
#services.users.ldap.username = cn=admin,dc=openaire,dc=eu
#services.users.ldap.password = serenata
#services.users.ldap.usersDN = ou=users,dc=openaire,dc=eu
#
#services.validator.ldap.address = 194.177.192.119
#services.validator.ldap.port = 389
#services.validator.ldap.username = cn=admin,dc=openaire,dc=eu
#services.validator.ldap.password = serenata
#services.validator.ldap.usersDN = ou=users,dc=openaire,dc=eu
#AAI-REDIS #AAI-REDIS
redis.host = localhost services.provide.redis.host = localhost
redis.port = 6379 services.provide.redis.port = 6379
redis.password = 2106875370 services.provide.redis.password = 2106875370
oidc.dev.home = http://88.197.53.69/api/openid_connect_login services.provide.db.driverClassName=org.postgresql.Driver
webapp.dev.front = http://88.197.53.69/join services.provide.db.url=jdbc:postgresql://localhost:5432/repomanager
services.provide.db.username=dnet
services.provide.db.password=dnetPwd
services.repomanager.db.driverClassName=org.postgresql.Driver services.provide.clients.search=https://beta.services.openaire.eu/search/v2/api
services.repomanager.db.url=jdbc:postgresql://localhost:5432/repomanager services.provide.clients.usagestats=https://services.openaire.eu/usagestats
services.repomanager.db.username=dnet services.provide.clients.usageEvents=http://beta.lbs.openaire.eu:8080/ajax/summary
services.repomanager.db.password=dnetPwd services.provide.clients.dsm=http://beta.services.openaire.eu/openaire
#infrastructure.name=integration
#transport.soap.baseAddress=http://${container.hostname}:${container.port}/${container.context} services.provide.baseUrl=https://beta.provide.openaire.eu/
#transport.soap.force.local.address=false services.provide.usageStatisticsDiagramsBaseURL=https://beta.openaire.eu/stats3/
#services.validator.mail.host=smtp.gmail.com services.provide.usageStatisticsNumbersBaseURL=https://beta.services.openaire.eu/usagestats/datasources/
#services.validator.mail.port=465 services.provide.usagestats.adminEmail=antleb@di.uoa.gr
#services.validator.mail.fromAddress=no-reply@openaire.eu services.provide.usagestats.sushiliteEndpoint=http://beta.services.openaire.eu/usagestats/sushilite/
#services.validator.mail.replyToAddress=no-reply@openaire.eu services.provide.analyticsURL=https://analytics.openaire.eu/addsite.php?
#services.validator.mail.username=test.openaire@gmail.com
#services.validator.mail.password=^($*@$)*!$
#services.validator.mail.authenticate=true
#services.validator.mail.override=false
#services.validator.mail.logonly=false
#services.validator.mail.mode=ssl
#services.validator.mail.debug=false
#services.validator.mail.overrideEmail=antleb@di.uoa.gr
#services.validator.mail.specialRecipients=antleb@di.uoa.gr
#services.validator.repoRegistration.override=antleb@di.uoa.gr
services.provide.adminEmail=antleb@di.uoa.gr
search.api.baseAddress=https://beta.services.openaire.eu/search/v2/api services.provide.validator.results.url=https://beta.provide.openaire.eu/compatibility/browseHistory/
search.api.usagestats=https://services.openaire.eu/usagestats services.provide.topic_types.url=https://beta.services.openaire.eu/provision/mvc/vocabularies/dnet:topic_types.json
search.api.usageEvents=http://beta.lbs.openaire.eu:8080/ajax/summary services.provide.broker.url=http://broker1-dev-dnet.d4science.org
api.baseAddress=http://beta.services.openaire.eu/openaire services.provide.broker.port=8080
services.repomanager.baseUrl=http://${container.hostname}:${container.port}/${container.context} services.provide.broker.api=api/
services.repomanager.usageStatisticsDiagramsBaseURL=https://beta.openaire.eu/stats3/ services.provide.broker.openaire=openaireBroker
services.repomanager.usageStatisticsNumbersBaseURL=https://beta.services.openaire.eu/usagestats/datasources/
services.repomanager.usagestats.adminEmail=antleb@di.uoa.gr
services.repomanager.usagestats.sushiliteEndpoint=http://beta.services.openaire.eu/usagestats/sushilite/
services.repomanager.analyticsURL=https://analytics.openaire.eu/addsite.php?
aai.mode=develop services.provide.aai.baseURL=https://aai.openaire.eu
services.provide.aai.oidc.redirectURL = http://88.197.53.69/api/openid_connect_login
#uoa-repository-manager-service services.provide.aai.oidc.webURL = http://88.197.53.69/join
#oidc.dev.home=http://88.197.53.69:8080/uoa-repository-manager-service/openid_connect_login services.provide.aai.oidc.issuer=${services.provide.aai.baseURL}/oidc/
#webapp.dev.front=http://88.197.53.69/landing services.provide.aai.oidc.id=767422b9-5461-4807-a80a-f9a2072d3a7d
services.provide.aai.oidc.secret=AMQtGlbTXNjwjhF0st28LmM6V0XypMdaVS7tJmGuYFlmH36iIv4t7tVqYuLYrNPkhnZ_GPUJvhymBhFupdgb6aU
services.repo-manager.adminEmail=antleb@di.uoa.gr services.provide.aai.oidc.domain=.openaire.eu
services.repomanager.usagestats.adminEmail=antleb@di.uoa.gr services.provide.aai.registry.url=${services.provide.aai.baseURL}/registry/
services.repomanager.provide.adminEmail=antleb@di.uoa.gr services.provide.aai.registry.coid=2
validator.results.url=https://beta.provide.openaire.eu/compatibility/browseHistory/ services.provide.aai.registry.production=false
topic_types.url=https://beta.services.openaire.eu/provision/mvc/vocabularies/dnet:topic_types.json services.provide.aai.registry.username=provide_openaire
services.broker.url=http://broker1-dev-dnet.d4science.org services.provide.aai.registry.password=u8WfYv2R^f#y7G98
services.broker.port=8080
services.broker.api=api/
services.broker.openaire=openaireBroker
oidc.url.base=https://aai.openaire.eu
oidc.issuer=${oidc.url.base}/oidc/
aai.registry.url=${oidc.url.base}/registry/
aai.registry.coid=2
aai.registry.production=false
aai.registry.authentication.username=provide_openaire
aai.registry.authentication.password=u8WfYv2R^f#y7G98
oidc.id=767422b9-5461-4807-a80a-f9a2072d3a7d
oidc.secret=AMQtGlbTXNjwjhF0st28LmM6V0XypMdaVS7tJmGuYFlmH36iIv4t7tVqYuLYrNPkhnZ_GPUJvhymBhFupdgb6aU