Skip to content

Commit 8f9cf6a

Browse files
authored
Merge pull request #663 from overture-stack/rc/4.3.0
Release Candidate 4.3.0
2 parents b799468 + a70b8a6 commit 8f9cf6a

32 files changed

+928
-56
lines changed

docker-compose.yml

+18-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '3.7'
22
services:
33
ego-api:
4-
image: "overture/ego:latest"
4+
image: "overture/ego:3.1.0"
55
environment:
66
SERVER_PORT: 8080
77
SPRING_DATASOURCE_URL: jdbc:postgresql://ego-postgres:5432/ego?stringtype=unspecified
@@ -18,7 +18,7 @@ services:
1818
depends_on:
1919
- ego-postgres
2020
ego-postgres:
21-
image: postgres:9.5
21+
image: postgres:11.1
2222
environment:
2323
- POSTGRES_DB=ego
2424
- POSTGRES_PASSWORD=password
@@ -43,7 +43,7 @@ services:
4343
ports:
4444
- "8085:9000"
4545
score-server:
46-
image: overture/score-server:latest
46+
image: overture/score-server:5.0.0
4747
user: "$MY_UID:$MY_GID"
4848
environment:
4949
SPRING_PROFILES_ACTIVE: amazon,collaboratory,prod,secure
@@ -57,11 +57,16 @@ services:
5757
S3_ACCESSKEY: minio
5858
S3_SECRETKEY: minio123
5959
S3_SIGV4ENABLED: "true"
60-
AUTH_SERVER_URL: http://ego-api:8080/o/check_token/
60+
AUTH_SERVER_URL: http://ego-api:8080/o/check_api_key/
6161
AUTH_SERVER_CLIENTID: score
6262
AUTH_SERVER_CLIENTSECRET: scoresecret
63-
AUTH_SERVER_UPLOADSCOPE: score.WRITE
64-
AUTH_SERVER_DOWNLOADSCOPE: score.READ
63+
AUTH_SERVER_TOKENNAME: apiKey
64+
AUTH_SERVER_SCOPE_DOWNLOAD_SYSTEM: score.READ
65+
AUTH_SERVER_SCOPE_DOWNLOAD_STUDY_PREFIX: score.
66+
AUTH_SERVER_SCOPE_DOWNLOAD_STUDY_SUFFIX: .READ
67+
AUTH_SERVER_SCOPE_UPLOAD_SYSTEM: score.WRITE
68+
AUTH_SERVER_SCOPE_UPLOAD_STUDY_PREFIX: score.
69+
AUTH_SERVER_SCOPE_UPLOAD_STUDY_SUFFIX: .WRITE
6570
SERVER_SSL_ENABLED: "false"
6671
UPLOAD_PARTSIZE: 1073741824
6772
UPLOAD_CONNECTION_TIMEOUT: 1200000
@@ -78,8 +83,9 @@ services:
7883
- ego-api
7984
volumes:
8085
- "./docker/scratch/score-server-logs:/score-server/logs"
86+
8187
score-client:
82-
image: overture/score:latest
88+
image: overture/score:5.0.0
8389
environment:
8490
ACCESSTOKEN: f69b726d-d40f-4261-b105-1ec7e6bf04d5
8591
METADATA_URL: http://song-server:8080
@@ -90,8 +96,9 @@ services:
9096
- "./docker/scratch/song-client-output:/song-client/output"
9197
command: bin/score-client
9298
user: "$MY_UID:$MY_GID"
99+
93100
song-db:
94-
image: "postgres:9.6"
101+
image: postgres:11.1
95102
environment:
96103
POSTGRES_DB: song
97104
POSTGRES_USER: postgres
@@ -100,6 +107,7 @@ services:
100107
- "8432:5432"
101108
volumes:
102109
- "./docker/song-db-init:/docker-entrypoint-initdb.d"
110+
103111
aws-cli:
104112
image: "mesosphere/aws-cli:latest"
105113
environment:
@@ -108,6 +116,7 @@ services:
108116
AWS_DEFAULT_REGION: us-east-1
109117
volumes:
110118
- "./docker/object-storage-init/data/oicr.icgc.test/data:/score-data:ro"
119+
111120
song-client:
112121
build:
113122
context: ./
@@ -127,6 +136,7 @@ services:
127136
- "./docker/scratch/song-client-output:/song-client/output"
128137
command: bin/sing
129138
user: "$MY_UID:$MY_GID"
139+
130140
song-server:
131141
build:
132142
context: ./

