From 9aa1f48964c6997ac479f4770f782f39f22cce99 Mon Sep 17 00:00:00 2001 From: Leonardo Rivera Date: Thu, 11 Jan 2024 16:38:19 -0500 Subject: [PATCH] test profile --- .../score/server/config/KeycloakConfig.java | 2 ++ .../auth/KeycloakAuthorizationService.java | 2 ++ .../src/main/resources/application.yml | 32 +++++++++++-------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/score-server/src/main/java/bio/overture/score/server/config/KeycloakConfig.java b/score-server/src/main/java/bio/overture/score/server/config/KeycloakConfig.java index 9f8b2c48..6a834788 100644 --- a/score-server/src/main/java/bio/overture/score/server/config/KeycloakConfig.java +++ b/score-server/src/main/java/bio/overture/score/server/config/KeycloakConfig.java @@ -4,11 +4,13 @@ import lombok.Getter; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Profile; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.util.UriComponentsBuilder; @Configuration +@Profile("secure") @Getter public class KeycloakConfig { diff --git a/score-server/src/main/java/bio/overture/score/server/repository/auth/KeycloakAuthorizationService.java b/score-server/src/main/java/bio/overture/score/server/repository/auth/KeycloakAuthorizationService.java index df85e210..16be79f2 100644 --- a/score-server/src/main/java/bio/overture/score/server/repository/auth/KeycloakAuthorizationService.java +++ b/score-server/src/main/java/bio/overture/score/server/repository/auth/KeycloakAuthorizationService.java @@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j; import lombok.val; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Profile; import org.springframework.http.*; import org.springframework.http.client.ClientHttpResponse; import org.springframework.security.authentication.BadCredentialsException; @@ -23,6 +24,7 @@ @Slf4j @Service +@Profile("secure") public class KeycloakAuthorizationService { private final KeycloakConfig keycloakConfig; diff --git a/score-server/src/main/resources/application.yml b/score-server/src/main/resources/application.yml index fc6f1a13..7d69eb22 100644 --- a/score-server/src/main/resources/application.yml +++ b/score-server/src/main/resources/application.yml @@ -232,9 +232,9 @@ auth: server: # check API Key endpoint url: https://localhost:8443/oauth/check_token - tokenName: token - clientID: resource - clientSecret: pass + tokenName: apiToken + clientID: score + clientSecret: scoresecret # Define a valid auth provider: ego or keycloak provider: ego # Keycloak config @@ -243,15 +243,15 @@ auth: realm: "myrealm" scope: download: - system: aws.download + system: score.READ study: - prefix: aws. - suffix: .download + prefix: PROGRAMDATA- + suffix: .READ upload: - system: aws.upload + system: score.WRITE study: - prefix: aws. - suffix: .upload + prefix: PROGRAMDATA- + suffix: .WRITE --- @@ -266,20 +266,24 @@ spring: s3: secured: false - endpoint: localhost:9444/s3 - accessKey: AKIAIOSFODNN7EXAMPLE - secretKey: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY + endpoint: http://localhost:8085 + accessKey: minio + secretKey: minio123 # Server server: + port: 8087 bucket: - name.object: test.icgc - name.state: test.icgc + name.object: test.icgc.test + name.state: test.icgc.test upload: clean.enabled: false +metadata: + url: http://localhost:8080 + --- ###############################################################################