From 6771d990e256d66c3ba9523c73eb02a773440cff Mon Sep 17 00:00:00 2001 From: Jeremy Adams Date: Thu, 26 May 2022 12:07:30 -0400 Subject: [PATCH 1/2] stop serialization issues for drs objects with controlled access (admin view) --- .../java/org/ga4gh/starterkit/drs/controller/DrsAdmin.java | 1 + .../java/org/ga4gh/starterkit/drs/model/PassportBroker.java | 2 +- src/main/java/org/ga4gh/starterkit/drs/model/PassportVisa.java | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/ga4gh/starterkit/drs/controller/DrsAdmin.java b/src/main/java/org/ga4gh/starterkit/drs/controller/DrsAdmin.java index 25801dd..1f85f1c 100644 --- a/src/main/java/org/ga4gh/starterkit/drs/controller/DrsAdmin.java +++ b/src/main/java/org/ga4gh/starterkit/drs/controller/DrsAdmin.java @@ -77,6 +77,7 @@ public DrsObject showDrsObject( * @return persistent DRSObject saved with the requested attributes */ @PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE) + @JsonView(SerializeView.Admin.class) public DrsObject createDrsObject( @RequestBody DrsObject drsObject ) { diff --git a/src/main/java/org/ga4gh/starterkit/drs/model/PassportBroker.java b/src/main/java/org/ga4gh/starterkit/drs/model/PassportBroker.java index dd942f9..0bba67f 100644 --- a/src/main/java/org/ga4gh/starterkit/drs/model/PassportBroker.java +++ b/src/main/java/org/ga4gh/starterkit/drs/model/PassportBroker.java @@ -47,7 +47,7 @@ public class PassportBroker implements HibernateEntity { cascade = {CascadeType.ALL}, orphanRemoval = true ) - @JsonView(SerializeView.Admin.class) + @JsonView(SerializeView.Never.class) private List passportVisas; public PassportBroker() { diff --git a/src/main/java/org/ga4gh/starterkit/drs/model/PassportVisa.java b/src/main/java/org/ga4gh/starterkit/drs/model/PassportVisa.java index 893c36c..384854f 100644 --- a/src/main/java/org/ga4gh/starterkit/drs/model/PassportVisa.java +++ b/src/main/java/org/ga4gh/starterkit/drs/model/PassportVisa.java @@ -59,6 +59,7 @@ public class PassportVisa implements HibernateEntity { CascadeType.DETACH, CascadeType.REFRESH} ) @JoinColumn(name = "passport_broker_url") + @JsonView(SerializeView.Admin.class) private PassportBroker passportBroker; @ManyToMany @@ -67,7 +68,7 @@ public class PassportVisa implements HibernateEntity { joinColumns = {@JoinColumn(name = "visa_id")}, inverseJoinColumns = {@JoinColumn(name = "drs_object_id")} ) - @JsonView(SerializeView.Admin.class) + @JsonView(SerializeView.Never.class) private List drsObjects; public PassportVisa() { From 5cff1436463b75bcf6fe658161f338acd308a6d9 Mon Sep 17 00:00:00 2001 From: Jeremy Adams Date: Thu, 26 May 2022 13:05:29 -0400 Subject: [PATCH 2/2] increment version and release notes --- README.md | 6 ++++++ build.gradle | 2 +- .../starterkit/drs/constant/DrsServiceInfoDefaults.java | 2 +- src/test/resources/responses/service-info/show/00.json | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8db5743..2fc05dd 100644 --- a/README.md +++ b/README.md @@ -186,10 +186,16 @@ Multiple datasets are currently contained in this repo for development and testi ## Changelog +### v0.3.1 + +* Fixed a bug where admin requests to create a controlled access DRS object (i.e. with visas) did not complete successfully + ### v0.3.0 + * DRS object batch requests * Passport support - Passport mediated auth to DRS objects (using Starter Kit implementation of Passports) * Auth info - Discover Passport broker(s) and visa(s) for requested controlled access DRS Objects (single object and bulk request) ### v0.2.2 + * patched log4j dependencies to v2.16.0 to avoid [Log4j Vulnerability](https://www.cisa.gov/uscert/apache-log4j-vulnerability-guidance) \ No newline at end of file diff --git a/build.gradle b/build.gradle index 108e01d..1cbfd82 100644 --- a/build.gradle +++ b/build.gradle @@ -36,7 +36,7 @@ configurations.all { archivesBaseName = 'ga4gh-starter-kit-drs' group 'org.ga4gh' -version '0.3.0' +version '0.3.1' repositories { // Use jcenter for resolving dependencies. diff --git a/src/main/java/org/ga4gh/starterkit/drs/constant/DrsServiceInfoDefaults.java b/src/main/java/org/ga4gh/starterkit/drs/constant/DrsServiceInfoDefaults.java index ab906ae..5d77368 100644 --- a/src/main/java/org/ga4gh/starterkit/drs/constant/DrsServiceInfoDefaults.java +++ b/src/main/java/org/ga4gh/starterkit/drs/constant/DrsServiceInfoDefaults.java @@ -54,7 +54,7 @@ public class DrsServiceInfoDefaults { /** * Default service version */ - public static final String VERSION = "0.3.0"; + public static final String VERSION = "0.3.1"; /** * Default service organization name diff --git a/src/test/resources/responses/service-info/show/00.json b/src/test/resources/responses/service-info/show/00.json index e8f1037..b626c51 100644 --- a/src/test/resources/responses/service-info/show/00.json +++ b/src/test/resources/responses/service-info/show/00.json @@ -1 +1 @@ -{"id":"org.ga4gh.starterkit.drs","name":"GA4GH Starter Kit DRS Service","description":"An open source, community-driven implementation of the GA4GH Data Repository Service (DRS) API specification.","contactUrl":"mailto:info@ga4gh.org","documentationUrl":"https://github.com/ga4gh/ga4gh-starter-kit-drs","createdAt":"2020-01-15T12:00:00Z","updatedAt":"2020-01-15T12:00:00Z","environment":"test","version":"0.3.0","type":{"group":"org.ga4gh","artifact":"drs","version":"1.1.0"},"organization":{"name":"Global Alliance for Genomics and Health","url":"https://ga4gh.org"}} \ No newline at end of file +{"id":"org.ga4gh.starterkit.drs","name":"GA4GH Starter Kit DRS Service","description":"An open source, community-driven implementation of the GA4GH Data Repository Service (DRS) API specification.","contactUrl":"mailto:info@ga4gh.org","documentationUrl":"https://github.com/ga4gh/ga4gh-starter-kit-drs","createdAt":"2020-01-15T12:00:00Z","updatedAt":"2020-01-15T12:00:00Z","environment":"test","version":"0.3.1","type":{"group":"org.ga4gh","artifact":"drs","version":"1.1.0"},"organization":{"name":"Global Alliance for Genomics and Health","url":"https://ga4gh.org"}} \ No newline at end of file