docker/ego-init/init.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ COPY public.policy (id, owner, name) FROM stdin;
374374
--
375375

376376
COPY public.token (id, name, owner, issuedate, isrevoked, description, expirydate) FROM stdin;
377-
5408ff40-77d3-4196-b745-e48532e39463 f69b726d-d40f-4261-b105-1ec7e6bf04d5 c6608c3e-1181-4957-99c4-094493391096 2019-10-22 15:39:19.683 f \N 3020-10-21 15:39:19.683
377+
5408ff40-77d3-4196-b745-e48532e39463 f69b726d-d40f-4261-b105-1ec7e6bf04d5 c6608c3e-1181-4957-99c4-094493391096 2019-10-22 15:39:19.683 f \N 2060-10-21 15:39:19.683
378378
\.
379379

380380

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
curl --location --request POST 'http://localhost:9082/oauth/token' \
2+
--header 'Content-Type: application/x-www-form-urlencoded' \
3+
--data-urlencode 'grant_type=client_credentials' \
4+
--data-urlencode 'client_id=ego' \
5+
--data-urlencode 'client_secret=ego'

docker/user_jwt.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NjU3MTM0NjEsImV4cCI6MTk4NTczMDgzNCwic3ViIjoiMTYwZmZlYzctNDk0Zi00ZGU3LWFjMDItOGRlYjEwM2I3MDU3IiwiaXNzIjoiZWdvIiwiYXVkIjpbXSwianRpIjoiYTIwMzY2OTItYzFkNy00NTYyLWIxNmYtMjMxM2I2MmEwYWRkIiwiY29udGV4dCI6eyJzY29wZSI6WyJzb25nLldSSVRFIiwic2NvcmUuV1JJVEUiLCJpZC5XUklURSJdLCJ1c2VyIjp7Im5hbWUiOiJqb2huLmRvZUBleGFtcGxlLmNvbSIsImVtYWlsIjoiam9obi5kb2VAZXhhbXBsZS5jb20iLCJzdGF0dXMiOiJBUFBST1ZFRCIsImZpcnN0TmFtZSI6IkpvaG4iLCJsYXN0TmFtZSI6IkRvZSIsImNyZWF0ZWRBdCI6MTU2NTcxMzQ2MSwibGFzdExvZ2luIjpudWxsLCJwcmVmZXJyZWRMYW5ndWFnZSI6IkVOR0xJU0giLCJ0eXBlIjoiQURNSU4ifX19.TlLcRrYwDTo9_jRr1lU6QNkhPFu-aZ65mWxV9-VEf_FSWhs_hjNcpzDKjOviM0lIymG_uMaDeqD7h-kvdurkfjsWebEr6kLeoVy99UGhcV2pyKr7slwbeoyke04VmWjid3hS_Jq0sVvL4uBsSetXzSugi6powJgcnilOA7-gyUFnZUTikdzLfO9hlSPVR-lhL_oYpdrRtTG9Vl6t6XNhvitri4yOoQrWQe8HC5UxLfpFGEKEqJF7L-KAlMGrhrnv2h7aLjMh-T5m01wxse-_M8FG10nIK2OtrDn--fqhzjtkb403hQvN_xBKUJuHjHKJi6Du0OjAYpqEFV80lSmT7w

pom.xml

