Skip to content

Commit 39935ae

Browse files
authored
[PRMP-1517] Authorisation changes (#246)
* [PRMP-1517] add permission to search lambda to write to auth table * [PRMP-1517] Change aws_api_gateway_authorizer to REQUEST type * [PRMP-1517] add permission to search patient * [PRMP-1517] add redeployment triggers
1 parent 7ba0841 commit 39935ae

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

infrastructure/api.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ resource "aws_api_gateway_deployment" "ndr_api_deploy" {
4141
triggers = {
4242
redeployment = sha1(jsonencode([
4343
aws_api_gateway_rest_api.ndr_doc_store_api.body,
44+
aws_api_gateway_authorizer.repo_authoriser,
4445
module.authoriser-lambda,
4546
module.back-channel-logout-gateway,
4647
module.back_channel_logout_lambda,

infrastructure/lambda-authoriser.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ module "authoriser-alarm-topic" {
7575

7676
resource "aws_api_gateway_authorizer" "repo_authoriser" {
7777
name = "${terraform.workspace}_repo_authoriser"
78-
type = "TOKEN"
78+
type = "REQUEST"
7979
identity_source = "method.request.header.Authorization"
8080
rest_api_id = aws_api_gateway_rest_api.ndr_doc_store_api.id
8181
authorizer_uri = module.authoriser-lambda.invoke_arn

infrastructure/lambda-search-patient.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ module "search-patient-details-lambda" {
6868
handler = "handlers.search_patient_details_handler.lambda_handler"
6969
iam_role_policy_documents = [
7070
aws_iam_policy.ssm_access_policy.policy,
71-
module.ndr-app-config.app_config_policy
71+
module.ndr-app-config.app_config_policy,
72+
module.auth_session_dynamodb_table.dynamodb_write_policy_document,
73+
module.auth_session_dynamodb_table.dynamodb_read_policy_document,
7274
]
7375
rest_api_id = aws_api_gateway_rest_api.ndr_doc_store_api.id
7476
resource_id = module.search-patient-details-gateway.gateway_resource_id
@@ -82,6 +84,7 @@ module "search-patient-details-lambda" {
8284
PDS_FHIR_IS_STUBBED = local.is_sandbox,
8385
SPLUNK_SQS_QUEUE_URL = try(module.sqs-splunk-queue[0].sqs_url, null)
8486
WORKSPACE = terraform.workspace
87+
AUTH_SESSION_TABLE_NAME = "${terraform.workspace}_${var.auth_session_dynamodb_table_name}"
8588
}
8689
api_execution_arn = aws_api_gateway_rest_api.ndr_doc_store_api.execution_arn
8790
depends_on = [

0 commit comments

Comments
 (0)