Skip to content

Commit

Permalink
Merge pull request #471 from BBMRI-ERIC/fix/flyway_config
Browse files Browse the repository at this point in the history
refactor: remove redundant properties from config files
  • Loading branch information
RadovanTomik authored Oct 13, 2024
2 parents 005b54a + 2de8a40 commit cb3d4a7
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 51 deletions.
1 change: 0 additions & 1 deletion .github/compose-overrides/compose.override.system.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.9'
services:
negotiator:
volumes:
Expand Down
16 changes: 2 additions & 14 deletions .github/oauth-test/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.9'
services:
oidc-server-mock:
container_name: oidc-server-mock
Expand Down Expand Up @@ -50,41 +49,30 @@ services:
postgres:
condition: service_healthy
environment:
- PROFILE=prod
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres:5432/negotiator
- SPRING_DATASOURCE_USERNAME=negotiator
- SPRING_DATASOURCE_PASSWORD=negotiator
- SPRING_DATASOURCE_INITIALIZE=false
- SPRING_FLYWAY_ENABLED=true
- SPRING_FLYWAY_USER=negotiator
- SPRING_FLYWAY_PASSWORD=negotiator
- SPRING_FLYWAY_URL=jdbc:postgresql://postgres:5432/negotiator
- SPRING_FLYWAY_LOCATIONS=classpath:db/migration/,db/dev/migration
- NEGOTIATOR_FRONTENDURL=https://${HOST}
- NEGOTIATOR_AUTHORIZATION_CLAIM=eduperson_entitlement
- "NEGOTIATOR_AUTHORIZATION_ADMINCLAIMVALUE=urn:geant:bbmri-eric.eu:res:role_admin#perun.bbmri-eric.eu"
- "NEGOTIATOR_AUTHORIZATION_RESEARCHERCLAIMVALUE=urn:geant:bbmri-eric.eu:res:role_researcher#perun.bbmri-eric.eu"
- "NEGOTIATOR_AUTHORIZATION_BIOBANKERCLAIMVALUE=urn:geant:bbmri-eric.eu:res:role_representative#perun.bbmri-eric.eu"
- "NEGOTIATOR_AUTHORIZATION_RESOURCECLAIMPREFIX=urn:geant:bbmri-eric.eu:group:bbmri:collections:BBMRI-ERIC%20Directory:"
- NEGOTIATOR_AUTHORIZATION_SUBJECTCLAIM=sub
- SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_USERINFOURI=http://oidc-server-mock/connect/userinfo
- SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_ISSUERURI=http://localhost:4011
- SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_JWKSETURI=http://oidc-server-mock/.well-known/openid-configuration/jwks
- SPRING_SECURITY_OAUTH2_RESOURCESERVER_JWT_TYPE=jwt
ports:
- '8081:8081'
networks:
- oauth-test
postgres:
container_name: negotiator-db
image: postgres:14
image: postgres:16-alpine
environment:
- POSTGRES_USER=negotiator
- POSTGRES_PASSWORD=negotiator
- POSTGRES_DB=negotiator
healthcheck:
test: [ "CMD-SHELL", "pg_isready", "-d", "negotiator" ]
interval: 15s
interval: 5s
timeout: 60s
retries: 5
volumes:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

![build](https://github.com/BBMRI-ERIC/negotiator-v3/actions/workflows/CI.yml/badge.svg?)
[![codecov](https://codecov.io/github/BBMRI-ERIC/negotiator/graph/badge.svg?token=YN9M34IM3S)](https://codecov.io/github/BBMRI-ERIC/negotiator)
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/BBMRI-ERIC/negotiator/badge)](https://scorecard.dev/viewer/?uri=github.com/BBMRI-ERIC/negotiator)
![Static Badge](https://img.shields.io/badge/Java%20Code%20Style-Google-orange)
![Static Badge](https://img.shields.io/badge/Docker-bbmrieric%2Fnegotiator-blue)

Expand Down
24 changes: 0 additions & 24 deletions src/main/resources/application-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,19 @@ spring:
username: "user"
password: "pass"
datasource:
driver-class-name: org.testcontainers.jdbc.ContainerDatabaseDriver
url: jdbc:tc:postgres:///negotiator
username: negotiator
password: negotiator
database: negotiator
servlet:
multipart:
max-file-size: 2MB
max-request-size: 2MB
sql:
init:
mode: always
platform: postgres
continue-on-error: true
jpa:
hibernate:
ddl-auto: none
defer-datasource-initialization: false
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
flyway:
user: negotiator
password: negotiator
url: jdbc:tc:postgresql:///negotiator
locations: classpath:db/migration/,db/dev/migration
jackson:
date-format: "yyyy-MM-dd"
security:
oauth2:
resourceserver:
jwt:
user-info-uri: "http://localhost:4011/connect/userinfo"
issuer-uri: "http://localhost:4011"
jwk-set-uri: "http://localhost:4011/.well-known/openid-configuration/jwks"
type: "JWT"
audiences: https://negotiator.bbmri-eric.eu
opaquetoken:
client-id: "https%3A//negotiator.bbmri-eric.eu"
Expand All @@ -62,7 +39,6 @@ negotiator:
molgenis-url: "https://bbmritestnn.gcc.rug.nl"
frontend-url: "http://localhost:8080"
authorization:
claim: "eduperson_entitlement"
admin-claim-value: "urn:geant:bbmri-eric.eu:group:bbmri:negotiator_v3:admins#perun.bbmri-eric.eu"
researcher-claim-value: "urn:geant:bbmri-eric.eu:group:bbmri:negotiator_v3:researchers#perun.bbmri-eric.eu"
biobanker-claim-value: "urn:geant:bbmri-eric.eu:group:bbmri:collections:BBMRI-ERIC%20Directory#perun.bbmri-eric.eu"
Expand Down
11 changes: 0 additions & 11 deletions src/main/resources/application-prod.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
spring:
datasource:
driver-class-name: org.postgresql.Driver
url: jdbc:postgresql://localhost:5432/negotiator
username: negotiator
password: negotiator
Expand All @@ -11,19 +10,9 @@ spring:
sql:
init:
mode: never
jpa:
hibernate:
ddl-auto: none
defer-datasource-initialization: false
jackson:
date-format: "yyyy-MM-dd"
flyway:
enabled: true
user:
password:
schemas:
url:
baseline-on-migrate: true
locations: classpath:db/migration/,filesystem:/app/data
logging:
file:
Expand Down
7 changes: 6 additions & 1 deletion src/main/resources/application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ spring:
protocol: "smtp"
application:
name: "Negotiator"
servlet:
multipart:
max-file-size: 5MB
max-request-size: 5MB
jackson:
date-format: "yyyy-MM-dd"
jpa:
Expand Down Expand Up @@ -63,6 +67,7 @@ spring:
user-info-uri: ""
issuer-uri: ""
jwks-url: ""
type: "JWT"
audiences: negotiator-api
profiles:
default: prod
Expand All @@ -73,7 +78,7 @@ negotiator:
emailHelpdeskHref: "mailto:[email protected]"
emailLogo: "http://localhost:8081/api/images/negotiator_logo.png"
authorization:
claim: ""
claim: "eduperson_entitlement"
admin-claim-value: ""
researcher-claim-value: ""
biobanker-claim-value: ""
Expand Down

0 comments on commit cb3d4a7

Please sign in to comment.