+21-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<groupId>bio.overture</groupId>
2222
<artifactId>song</artifactId>
2323
<packaging>pom</packaging>
24-
<version>4.2.4</version>
24+
<version>4.3.0</version>
2525
<modules>
2626
<module>song-core</module>
2727
<module>song-java-sdk</module>
@@ -98,6 +98,11 @@
9898
<artifactId>spring-data-commons-core</artifactId>
9999
<version>${spring-data-commons-core.version}</version>
100100
</dependency>
101+
<dependency>
102+
<groupId>org.springframework.security</groupId>
103+
<artifactId>spring-security-jwt</artifactId>
104+
<version>${spring-security-jwt.version}</version>
105+
</dependency>
101106

102107
<!-- Spring Cloud -->
103108
<dependency>
@@ -280,6 +285,12 @@
280285
<artifactId>java-uuid-generator</artifactId>
281286
<version>${java-uuid-generator.version}</version>
282287
</dependency>
288+
<dependency>
289+
<groupId>io.jsonwebtoken</groupId>
290+
<artifactId>jjwt</artifactId>
291+
<version>${jwt.version}</version>
292+
</dependency>
293+
283294

284295
<!--Logging-->
285296
<dependency>
@@ -294,6 +305,12 @@
294305
</dependency>
295306

296307
<!--Testing-->
308+
<dependency>
309+
<groupId>org.springframework.security</groupId>
310+
<artifactId>spring-security-test</artifactId>
311+
<version>${spring-framework.version}</version>
312+
<scope>test</scope>
313+
</dependency>
297314
<dependency>
298315
<groupId>org.testcontainers</groupId>
299316
<artifactId>testcontainers</artifactId>
@@ -477,8 +494,10 @@
477494
<java-uuid-generator.version>3.1.5</java-uuid-generator.version>
478495
<wiremock.version>2.14.0</wiremock.version>
479496
<springfox.version>2.9.0</springfox.version>
480-
<spring-security-oauth2.version>2.1.0.RELEASE</spring-security-oauth2.version>
497+
<spring-security-oauth2.version>2.3.5.RELEASE</spring-security-oauth2.version>
481498
<hibernate-native-json.version>0.4</hibernate-native-json.version>
499+
<spring-security-jwt.version>1.1.1.RELEASE</spring-security-jwt.version>
500+
<jwt.version>0.9.1</jwt.version>
482501

483502
<hibernate-validator.version>6.0.13.Final</hibernate-validator.version>
484503
<javax.validation.version>2.0.1.Final</javax.validation.version>

song-client/pom.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<parent>
1919
<artifactId>song</artifactId>
2020
<groupId>bio.overture</groupId>
21-
<version>4.2.4</version>
21+
<version>4.3.0</version>
2222
</parent>
2323
<modelVersion>4.0.0</modelVersion>
2424

@@ -35,12 +35,12 @@
3535
<dependency>
3636
<groupId>bio.overture</groupId>
3737
<artifactId>song-java-sdk</artifactId>
38-
<version>4.2.4</version>
38+
<version>4.3.0</version>
3939
</dependency>
4040
<dependency>
4141
<groupId>bio.overture</groupId>
4242
<artifactId>song-core</artifactId>
43-
<version>4.2.4</version>
43+
<version>4.3.0</version>
4444
</dependency>
4545

4646
<!-- CLI -->

song-core/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<artifactId>song</artifactId>
2121
<groupId>bio.overture</groupId>
22-
<version>4.2.4</version>
22+
<version>4.3.0</version>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

