Skip to content

Commit

Permalink
Merge pull request #85 from MeasureAuthoringTool/MAT-7535_change_lamb…
Browse files Browse the repository at this point in the history
…da-api-key

MAT-7535 remove lambda-api-key
  • Loading branch information
sb-cecilialiu authored Aug 26, 2024
2 parents 5f5cf09 + accef41 commit 1432d28
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
<dependency>
<groupId>gov.cms.madie</groupId>
<artifactId>madie-java-models</artifactId>
<version>0.6.57-SNAPSHOT</version>
<version>0.6.58-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>gov.cms.madie</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public ResponseEntity<String> 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<String> response = ResponseEntity.badRequest().body("Library does not exist.");

if (cqlLibraryService.changeOwnership(id, userid)) {
Expand All @@ -218,7 +218,7 @@ public ResponseEntity<String> 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<String> response =
ResponseEntity.badRequest().body("Cql Library does not exist.");

Expand All @@ -237,7 +237,7 @@ public ResponseEntity<String> grantAccess(
@PreAuthorize("#request.getHeader('api-key') == #apiKey")
public ResponseEntity<List<Map<String, Object>>> getMeasureSharedWith(
HttpServletRequest request,
@Value("${lambda-api-key}") String apiKey,
@Value("${admin-api-key}") String apiKey,
@RequestParam(name = "measureids") String measureids) {
List<Map<String, Object>> results = new ArrayList<>();
String[] ids = StringUtils.split(measureids, ",");
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1432d28

Please sign in to comment.