diff --git a/service/src/main/java/bio/terra/drshub/services/DrsResolutionService.java b/service/src/main/java/bio/terra/drshub/services/DrsResolutionService.java index 456fb01..a5ee9d5 100644 --- a/service/src/main/java/bio/terra/drshub/services/DrsResolutionService.java +++ b/service/src/main/java/bio/terra/drshub/services/DrsResolutionService.java @@ -149,11 +149,6 @@ private DrsMetadata fetchObject( var accessMethod = AccessMethodUtils.getAccessMethod(drsResponse, drsProvider, cloudPlatform); var accessMethodType = accessMethod.map(AccessMethod::getType).orElse(null); - if (drsProvider.shouldFetchUserServiceAccount(accessMethodType, requestedFields)) { - var saKey = authService.fetchUserServiceAccount(drsProvider, bearerToken); - drsMetadataBuilder.bondSaKey(saKey); - } - if (drsResponse != null) { drsMetadataBuilder.drsResponse(drsResponse); setDrsResponseValues( diff --git a/service/src/test/java/bio/terra/drshub/controllers/DrsHubApiControllerTest.java b/service/src/test/java/bio/terra/drshub/controllers/DrsHubApiControllerTest.java index e90ed3a..cbf7522 100644 --- a/service/src/test/java/bio/terra/drshub/controllers/DrsHubApiControllerTest.java +++ b/service/src/test/java/bio/terra/drshub/controllers/DrsHubApiControllerTest.java @@ -12,7 +12,6 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; import bio.terra.drshub.BaseTest; -import bio.terra.drshub.generated.model.SaKeyObject; import bio.terra.drshub.models.DrsApi; import bio.terra.drshub.models.Fields; import bio.terra.drshub.services.AuthService; @@ -222,45 +221,6 @@ void testDoesNotCallEcmWhenOnlyDrsFieldsRequested() throws Exception { verify(externalCredsApiFactory, times(0)).getApi(any()); } - @Test - void testDrsProviderDoesNotSupportGoogle() throws Exception { - var cidProviderHost = getProviderHosts("kidsFirst"); - - postDrsHubRequest( - TEST_ACCESS_TOKEN, - cidProviderHost.compactUriPrefix(), - UUID.randomUUID().toString(), - List.of(Fields.GOOGLE_SERVICE_ACCOUNT)) - .andExpect(status().isOk()) - .andExpect(content().json("{}")); - } - - @Test - void testDrsProviderDoesSupportGoogle() throws Exception { - var cidProviderHost = getProviderHosts("bioDataCatalyst"); - - Map fenceAccountKey = new HashMap<>(); - fenceAccountKey.put("foo", "sa key"); - ObjectMapper mapper = new ObjectMapper(); - mockExternalCredsFenceAccountKeyApi( - Provider.fromValue(cidProviderHost.drsProvider().getEcmFenceProvider().get().getUriValue()), - TEST_ACCESS_TOKEN, - mapper.writeValueAsString(fenceAccountKey)); - - var saKeyObject = new SaKeyObject().data(fenceAccountKey); - postDrsHubRequest( - TEST_ACCESS_TOKEN, - cidProviderHost.compactUriPrefix(), - UUID.randomUUID().toString(), - List.of(Fields.GOOGLE_SERVICE_ACCOUNT)) - .andExpect(status().isOk()) - .andExpect( - content() - .json( - objectMapper.writeValueAsString( - Map.of(Fields.GOOGLE_SERVICE_ACCOUNT, saKeyObject)))); - } - @Test void testCallsCorrectEndpointsWhenOnlyAccessUrlRequested() throws Exception { var cidProviderHost = getProviderHosts("kidsFirst");