song-core/src/main/java/bio/overture/song/core/exceptions/ServerErrors.java

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import static org.springframework.http.HttpStatus.BAD_GATEWAY;
2222
import static org.springframework.http.HttpStatus.BAD_REQUEST;
2323
import static org.springframework.http.HttpStatus.CONFLICT;
24+
import static org.springframework.http.HttpStatus.FORBIDDEN;
2425
import static org.springframework.http.HttpStatus.GATEWAY_TIMEOUT;
2526
import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
2627
import static org.springframework.http.HttpStatus.NOT_FOUND;
@@ -72,6 +73,7 @@ public enum ServerErrors implements ServerError {
7273
SEQUENCING_READ_NOT_FOUND(NOT_FOUND),
7374
VARIANT_CALL_NOT_FOUND(NOT_FOUND),
7475
UNAUTHORIZED_TOKEN(UNAUTHORIZED),
76+
FORBIDDEN_TOKEN(FORBIDDEN),
7577
GATEWAY_IS_DOWN(GATEWAY_TIMEOUT),
7678
GATEWAY_TIMED_OUT(GATEWAY_TIMEOUT),
7779
BAD_REPLY_FROM_GATEWAY(BAD_GATEWAY),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package bio.overture.song.core.utils;
2+
3+
import static lombok.AccessLevel.PRIVATE;
4+
5+
import com.google.common.base.Joiner;
6+
import lombok.NoArgsConstructor;
7+
8+
@NoArgsConstructor(access = PRIVATE)
9+
public class Joiners {
10+
11+
public static final Joiner WHITESPACE = Joiner.on(" ");
12+
}

song-java-sdk/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<parent>
1919
<artifactId>song</artifactId>
2020
<groupId>bio.overture</groupId>
21-
<version>4.2.4</version>
21+
<version>4.3.0</version>
2222
</parent>
2323
<modelVersion>4.0.0</modelVersion>
2424

song-server/pom.xml

+16-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<parent>
2020
<artifactId>song</artifactId>
2121
<groupId>bio.overture</groupId>
22-
<version>4.2.4</version>
22+
<version>4.3.0</version>
2323
</parent>
2424
<modelVersion>4.0.0</modelVersion>
2525

@@ -37,7 +37,7 @@
3737
<dependency>
3838
<groupId>bio.overture</groupId>
3939
<artifactId>song-core</artifactId>
40-
<version>4.2.4</version>
40+
<version>4.3.0</version>
4141
</dependency>
4242

4343
<!-- Spring -->
@@ -82,6 +82,10 @@
8282
<groupId>org.springframework.cloud</groupId>
8383
<artifactId>spring-cloud-starter-vault-config</artifactId>
8484
</dependency>
85+
<dependency>
86+
<groupId>org.springframework.security</groupId>
87+
<artifactId>spring-security-jwt</artifactId>
88+
</dependency>
8589

8690
<!-- JDBC -->
8791
<dependency>
@@ -158,6 +162,11 @@
158162
</dependency>
159163

160164
<!-- Testing -->
165+
<dependency>
166+
<groupId>org.springframework.security</groupId>
167+
<artifactId>spring-security-test</artifactId>
168+
<scope>test</scope>
169+
</dependency>
161170
<dependency>
162171
<groupId>com.github.tomakehurst</groupId>
163172
<artifactId>wiremock</artifactId>
@@ -177,6 +186,11 @@
177186
<artifactId>json-unit</artifactId>
178187
<scope>test</scope>
179188
</dependency>
189+
<dependency>
190+
<groupId>io.jsonwebtoken</groupId>
191+
<artifactId>jjwt</artifactId>
192+
<scope>test</scope>
193+
</dependency>
180194

181195
<dependency>
182196
<groupId>org.springframework.boot</groupId>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
package bio.overture.song.server.config;
2+
3+
import bio.overture.song.server.security.CustomResourceServerTokenServices;
4+
import bio.overture.song.server.security.DefaultPublicKeyFetcher;
5+
import bio.overture.song.server.security.JWTTokenConverter;
6+
import bio.overture.song.server.security.PublicKeyFetcher;
7+
import lombok.NonNull;
8+
import org.springframework.beans.factory.annotation.Autowired;
9+
import org.springframework.beans.factory.annotation.Value;
10+
import org.springframework.context.annotation.Bean;
11+
import org.springframework.context.annotation.Configuration;
12+
import org.springframework.context.annotation.Primary;
13+
import org.springframework.context.annotation.Profile;
14+
import org.springframework.retry.support.RetryTemplate;
15+
import org.springframework.security.oauth2.provider.token.RemoteTokenServices;
16+
import org.springframework.security.oauth2.provider.token.store.JwtTokenStore;
17+
import org.springframework.web.client.RestTemplate;
18+
19+
@Profile("jwt")
20+
@Configuration
21+
public class JWTConfig {
22+
23+
private final String publicKeyUrl;
24+
private final RetryTemplate retryTemplate;
25+
private final RemoteTokenServices remoteTokenServices;
26+
27+
@Autowired
28+
public JWTConfig(
29+
@NonNull @Value("${auth.jwt.public-key-url}") String publicKeyUrl,
30+
@NonNull RemoteTokenServices remoteTokenServices,
31+
@NonNull RetryTemplate retryTemplate) {
32+
this.publicKeyUrl = publicKeyUrl;
33+
this.retryTemplate = retryTemplate;
34+
this.remoteTokenServices = remoteTokenServices;
35+
}
36+
37+
@Bean
38+
@Primary
39+
public CustomResourceServerTokenServices customResourceServerTokenServices(
40+
@Autowired PublicKeyFetcher publicKeyFetcher) {
41+
return new CustomResourceServerTokenServices(
42+
remoteTokenServices, buildJwtTokenStore(publicKeyFetcher), retryTemplate);
43+
}
44+
45+
private JwtTokenStore buildJwtTokenStore(@Autowired PublicKeyFetcher publicKeyFetcher) {
46+
return new JwtTokenStore(jwtTokenConverter(publicKeyFetcher));
47+
}
48+
49+
public JWTTokenConverter jwtTokenConverter(@Autowired PublicKeyFetcher publicKeyFetcher) {
50+
return new JWTTokenConverter(publicKeyFetcher.getPublicKey());
51+
}
52+
53+
@Bean
54+
@Profile("!test")
55+
public PublicKeyFetcher publicKeyFetcher() {
56+
return new DefaultPublicKeyFetcher(publicKeyUrl, new RestTemplate(), retryTemplate);
57+
}
58+
}

song-server/src/main/java/bio/overture/song/server/config/TokenServiceConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
@NoArgsConstructor
3030
@Configuration
31-
@Profile("secure")
31+
@Profile({"secure", "!jwt"})
3232
public class TokenServiceConfig {
3333

3434
@Bean

song-server/src/main/java/bio/overture/song/server/kafka/AnalysisMessage.java

+1-7
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,13 @@
2121
import static lombok.AccessLevel.PRIVATE;
2222

2323
import bio.overture.song.core.model.enums.AnalysisStates;
24-
import com.fasterxml.jackson.annotation.JsonCreator;
25-
import com.fasterxml.jackson.annotation.JsonProperty;
26-
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
27-
import lombok.AccessLevel;
2824
import lombok.AllArgsConstructor;
29-
import lombok.Builder;
3025
import lombok.NoArgsConstructor;
3126
import lombok.NonNull;
32-
import lombok.RequiredArgsConstructor;
3327
import lombok.Value;
3428

3529
@Value
36-
//Note: although the AllArgs and NoArgs combination below seems odd,
30+
// Note: although the AllArgs and NoArgs combination below seems odd,
3731
// it allows Jackson to deserialize to an immutable object without using any additional annotations.
3832
@AllArgsConstructor
3933
@NoArgsConstructor(force = true, access = PRIVATE)

song-server/src/main/java/bio/overture/song/server/model/entity/AnalysisSchema.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import static bio.overture.song.server.model.enums.TableAttributeNames.SCHEMA;
66
import static bio.overture.song.server.model.enums.TableAttributeNames.VERSION;
77
import static bio.overture.song.server.repository.CustomJsonType.CUSTOM_JSON_TYPE_PKG_PATH;
8-
import static org.assertj.core.util.Sets.newHashSet;
8+
import static com.google.common.collect.Sets.newHashSet;
99

1010
import bio.overture.song.server.model.analysis.Analysis;
1111
import bio.overture.song.server.model.enums.ModelAttributeNames;

0 commit comments

Comments
 (0)