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
public class AaiSecurityConfiguration extends WebSecurityConfigurerAdapter {
@Value("${webapp.dev.front}")
@Value("${services.provide.aai.oidc.webURL}")
private String logoutSuccessUrl;
@Value("${oidc.issuer}")
@Value("${services.provide.aai.oidc.issuer}")
private String oidcIssuer;
@Value("${oidc.id}")
@Value("${services.provide.aai.oidc.id}")
private String oidcId;
@Value("${oidc.secret}")
@Value("${services.provide.aai.oidc.secret}")
private String oidcSecret;
@Value("${oidc.dev.home}")
@Value("${services.provide.aai.oidc.redirectURL}")
private String oidcDevHome;
@Value("${webapp.dev.front}")
@Value("${services.provide.aai.oidc.webURL}")
private String webAppFrontEnd;
@Bean

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -33,11 +33,11 @@ public class BrokerServiceImpl implements BrokerService {
@Autowired
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;
@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;
@Value("${topic_types.url}")
@Value("${services.provide.topic_types.url}")
private String topicsURL;
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 RepositoryService repositoryService;
@Value("${services.repomanager.baseUrl}")
@Value("${services.provide.baseUrl}")
private String baseUrl;
@Value("${services.repomanager.usagestats.adminEmail}")
@Value("${services.provide.usagestats.adminEmail}")
private String usageStatsAdminEmail;
@Value("${services.repomanager.provide.adminEmail}")
private String provideAdminEmail;
@Value("${validator.results.url}")
@Value("${services.provide.validator.results.url}")
private String valBaseUrl;
@Autowired

View File

@ -36,7 +36,7 @@ public class PiWikServiceImpl implements PiWikService {
private DataSource dataSource;
@Value("${services.repomanager.analyticsURL}")
@Value("${services.provide.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 gr.uoa.di.driver.enabling.vocabulary.VocabularyLoader;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.http.entity.ContentType;
import org.apache.log4j.Logger;
import org.json.JSONArray;
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.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.util.MimeType;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponents;
@ -62,16 +60,16 @@ public class RepositoryServiceImpl implements RepositoryService {
private final EmailUtils emailUtils;
private final ValidatorService validatorService;
@Value("${api.baseAddress}")
@Value("${services.provide.clients.dsm}")
private String baseAddress;
@Value("${services.repo-manager.adminEmail}")
@Value("${services.provide.adminEmail}")
private String adminEmail;
@Value("${services.repomanager.usageStatisticsDiagramsBaseURL}")
@Value("${services.provide.usageStatisticsDiagramsBaseURL}")
private String usageStatisticsDiagramsBaseURL;
@Value("${services.repomanager.usageStatisticsNumbersBaseURL}")
@Value("${services.provide.usageStatisticsNumbersBaseURL}")
private String usageStatisticsNumbersBaseURL;

View File

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

View File

@ -19,7 +19,7 @@ import java.util.List;
public class SushiliteServiceImpl implements SushiliteService {
@Value("${services.repomanager.usagestats.sushiliteEndpoint}")
@Value("${services.provide.usagestats.sushiliteEndpoint}")
private String usagestatsSushiliteEndpoint;
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
.getLogger(UserServiceImpl.class);
@Value("${oidc.issuer}")
private String oidc_issuer;
@Override
public ResponseEntity<Object> login() {
OIDCAuthenticationToken authentication = (OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication();

View File

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

View File

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

View File

@ -18,13 +18,13 @@ public class HttpUtils {
private static final Logger logger = Logger.getLogger(HttpUtils.class);
@Value("${aai.registry.url}")
@Value("${services.provide.aai.registry.url}")
private String registryUrl;
@Value("${aai.registry.authentication.username}")
@Value("${services.provide.aai.registry.username}")
private String user;
@Value("${aai.registry.authentication.password}")
@Value("${services.provide.aai.registry.password}")
private String password;
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
services.repomanager.mail.host = smtp.gmail.com
services.repomanager.mail.port = 465
services.repomanager.mail.username = test.openaire@gmail.com
services.repomanager.mail.password = ^($*@$)*!$
services.repomanager.mail.authenticate = true
services.repomanager.mail.debug = false
services.repomanager.mail.mode = ssl
services.repomanager.mail.from = test.openaire@gmail.com
services.repomanager.mail.replyTo = test.openaire@gmail.com
services.provide.mail.host = smtp.gmail.com
services.provide.mail.port = 465
services.provide.mail.username = test.openaire@gmail.com
services.provide.mail.password = ^($*@$)*!$
services.provide.mail.authenticate = true
services.provide.mail.debug = false
services.provide.mail.mode = ssl
services.provide.mail.from = test.openaire@gmail.com
services.provide.mail.replyTo = test.openaire@gmail.com
# IS
ISLookUpService.url = https://dev-openaire.d4science.org:443/is/services/isLookUp
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
services.provide.iSLookUpService.url = https://dev-openaire.d4science.org:443/is/services/isLookUp
services.provide.validatorService.url = http://88.197.53.69:8080/uoa-validator-service/services/validatorWebService
#AAI-REDIS
redis.host = localhost
redis.port = 6379
redis.password = 2106875370
services.provide.redis.host = localhost
services.provide.redis.port = 6379
services.provide.redis.password = 2106875370
oidc.dev.home = http://88.197.53.69/api/openid_connect_login
webapp.dev.front = http://88.197.53.69/join
services.provide.db.driverClassName=org.postgresql.Driver
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.repomanager.db.url=jdbc:postgresql://localhost:5432/repomanager
services.repomanager.db.username=dnet
services.repomanager.db.password=dnetPwd
#infrastructure.name=integration
services.provide.clients.search=https://beta.services.openaire.eu/search/v2/api
services.provide.clients.usagestats=https://services.openaire.eu/usagestats
services.provide.clients.usageEvents=http://beta.lbs.openaire.eu:8080/ajax/summary
services.provide.clients.dsm=http://beta.services.openaire.eu/openaire
#transport.soap.baseAddress=http://${container.hostname}:${container.port}/${container.context}
#transport.soap.force.local.address=false
#services.validator.mail.host=smtp.gmail.com
#services.validator.mail.port=465
#services.validator.mail.fromAddress=no-reply@openaire.eu
#services.validator.mail.replyToAddress=no-reply@openaire.eu
#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.baseUrl=https://beta.provide.openaire.eu/
services.provide.usageStatisticsDiagramsBaseURL=https://beta.openaire.eu/stats3/
services.provide.usageStatisticsNumbersBaseURL=https://beta.services.openaire.eu/usagestats/datasources/
services.provide.usagestats.adminEmail=antleb@di.uoa.gr
services.provide.usagestats.sushiliteEndpoint=http://beta.services.openaire.eu/usagestats/sushilite/
services.provide.analyticsURL=https://analytics.openaire.eu/addsite.php?
services.provide.adminEmail=antleb@di.uoa.gr
search.api.baseAddress=https://beta.services.openaire.eu/search/v2/api
search.api.usagestats=https://services.openaire.eu/usagestats
search.api.usageEvents=http://beta.lbs.openaire.eu:8080/ajax/summary
api.baseAddress=http://beta.services.openaire.eu/openaire
services.repomanager.baseUrl=http://${container.hostname}:${container.port}/${container.context}
services.repomanager.usageStatisticsDiagramsBaseURL=https://beta.openaire.eu/stats3/
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?
services.provide.validator.results.url=https://beta.provide.openaire.eu/compatibility/browseHistory/
services.provide.topic_types.url=https://beta.services.openaire.eu/provision/mvc/vocabularies/dnet:topic_types.json
services.provide.broker.url=http://broker1-dev-dnet.d4science.org
services.provide.broker.port=8080
services.provide.broker.api=api/
services.provide.broker.openaire=openaireBroker
aai.mode=develop
#uoa-repository-manager-service
#oidc.dev.home=http://88.197.53.69:8080/uoa-repository-manager-service/openid_connect_login
#webapp.dev.front=http://88.197.53.69/landing
services.repo-manager.adminEmail=antleb@di.uoa.gr
services.repomanager.usagestats.adminEmail=antleb@di.uoa.gr
services.repomanager.provide.adminEmail=antleb@di.uoa.gr
validator.results.url=https://beta.provide.openaire.eu/compatibility/browseHistory/
topic_types.url=https://beta.services.openaire.eu/provision/mvc/vocabularies/dnet:topic_types.json
services.broker.url=http://broker1-dev-dnet.d4science.org
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
services.provide.aai.baseURL=https://aai.openaire.eu
services.provide.aai.oidc.redirectURL = http://88.197.53.69/api/openid_connect_login
services.provide.aai.oidc.webURL = http://88.197.53.69/join
services.provide.aai.oidc.issuer=${services.provide.aai.baseURL}/oidc/
services.provide.aai.oidc.id=767422b9-5461-4807-a80a-f9a2072d3a7d
services.provide.aai.oidc.secret=AMQtGlbTXNjwjhF0st28LmM6V0XypMdaVS7tJmGuYFlmH36iIv4t7tVqYuLYrNPkhnZ_GPUJvhymBhFupdgb6aU
services.provide.aai.oidc.domain=.openaire.eu
services.provide.aai.registry.url=${services.provide.aai.baseURL}/registry/
services.provide.aai.registry.coid=2
services.provide.aai.registry.production=false
services.provide.aai.registry.username=provide_openaire
services.provide.aai.registry.password=u8WfYv2R^f#y7G98