From accef41e4d1715b8341fb16ed5032a67df2c8e2c Mon Sep 17 00:00:00 2001 From: Cecilia Liu Date: Mon, 26 Aug 2024 07:04:19 -0500 Subject: [PATCH] MAT-7535 remove lambda-api-key --- pom.xml | 2 +- .../cqllibraryservice/controllers/CqlLibraryController.java | 6 +++--- src/main/resources/application.yml | 1 - .../controllers/CqlLibraryControllerMvcTest.java | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 26927c5..4fc4efd 100644 --- a/pom.xml +++ b/pom.xml @@ -102,7 +102,7 @@ gov.cms.madie madie-java-models - 0.6.57-SNAPSHOT + 0.6.58-SNAPSHOT gov.cms.madie diff --git a/src/main/java/gov/cms/madie/cqllibraryservice/controllers/CqlLibraryController.java b/src/main/java/gov/cms/madie/cqllibraryservice/controllers/CqlLibraryController.java index 9072c4f..27dc12e 100644 --- a/src/main/java/gov/cms/madie/cqllibraryservice/controllers/CqlLibraryController.java +++ b/src/main/java/gov/cms/madie/cqllibraryservice/controllers/CqlLibraryController.java @@ -196,7 +196,7 @@ public ResponseEntity changeOwnership( HttpServletRequest request, @PathVariable("id") String id, @RequestParam(name = "userid") String userid, - @Value("${lambda-api-key}") String apiKey) { + @Value("${admin-api-key}") String apiKey) { ResponseEntity response = ResponseEntity.badRequest().body("Library does not exist."); if (cqlLibraryService.changeOwnership(id, userid)) { @@ -218,7 +218,7 @@ public ResponseEntity grantAccess( HttpServletRequest request, @PathVariable("id") String id, @RequestParam(required = true, name = "userid") String userid, - @Value("${lambda-api-key}") String apiKey) { + @Value("${admin-api-key}") String apiKey) { ResponseEntity response = ResponseEntity.badRequest().body("Cql Library does not exist."); @@ -237,7 +237,7 @@ public ResponseEntity grantAccess( @PreAuthorize("#request.getHeader('api-key') == #apiKey") public ResponseEntity>> getMeasureSharedWith( HttpServletRequest request, - @Value("${lambda-api-key}") String apiKey, + @Value("${admin-api-key}") String apiKey, @RequestParam(name = "measureids") String measureids) { List> results = new ArrayList<>(); String[] ids = StringUtils.split(measureids, ","); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 4640bf5..e6cdca6 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -30,7 +30,6 @@ okta: issuer: ${OKTA_ISSUER:https://dev-18092578.okta.com/oauth2/default} audience: ${OKTA_AUDIENCE:api://default} -lambda-api-key: ${LAMBDA_API_KEY:9202c9fa} admin-api-key: ${ADMIN_API_KEY:0a51991c} mongock: diff --git a/src/test/java/gov/cms/madie/cqllibraryservice/controllers/CqlLibraryControllerMvcTest.java b/src/test/java/gov/cms/madie/cqllibraryservice/controllers/CqlLibraryControllerMvcTest.java index ad385c3..f144593 100644 --- a/src/test/java/gov/cms/madie/cqllibraryservice/controllers/CqlLibraryControllerMvcTest.java +++ b/src/test/java/gov/cms/madie/cqllibraryservice/controllers/CqlLibraryControllerMvcTest.java @@ -77,7 +77,7 @@ public class CqlLibraryControllerMvcTest { private static final String TEST_USER_ID = "test-okta-user-id-123"; private static final String TEST_LIBRARYSET_ID = "test-okta-user-id-321"; private static final String TEST_API_KEY_HEADER = "api-key"; - private static final String TEST_API_KEY_HEADER_VALUE = "9202c9fa"; + private static final String TEST_API_KEY_HEADER_VALUE = "0a51991c"; private static final String MODEL = ModelType.QI_CORE.toString(); @MockBean private CqlLibraryRepository repository;