Skip to content
Snippets Groups Projects
Unverified Commit 4465db3b authored by Martin Weise's avatar Martin Weise
Browse files

Added more flags

parent 7cbd0f8f
No related branches found
No related tags found
4 merge requests!231CI: Remove build for log-service,!228Better error message handling in the frontend,!223Release of version 1.4.0,!190Resolve "More env variables for Azure deployment"
......@@ -23,6 +23,7 @@ build-analyse-service:
build-docker:
docker build -t dbrepo-metadata-service:build --target build dbrepo-metadata-service
docker build -t dbrepo-search-sync-agent:build --target build dbrepo-search-sync-agent
docker compose build --parallel
build-frontend:
......
......@@ -56,7 +56,7 @@ fda:
issuer: http://localhost/realms/dbrepo
public_key: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAqqnHQ2BWWW9vDNLRCcxD++xZg/16oqMo/c1l+lcFEjjAIJjJp/HqrPYU/U9GvquGE6PbVFtTzW1KcKawOW+FJNOA3CGo8Q1TFEfz43B8rZpKsFbJKvQGVv1Z4HaKPvLUm7iMm8Hv91cLduuoWx6Q3DPe2vg13GKKEZe7UFghF+0T9u8EKzA/XqQ0OiICmsmYPbwvf9N3bCKsB/Y10EYmZRb8IhCoV9mmO5TxgWgiuNeCTtNCv2ePYqL/U0WvyGFW0reasIK8eg3KrAUj8DpyOgPOVBn3lBGf+3KFSYi+0bwZbJZWqbC/Xlk20Go1YfeJPRIt7ImxD27R/lNjgDO/MwIDAQAB
keycloak:
endpoint: "http://authentication-service:8080/api/auth"
endpoint: "http://authentication-service:8080"
username: fda
password: fda
consumers: 2
......
......@@ -41,10 +41,11 @@ public class KeycloakGatewayImpl implements KeycloakGateway {
payload.add("password", keycloakConfig.getKeycloakPassword());
payload.add("grant_type", "password");
payload.add("client_id", "admin-cli");
final String url = keycloakConfig.getKeycloakEndpoint() + "/realms/master/protocol/openid-connect/token";
log.debug("request admin token from url {}", url);
final ResponseEntity<TokenDto> response;
try {
response = restTemplate.exchange("/realms/master/protocol/openid-connect/token",
HttpMethod.POST, new HttpEntity<>(payload, headers), TokenDto.class);
response = restTemplate.exchange(url, HttpMethod.POST, new HttpEntity<>(payload, headers), TokenDto.class);
} catch (ResourceAccessException | HttpServerErrorException.ServiceUnavailable e) {
log.error("Failed to obtain admin token: {}", e.getMessage());
throw new AccessDeniedException("Failed to obtain admin token: " + e.getMessage());
......@@ -59,10 +60,11 @@ public class KeycloakGatewayImpl implements KeycloakGateway {
final HttpHeaders headers = new HttpHeaders();
headers.set("Accept", "application/json");
headers.set("Authorization", "Bearer " + obtainToken().getAccessToken());
final String url = keycloakConfig.getKeycloakEndpoint() + "/admin/realms/dbrepo/users";
log.debug("create user at url {}", url);
final ResponseEntity<Void> response;
try {
response = restTemplate.exchange("/admin/realms/dbrepo/users", HttpMethod.POST,
new HttpEntity<>(data, headers), Void.class);
response = restTemplate.exchange(url, HttpMethod.POST, new HttpEntity<>(data, headers), Void.class);
} catch (ResourceAccessException | HttpServerErrorException.ServiceUnavailable e) {
log.error("Failed to create user: {}", e.getMessage());
throw new KeycloakRemoteException("Failed to create user: " + e.getMessage());
......@@ -89,10 +91,11 @@ public class KeycloakGatewayImpl implements KeycloakGateway {
headers.set("Accept", "application/json");
headers.set("Authorization", "Bearer " + obtainToken().getAccessToken());
final UpdateCredentialsDto payload = userMapper.passwordToUpdateCredentialsDto(data.getPassword());
final String url = keycloakConfig.getKeycloakEndpoint() + "/admin/realms/dbrepo/users/" + id;
log.debug("update user credentials at url {}", url);
final ResponseEntity<Void> response;
try {
response = restTemplate.exchange("/admin/realms/dbrepo/users/" + id, HttpMethod.PUT,
new HttpEntity<>(payload, headers), Void.class);
response = restTemplate.exchange(url, HttpMethod.PUT, new HttpEntity<>(payload, headers), Void.class);
} catch (ResourceAccessException | HttpServerErrorException.ServiceUnavailable e) {
log.error("Failed to update user credentials: {}", e.getMessage());
throw new KeycloakRemoteException("Failed to update user credentials: " + e.getMessage());
......@@ -110,10 +113,11 @@ public class KeycloakGatewayImpl implements KeycloakGateway {
final HttpHeaders headers = new HttpHeaders();
headers.set("Accept", "application/json");
headers.set("Authorization", "Bearer " + obtainToken().getAccessToken());
final String url = keycloakConfig.getKeycloakEndpoint() + "/admin/realms/dbrepo/users/?username=" + username;
log.debug("find user from url {}", url);
final ResponseEntity<UserDto[]> response;
try {
response = restTemplate.exchange("/admin/realms/dbrepo/users/?username=" + username,
HttpMethod.GET, new HttpEntity<>(null, headers), UserDto[].class);
response = restTemplate.exchange(url, HttpMethod.GET, new HttpEntity<>(null, headers), UserDto[].class);
} catch (ResourceAccessException | HttpServerErrorException.ServiceUnavailable e) {
log.error("Failed to find user: {}", e.getMessage());
throw new KeycloakRemoteException("Failed to find user: " + e.getMessage());
......
......@@ -24,10 +24,11 @@ FROM openjdk:17-alpine as runtime
MAINTAINER Martin Weise <martin.weise@tuwien.ac.at>
ENV METADATA_DB=fda
ENV METADATA_HOST=metadata-db
ENV METADATA_JDBC_EXTRA_ARGS=""
ENV METADATA_PASSWORD=dbrepo
ENV METADATA_USERNAME=root
ENV METADATA_PASSWORD=dbrepo
ENV BROKER_USERNAME=fda
ENV BROKER_PASSWORD=fda
ENV SEARCH_USERNAME=fda
ENV SEARCH_PASSWORD=fda
ENV LOG_LEVEL=debug
......
......@@ -4,7 +4,7 @@ spring:
autoconfigure:
exclude: org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration, org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration
datasource:
url: "jdbc:mariadb://metadata-db:3306/${METADATA_DB}"
url: "jdbc:mariadb://${METADATA_HOST}:3306/${METADATA_DB}${METADATA_JDBC_EXTRA_ARGS}"
driver-class-name: org.mariadb.jdbc.Driver
username: "${METADATA_USERNAME}"
password: "${METADATA_PASSWORD}"
......@@ -25,15 +25,13 @@ spring:
jdbc:
time_zone: UTC
application:
name: search-startup-agent
name: search-sync-agent
opensearch:
username: "${SEARCH_USERNAME}"
password: "${SEARCH_PASSWORD}"
host: search-db
port: 9200
protocol: http
cloud:
loadbalancer.ribbon.enabled: false
management:
endpoints:
web:
......
......@@ -101,7 +101,7 @@ export default {
computed: {
loadingColor () {
return this.error ? 'red lighten-2' : 'primary'
},
}
},
mounted () {
this.loadUsers()
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment