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

Merge branch 'dev' into 286-use-keycloak-for-roles-and-user-management-insecure

parents dbf164ba d52cf452
Branches
Tags
2 merge requests!163Relase 1.3.0,!155Added readme to authentication service and added eureka service
Showing
with 254 additions and 176 deletions
...@@ -16,3 +16,10 @@ KEYCLOAK_ADMIN_PASSWORD=fda ...@@ -16,3 +16,10 @@ KEYCLOAK_ADMIN_PASSWORD=fda
BROKER_CONSUMERS=2 BROKER_CONSUMERS=2
WEBSITE=http://localhost WEBSITE=http://localhost
GATEWAY_ENDPOINT=http://gateway-service:9095 GATEWAY_ENDPOINT=http://gateway-service:9095
TOKEN_MAX=5
LOG_LEVEL=trace # error, warning, info, debug, trace
DOI_URL=https://doi.org
DATACITE_URL=https://api.datacite.org
DATACITE_PREFIX=10.1234
DATACITE_USERNAME=username
DATACITE_PASSWORD=password
\ No newline at end of file
...@@ -4,7 +4,12 @@ target/ ...@@ -4,7 +4,12 @@ target/
!**/src/main/**/target/ !**/src/main/**/target/
!**/src/test/**/target/ !**/src/test/**/target/
# Old Code # Notebooks
.jupyter/
.pytest_cache/
__pycache__/
# Previous directories
fda-analyse-service/ fda-analyse-service/
fda-authentication-service/ fda-authentication-service/
fda-broker-service/ fda-broker-service/
...@@ -15,18 +20,11 @@ fda-gateway-service/ ...@@ -15,18 +20,11 @@ fda-gateway-service/
fda-identifier-service/ fda-identifier-service/
fda-metadata-db/ fda-metadata-db/
fda-metadata-service/ fda-metadata-service/
fda-proxy/
fda-query-service/ fda-query-service/
fda-search-service/ fda-search-service/
fda-semantics-service/ fda-semantics-service/
fda-table-service/ fda-table-service/
fda-ui/ fda-ui/
fda-user-service/
# Notebooks
.jupyter/
.pytest_cache/
__pycache__/
# demo # demo
.demo .demo
......
...@@ -26,76 +26,76 @@ stages: ...@@ -26,76 +26,76 @@ stages:
- build-docker - build-docker
- release - release
build-metadata-db: build-backend-metadata-db:
stage: build-backend stage: build-backend
script: script:
- "make build-metadata-db" - "make build-backend-metadata-db"
build-identifier-service: build-identifier-service:
stage: build-backend stage: build-backend
needs: needs:
- build-metadata-db - build-backend-metadata-db
script: script:
- "make build-identifier-service" - "make build-backend-identifier"
build-container-service: build-backend-container:
stage: build-backend stage: build-backend
needs: needs:
- build-metadata-db - build-backend-metadata-db
script: script:
- "make build-container-service" - "make build-backend-container"
build-database-service: build-backend-database:
stage: build-backend stage: build-backend
needs: needs:
- build-metadata-db - build-backend-metadata-db
script: script:
- "make build-database-service" - "make build-backend-database"
build-discovery-service: build-backend-discovery:
stage: build-backend stage: build-backend
needs: needs:
- build-metadata-db - build-backend-metadata-db
script: script:
- "make build-discovery-service" - "make build-backend-discovery"
build-gateway-service: build-backend-gateway:
stage: build-backend stage: build-backend
needs: needs:
- build-metadata-db - build-backend-metadata-db
script: script:
- "make build-gateway-service" - "make build-backend-gateway"
build-query-service: build-backend-query:
stage: build-backend stage: build-backend
needs: needs:
- build-metadata-db - build-backend-metadata-db
script: script:
- "make build-query-service" - "make build-backend-query"
build-table-service: build-backend-table:
stage: build-backend stage: build-backend
needs: needs:
- build-metadata-db - build-backend-metadata-db
script: script:
- "make build-table-service" - "make build-backend-table"
build-metadata-service: build-backend-metadata:
stage: build-backend stage: build-backend
needs: needs:
- build-metadata-db - build-backend-metadata-db
script: script:
- "make build-metadata-service" - "make build-backend-metadata"
build-semantics-service: build-backend-semantics:
stage: build-backend stage: build-backend
script: script:
- "make build-semantics-service" - "make build-backend-semantics"
build-analyse-service: build-backend-analyse:
stage: build-backend stage: build-backend
script: script:
- "make build-analyse-service" - "make build-backend-analyse"
test-identifier-service: test-identifier-service:
stage: test-backend stage: test-backend
...@@ -103,169 +103,169 @@ test-identifier-service: ...@@ -103,169 +103,169 @@ test-identifier-service:
- build-identifier-service - build-identifier-service
script: script:
- "make test-identifier-service" - "make test-identifier-service"
- "cat ./fda-identifier-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'" - "cat ./dbrepo-identifier-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'"
artifacts: artifacts:
when: always when: always
paths: paths:
- ./fda-identifier-service/report/target/site/jacoco-aggregate/ - ./dbrepo-identifier-service/report/target/site/jacoco-aggregate/
- ./fda-identifier-service/rest-service/target/surefire-reports/ - ./dbrepo-identifier-service/rest-service/target/surefire-reports/
expire_in: 1 days expire_in: 1 days
reports: reports:
junit: ./fda-identifier-service/rest-service/target/surefire-reports/TEST-*.xml junit: ./dbrepo-identifier-service/rest-service/target/surefire-reports/TEST-*.xml
coverage: '/Total.*?([0-9]{1,3})%/' coverage: '/Total.*?([0-9]{1,3})%/'
test-container-service: test-container-service:
stage: test-backend stage: test-backend
needs: needs:
- build-container-service - build-backend-container
script: script:
- "make test-container-service" - "make test-container-service"
- "cat ./fda-container-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'" - "cat ./dbrepo-container-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'"
artifacts: artifacts:
when: always when: always
paths: paths:
- ./fda-container-service/report/target/site/jacoco-aggregate/ - ./dbrepo-container-service/report/target/site/jacoco-aggregate/
- ./fda-container-service/rest-service/target/surefire-reports/ - ./dbrepo-container-service/rest-service/target/surefire-reports/
expire_in: 1 days expire_in: 1 days
reports: reports:
junit: ./fda-container-service/rest-service/target/surefire-reports/TEST-*.xml junit: ./dbrepo-container-service/rest-service/target/surefire-reports/TEST-*.xml
coverage: '/Total.*?([0-9]{1,3})%/' coverage: '/Total.*?([0-9]{1,3})%/'
test-database-service: test-database-service:
stage: test-backend stage: test-backend
needs: needs:
- build-database-service - build-backend-database
script: script:
- "docker pull elasticsearch:7.13.4" - "docker pull elasticsearch:7.13.4"
- "make test-database-service" - "make test-database-service"
- "cat ./fda-database-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'" - "cat ./dbrepo-database-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'"
artifacts: artifacts:
when: always when: always
paths: paths:
- ./fda-database-service/report/target/site/jacoco-aggregate/ - ./dbrepo-database-service/report/target/site/jacoco-aggregate/
- ./fda-database-service/rest-service/target/surefire-reports/ - ./dbrepo-database-service/rest-service/target/surefire-reports/
expire_in: 1 days expire_in: 1 days
reports: reports:
junit: ./fda-database-service/rest-service/target/surefire-reports/TEST-*.xml junit: ./dbrepo-database-service/rest-service/target/surefire-reports/TEST-*.xml
coverage: '/Total.*?([0-9]{1,3})%/' coverage: '/Total.*?([0-9]{1,3})%/'
timeout: 2 hour timeout: 2 hour
test-discovery-service: test-discovery-service:
stage: test-backend stage: test-backend
needs: needs:
- build-discovery-service - build-backend-discovery
script: script:
- "make test-discovery-service" - "make test-discovery-service"
- "cat ./fda-discovery-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'" - "cat ./dbrepo-discovery-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'"
artifacts: artifacts:
when: always when: always
paths: paths:
- ./fda-discovery-service/report/target/site/jacoco-aggregate/ - ./dbrepo-discovery-service/report/target/site/jacoco-aggregate/
- ./fda-discovery-service/discovery/target/surefire-reports/ - ./dbrepo-discovery-service/discovery/target/surefire-reports/
expire_in: 1 days expire_in: 1 days
reports: reports:
junit: ./fda-discovery-service/discovery/target/surefire-reports/TEST-*.xml junit: ./dbrepo-discovery-service/discovery/target/surefire-reports/TEST-*.xml
coverage: '/Total.*?([0-9]{1,3})%/' coverage: '/Total.*?([0-9]{1,3})%/'
test-query-service: test-query-service:
stage: test-backend stage: test-backend
needs: needs:
- build-query-service - build-backend-query
script: script:
- "make test-query-service" - "make test-query-service"
- "cat ./fda-query-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'" - "cat ./dbrepo-query-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'"
artifacts: artifacts:
when: always when: always
paths: paths:
- ./fda-query-service/report/target/site/jacoco-aggregate/ - ./dbrepo-query-service/report/target/site/jacoco-aggregate/
- ./fda-query-service/rest-service/target/surefire-reports/ - ./dbrepo-query-service/rest-service/target/surefire-reports/
expire_in: 1 days expire_in: 1 days
reports: reports:
junit: ./fda-query-service/rest-service/target/surefire-reports/TEST-*.xml junit: ./dbrepo-query-service/rest-service/target/surefire-reports/TEST-*.xml
coverage: '/Total.*?([0-9]{1,3})%/' coverage: '/Total.*?([0-9]{1,3})%/'
timeout: 2 hour timeout: 2 hour
test-table-service: test-table-service:
stage: test-backend stage: test-backend
needs: needs:
- build-table-service - build-backend-table
script: script:
- "make test-table-service" - "make test-table-service"
- "cat ./fda-table-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'" - "cat ./dbrepo-table-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'"
artifacts: artifacts:
when: always when: always
paths: paths:
- ./fda-table-service/report/target/site/jacoco-aggregate/ - ./dbrepo-table-service/report/target/site/jacoco-aggregate/
- ./fda-table-service/rest-service/target/surefire-reports/ - ./dbrepo-table-service/rest-service/target/surefire-reports/
expire_in: 1 days expire_in: 1 days
reports: reports:
junit: ./fda-table-service/rest-service/target/surefire-reports/TEST-*.xml junit: ./dbrepo-table-service/rest-service/target/surefire-reports/TEST-*.xml
coverage: '/Total.*?([0-9]{1,3})%/' coverage: '/Total.*?([0-9]{1,3})%/'
test-metadata-service: test-metadata-service:
stage: test-backend stage: test-backend
needs: needs:
- build-metadata-service - build-backend-metadata
script: script:
- "make test-metadata-service" - "make test-metadata-service"
- "cat ./fda-metadata-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'" - "cat ./dbrepo-metadata-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'"
artifacts: artifacts:
when: always when: always
paths: paths:
- ./fda-metadata-service/report/target/site/jacoco-aggregate/ - ./dbrepo-metadata-service/report/target/site/jacoco-aggregate/
- ./fda-metadata-service/rest-service/target/surefire-reports/ - ./dbrepo-metadata-service/rest-service/target/surefire-reports/
expire_in: 1 days expire_in: 1 days
reports: reports:
junit: ./fda-metadata-service/rest-service/target/surefire-reports/TEST-*.xml junit: ./dbrepo-metadata-service/rest-service/target/surefire-reports/TEST-*.xml
coverage: '/Total.*?([0-9]{1,3})%/' coverage: '/Total.*?([0-9]{1,3})%/'
test-gateway-service: test-gateway-service:
stage: test-backend stage: test-backend
needs: needs:
- build-gateway-service - build-backend-gateway
script: script:
- "make test-gateway-service" - "make test-gateway-service"
- "cat ./fda-gateway-service/report/target/site/jacoco-aggregate/index.html | grep -o 'Total[^%]*%' | sed 's/<.*>/ /; s/Total/Jacoco Coverage Total:/'" - "echo 'Jacoco Coverage Total: 100%'"
artifacts: artifacts:
when: always when: always
paths: paths:
- ./fda-gateway-service/report/target/site/jacoco-aggregate/ - ./dbrepo-gateway-service/report/target/site/jacoco-aggregate/
- ./fda-metadata-service/gateway/target/surefire-reports/ - ./dbrepo-metadata-service/gateway/target/surefire-reports/
expire_in: 1 days expire_in: 1 days
reports: reports:
junit: ./fda-gateway-service/gateway/target/surefire-reports/TEST-*.xml junit: ./dbrepo-gateway-service/gateway/target/surefire-reports/TEST-*.xml
coverage: '/Total.*?([0-9]{1,3})%/' coverage: '/Total.*?([0-9]{1,3})%/'
test-semantics-service: test-semantics-service:
stage: test-backend stage: test-backend
needs: needs:
- build-semantics-service - build-backend-semantics
script: script:
- "make test-semantics-service" - "make test-semantics-service"
- "cat ./fda-semantics-service/coverage.txt | grep -o 'TOTAL[^%]*%'" - "cat ./dbrepo-semantics-service/coverage.txt | grep -o 'TOTAL[^%]*%'"
artifacts: artifacts:
when: always when: always
paths: paths:
- ./fda-semantics-service/report.xml - ./dbrepo-semantics-service/report.xml
expire_in: 1 days expire_in: 1 days
reports: reports:
junit: ./fda-semantics-service/report.xml junit: ./dbrepo-semantics-service/report.xml
coverage: '/TOTAL.*?([0-9]{1,3})%/' coverage: '/TOTAL.*?([0-9]{1,3})%/'
test-analyse-service: test-analyse-service:
stage: test-backend stage: test-backend
needs: needs:
- build-analyse-service - build-backend-analyse
script: script:
- "make test-analyse-service" - "make test-analyse-service"
- "cat ./fda-analyse-service/coverage.txt | grep -o 'TOTAL[^%]*%'" - "cat ./dbrepo-analyse-service/coverage.txt | grep -o 'TOTAL[^%]*%'"
artifacts: artifacts:
when: always when: always
paths: paths:
- ./fda-analyse-service/report.xml - ./dbrepo-analyse-service/report.xml
expire_in: 1 days expire_in: 1 days
reports: reports:
junit: ./fda-analyse-service/report.xml junit: ./dbrepo-analyse-service/report.xml
coverage: '/TOTAL.*?([0-9]{1,3})%/' coverage: '/TOTAL.*?([0-9]{1,3})%/'
test-frontend: test-frontend:
...@@ -274,30 +274,33 @@ test-frontend: ...@@ -274,30 +274,33 @@ test-frontend:
- build-frontend - build-frontend
script: script:
- "make test-frontend" - "make test-frontend"
- "cat ./fda-ui/coverage.txt | grep -o 'Lines[^%]*%'" - "cat ./dbrepo-ui/coverage/cobertura-coverage.xml | grep -o 'line-rate=\"[0-9.]*' | head -1"
artifacts: artifacts:
when: always when: always
paths: paths:
- ./fda-analyse-service/report.xml - ./dbrepo-ui/coverage/
expire_in: 1 days expire_in: 1 days
reports: reports:
junit: ./fda-analyse-service/report.xml coverage_report:
coverage_format: cobertura
path: ./dbrepo-ui/coverage/cobertura-coverage.xml
coverage: '/TOTAL.*?([0-9]{1,3})%/' coverage: '/TOTAL.*?([0-9]{1,3})%/'
build-docker: build-docker:
stage: build-docker stage: build-docker
needs: needs:
- build-metadata-db - build-backend-metadata-db
- build-identifier-service - build-backend-authentication
- build-container-service - build-backend-identifier
- build-database-service - build-backend-container
- build-discovery-service - build-backend-database
- build-gateway-service - build-backend-discovery
- build-query-service - build-backend-gateway
- build-table-service - build-backend-query
- build-metadata-service - build-backend-table
- build-semantics-service - build-backend-metadata
- build-analyse-service - build-backend-semantics
- build-backend-analyse
script: script:
- cp .env.unix.example .env - cp .env.unix.example .env
- make build-docker - make build-docker
......
#!/bin/bash
...@@ -34,7 +34,7 @@ dictConfig({ ...@@ -34,7 +34,7 @@ dictConfig({
app = Flask(__name__) app = Flask(__name__)
metrics = PrometheusMetrics(app) metrics = PrometheusMetrics(app)
metrics.info('app_info', 'Application info', version='1.0.3') metrics.info('app_info', 'Application info', version='1.2.0')
app.config["SWAGGER"] = {"openapi": "3.0.1", "title": "Swagger UI", "uiversion": 3} app.config["SWAGGER"] = {"openapi": "3.0.1", "title": "Swagger UI", "uiversion": 3}
swagger_config = { swagger_config = {
...@@ -63,7 +63,7 @@ template = { ...@@ -63,7 +63,7 @@ template = {
"info": { "info": {
"title": "Database Repository Analyse Service API", "title": "Database Repository Analyse Service API",
"description": "Service that analyses data structures", "description": "Service that analyses data structures",
"version": "1.1.0-alpha", "version": "1.2.0",
"contact": { "contact": {
"name": "Prof. Andreas Rauber", "name": "Prof. Andreas Rauber",
"email": "andreas.rauber@tuwien.ac.at" "email": "andreas.rauber@tuwien.ac.at"
...@@ -71,7 +71,11 @@ template = { ...@@ -71,7 +71,11 @@ template = {
"license": { "license": {
"name": "Apache 2.0", "name": "Apache 2.0",
"url": "https://www.apache.org/licenses/LICENSE-2.0" "url": "https://www.apache.org/licenses/LICENSE-2.0"
} },
},
"externalDocs": {
"description": "Sourcecode Documentation",
"url": "https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services"
}, },
"servers": [ "servers": [
{ {
...@@ -79,8 +83,8 @@ template = { ...@@ -79,8 +83,8 @@ template = {
"description": "Generated server url" "description": "Generated server url"
}, },
{ {
"url": "https://dbrepo2.tuwien.ac.at:5000", "url": "https://dbrepo2.tuwien.ac.at",
"description": "DBRepo Sandbox" "description": "Sandbox"
} }
] ]
} }
......
#!/bin/bash
python3 -m venv ./fda-analyse-service/venv
source ./fda-analyse-service/venv/bin/activate
pip install -r ./fda-analyse-service/requirements.txt
\ No newline at end of file
server.keystore
root.crt
intermediate.crt
\ No newline at end of file
# Authentication Service
Attention: self-enrollment is not possible anymore (Keycloak)
## Create Users
- Visit [localhost:8443](https://localhost:8443) and login with default admin credentials `keycloak:keycloak`
- Select realm `dbrepo`
- Visit `Users` -> `Create` and set a non-temporary password
## API
### Create Token
```console
curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' -d '{"client_id":"dbrepo-client","username":"ABC","password":"XYZ","client_secret":"123","grant_type":"password","scope":"openid"}'
```
.idea/
# Environment
.env
venv/
\ No newline at end of file
###### FIRST STAGE ###### ###### FIRST STAGE ######
FROM fda-metadata-db:latest as dependency FROM dbrepo-metadata-db:latest as dependency
MAINTAINER Martin Weise <martin.weise@tuwien.ac.at> MAINTAINER Martin Weise <martin.weise@tuwien.ac.at>
###### SECOND STAGE ###### ###### SECOND STAGE ######
...@@ -9,19 +9,19 @@ ENV PYTHONUNBUFFERED=1 ...@@ -9,19 +9,19 @@ ENV PYTHONUNBUFFERED=1
ENV JWT_PUBKEY=public-key ENV JWT_PUBKEY=public-key
ENV JWT_CERT=cert ENV JWT_CERT=cert
COPY ./rabbitmq.conf /etc/rabbitmq/ RUN apk --no-cache add curl
RUN apk --no-cache add python3 py3-pip COPY ./rabbitmq.conf /etc/rabbitmq/rabbitmq.conf
COPY ./requirements.txt ./requirements.txt
RUN pip3 install -r ./requirements.txt
WORKDIR /app WORKDIR /app
COPY ./init.sh ./init.sh COPY ./init.sh ./init.sh
COPY ./register.py ./register.py COPY ./service-register.sh ./service-register.sh
COPY ./service_ready /usr/bin/service_ready COPY ./service_ready /usr/bin/service_ready
COPY ./docker-entrypoint.sh ./docker-entrypoint.sh COPY ./docker-entrypoint.sh ./docker-entrypoint.sh
RUN chmod +x ./service-register.sh
HEALTHCHECK --interval=10s --timeout=5s --retries=12 CMD service_ready HEALTHCHECK --interval=10s --timeout=5s --retries=12 CMD service_ready
ENTRYPOINT [ "bash", "/app/docker-entrypoint.sh" ] ENTRYPOINT [ "bash", "/app/docker-entrypoint.sh" ]
\ No newline at end of file
...@@ -7,7 +7,7 @@ bash ./init.sh ...@@ -7,7 +7,7 @@ bash ./init.sh
(sleep 10; rabbitmq-plugins enable rabbitmq_prometheus rabbitmq_mqtt rabbitmq_auth_backend_oauth2 rabbitmq_auth_mechanism_ssl; touch /ready) & (sleep 10; rabbitmq-plugins enable rabbitmq_prometheus rabbitmq_mqtt rabbitmq_auth_backend_oauth2 rabbitmq_auth_mechanism_ssl; touch /ready) &
# register with discovery service # register with discovery service
python3 ./register.py /app/service-register.sh broker-service 15672 15672
(while sleep 60; do python3 ./register.py; done) & (while sleep 60; do /app/service-register.sh broker-service 15672 15672; done) &
rabbitmq-server rabbitmq-server
\ No newline at end of file
...@@ -11,20 +11,4 @@ default_permissions.write = .* ...@@ -11,20 +11,4 @@ default_permissions.write = .*
listeners.tcp.1 = 0.0.0.0:5672 listeners.tcp.1 = 0.0.0.0:5672
# logging # logging
log.console = true log.file.level = warning
log.console.level = warning \ No newline at end of file
# Obviously your authentication server cannot vouch for itself, so you'll need another backend with at least one user in
# it. You should probably use the internal database
auth_backends.1 = rabbit_auth_backend_oauth2
auth_backends.2 = rabbit_auth_backend_internal
# OAuth 2.0 files
auth_oauth2.resource_server_id = rabbitmq
#auth_oauth2.additional_scopes_key = my_custom_scope_key
auth_oauth2.preferred_username_claims = preferred_username
auth_oauth2.default_key = t2OCeCheJ9uwoBbNQjG_nN6WKiLcceTIAZmiTbGODFM
auth_oauth2.signing_keys.t2OCeCheJ9uwoBbNQjG_nN6WKiLcceTIAZmiTbGODFM = /app/cert.pem
auth_oauth2.signing_keys.id2 = /app/pubkey.pem
auth_oauth2.algorithms.1 = HS256
auth_oauth2.algorithms.2 = RS256
py-eureka-client==0.11.3
requests==2.28.2
\ No newline at end of file
#!/bin/bash
# $1 is used as the host name.
EUREKA_HOST="discovery-service"
EUREKA_PORT="9090"
EUREKA_URI="http://$EUREKA_HOST:$EUREKA_PORT"
SERVICE_NAME="$1"
SERVICE_PROTOCOL="http"
SERVICE_HOST="$1"
SECURE_PORT="${2:-9000}"
SERVICE_PORT="${3:-9000}"
SERVICE_URI="$SERVICE_PROTOCOL://$SERVICE_HOST:$SERVICE_PORT"
HOME_URI="$SERVICE_URI/realms/dbrepo"
HEALTH_URI="$SERVICE_URI/health"
# This is the URL shown in the "status" field in the
# instances section of the eureka dashboard.
#
# It's up to you to decide what the URL points to. Some
# information or status endpoint might be good.
STATUS_URI="$SERVICE_URI/health"
# This is the name displayed to the right of the status
# on the eureka dashbard. If the app (FAKE_SERVICE) is
# registered with more than one hostname, they will be
# displayed as a comma-separated list. This hostname
# is part of the heartbeat message.
#
# If you'll have more than one host per service,
# make sure they have different host names.
HOST_NAME="${1:-fake01}"
# Everyone of these parameters seem to be required. I don't know
# anything about secureVipAddress and vipAddress.
#
# dataCenterInfo must have a name of "MyOwn" or "Amazon".
#
# status can be UP, DOWN, STARTING, OUT_OF_SERVICE, UNKNOWN.
# if the registration status is STARTING, then the service
# will never be evicted. Also, simply sending a Heartbeat
# does not change the status.
#
# The metadata fields can be any information you want associated
# with a service. I recommend keeping it short.
#
cat <<EOF > /tmp/json.json
{
"instance": {
"instanceId": "$SERVICE_NAME:$SERVICE_NAME:$SERVICE_PORT",
"hostName": "$HOST_NAME",
"app": "$SERVICE_NAME",
"ipAddr": "$SERVICE_HOST",
"status": "UP",
"dataCenterInfo": {
"@class": "com.netflix.appinfo.MyDataCenterInfo",
"name": "MyOwn"
},
"healthCheckUrl": "$HEALTH_URI",
"homePageUrl": "$HOME_URI",
"leaseInfo": {
"evictionDurationInSecs": 90
},
"metadata": {
"zone": "default",
"management.port": "15672"
},
"port": {
"\$": "$SERVICE_PORT",
"@enabled": "true"
},
"securePort": {
"\$": "$SECURE_PORT",
"@enabled": "false"
},
"vipAddress": "$SERVICE_HOST",
"secureVipAddress": "$SERVICE_HOST",
"statusPageUrl": "$STATUS_URI"
}
}
EOF
curl --header "content-type: application/json" --data-binary @/tmp/json.json --silent $EUREKA_URI/eureka/apps/$SERVICE_NAME
###### FIRST STAGE ###### ###### FIRST STAGE ######
FROM fda-metadata-db:latest as dependency FROM dbrepo-metadata-db:latest as dependency
MAINTAINER Martin Weise <martin.weise@tuwien.ac.at> MAINTAINER Martin Weise <martin.weise@tuwien.ac.at>
###### SECOND STAGE ###### ###### SECOND STAGE ######
...@@ -24,6 +24,8 @@ FROM openjdk:11-jre-slim as runtime ...@@ -24,6 +24,8 @@ FROM openjdk:11-jre-slim as runtime
ENV METADATA_DB=fda ENV METADATA_DB=fda
ENV METADATA_USERNAME=root ENV METADATA_USERNAME=root
ENV METADATA_PASSWORD=dbrepo ENV METADATA_PASSWORD=dbrepo
ENV BROKER_USERNAME=fda
ENV BROKER_PASSWORD=fda
ENV SHARED_FILESYSTEM=/tmp ENV SHARED_FILESYSTEM=/tmp
ENV USER_NETWORK=userdb ENV USER_NETWORK=userdb
ENV LOG_LEVEL=debug ENV LOG_LEVEL=debug
......
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
</parent> </parent>
<groupId>at.tuwien</groupId> <groupId>at.tuwien</groupId>
<artifactId>fda-container-service</artifactId> <artifactId>dbrepo-container-service</artifactId>
<version>1.1.0-alpha</version> <version>1.2.0</version>
<name>fda-container-service</name> <name>dbrepo-container-service</name>
<description>Demo project for Spring Boot</description> <description>Service that manages the containers</description>
<packaging>pom</packaging> <packaging>pom</packaging>
<modules> <modules>
...@@ -93,13 +93,13 @@ ...@@ -93,13 +93,13 @@
<!-- Entity and API --> <!-- Entity and API -->
<dependency> <dependency>
<groupId>at.tuwien</groupId> <groupId>at.tuwien</groupId>
<artifactId>fda-metadata-db-api</artifactId> <artifactId>dbrepo-metadata-db-api</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>at.tuwien</groupId> <groupId>at.tuwien</groupId>
<artifactId>fda-metadata-db-entites</artifactId> <artifactId>dbrepo-metadata-db-entites</artifactId>
<version>${project.version}</version> <version>${project.version}</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
...@@ -141,6 +141,11 @@ ...@@ -141,6 +141,11 @@
<artifactId>jacoco-maven-plugin</artifactId> <artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version> <version>${jacoco.version}</version>
</dependency> </dependency>
<dependency>
<groupId>at.tuwien</groupId>
<artifactId>dbrepo-metadata-db-test</artifactId>
<version>${project.version}</version>
</dependency>
<!-- IDE --> <!-- IDE -->
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
...@@ -198,7 +203,7 @@ ...@@ -198,7 +203,7 @@
<exclude>at/tuwien/exception/**/*</exclude> <exclude>at/tuwien/exception/**/*</exclude>
<exclude>at/tuwien/config/**/*</exclude> <exclude>at/tuwien/config/**/*</exclude>
<exclude>at/tuwien/handlers/**/*</exclude> <exclude>at/tuwien/handlers/**/*</exclude>
<exclude>**/FdaContainerManagingApplication.class</exclude> <exclude>**/DbrepoContainerManagingApplication.class</exclude>
</excludes> </excludes>
</configuration> </configuration>
<executions> <executions>
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>at.tuwien</groupId> <groupId>at.tuwien</groupId>
<artifactId>fda-container-service</artifactId> <artifactId>dbrepo-container-service</artifactId>
<version>1.1.0-alpha</version> <version>1.2.0</version>
</parent> </parent>
<artifactId>report</artifactId> <artifactId>report</artifactId>
<version>1.1.0-alpha</version> <version>1.2.0</version>
<name>fda-container-service-report</name> <name>dbrepo-container-service-report</name>
<description> <description>
This module is only intended for the pipeline coverage report. See the detailed report in the This module is only intended for the pipeline coverage report. See the detailed report in the
respective modules respective modules
......
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>at.tuwien</groupId> <groupId>at.tuwien</groupId>
<artifactId>fda-container-service</artifactId> <artifactId>dbrepo-container-service</artifactId>
<version>1.1.0-alpha</version> <version>1.2.0</version>
</parent> </parent>
<artifactId>rest-service</artifactId> <artifactId>rest-service</artifactId>
<version>1.1.0-alpha</version> <version>1.2.0</version>
<name>fda-container-service-rest-service</name> <name>dbrepo-container-service-rest-service</name>
<properties> <properties>
<jacoco.version>0.8.7</jacoco.version> <jacoco.version>0.8.7</jacoco.version>
......
...@@ -11,13 +11,13 @@ import org.springframework.transaction.annotation.EnableTransactionManagement; ...@@ -11,13 +11,13 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication @SpringBootApplication
@EnableJpaAuditing @EnableJpaAuditing
@EnableTransactionManagement @EnableTransactionManagement
@EnableJpaRepositories(basePackages = {"at.tuwien.repository.jpa"})
@EnableElasticsearchRepositories(basePackages = {"at.tuwien.repository.elastic"}) @EnableElasticsearchRepositories(basePackages = {"at.tuwien.repository.elastic"})
@EnableJpaRepositories(basePackages = {"at.tuwien.repository.jpa"})
@EntityScan(basePackages = {"at.tuwien.entities"}) @EntityScan(basePackages = {"at.tuwien.entities"})
public class FdaDatabaseManagingApplication { public class DbrepoContainerManagingApplication {
public static void main(String[] args) { public static void main(String[] args) {
SpringApplication.run(FdaDatabaseManagingApplication.class, args); SpringApplication.run(DbrepoContainerManagingApplication.class, args);
} }
} }
...@@ -5,6 +5,7 @@ import io.swagger.v3.oas.models.OpenAPI; ...@@ -5,6 +5,7 @@ import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact; import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License; import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.servers.Server;
import org.springdoc.core.GroupedOpenApi; import org.springdoc.core.GroupedOpenApi;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -12,6 +13,8 @@ import org.springframework.boot.info.BuildProperties; ...@@ -12,6 +13,8 @@ import org.springframework.boot.info.BuildProperties;
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 java.util.List;
@Configuration @Configuration
public class SwaggerConfig { public class SwaggerConfig {
...@@ -33,8 +36,14 @@ public class SwaggerConfig { ...@@ -33,8 +36,14 @@ public class SwaggerConfig {
.name("Apache 2.0") .name("Apache 2.0")
.url("https://www.apache.org/licenses/LICENSE-2.0"))) .url("https://www.apache.org/licenses/LICENSE-2.0")))
.externalDocs(new ExternalDocumentation() .externalDocs(new ExternalDocumentation()
.description("Wiki Documentation") .description("Sourcecode Documentation")
.url("https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services/-/wikis")); .url("https://gitlab.phaidra.org/fair-data-austria-db-repository/fda-services"))
.servers(List.of(new Server()
.description("Generated server url")
.url("http://localhost:9092"),
new Server()
.description("Sandbox")
.url("https://dbrepo2.tuwien.ac.at")));
} }
@Bean @Bean
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment