Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
542431d
ELI-318: Adds content-type in 404 and 500 error response (#232)
shweta-nhs Jul 14, 2025
6ea9223
ELI-294: Personalised/customised status text (#234)
shweta-nhs Jul 15, 2025
5889dcd
ELI-318: Adds application/fhir+json as valid mime type in Mangum (#235)
shweta-nhs Jul 15, 2025
14d6a5e
ELI-331: Mask PII/GDPR info (#239)
shweta-nhs Jul 16, 2025
b465617
Revert "ELI-331: Mask PII/GDPR info (#239)" (#240)
shweta-nhs Jul 16, 2025
a9194c5
Feature/eli 295 generic text for not eligible xrules (#238)
ayeshalshukri1-nhs Jul 17, 2025
8d45d8d
Bump polyfactory from 2.21.0 to 2.22.1
dependabot[bot] Jul 18, 2025
2b73afd
Merge pull request #237 from NHSDigital/dependabot/pip/polyfactory-2.…
eddalmond1 Jul 18, 2025
157b671
Revert "Bump polyfactory from 2.21.0 to 2.22.1" (#241)
eddalmond1 Jul 18, 2025
87b1d55
Bump aiohttp from 3.12.13 to 3.12.14
dependabot[bot] Jul 18, 2025
f324e4c
Merge pull request #236 from NHSDigital/dependabot/pip/aiohttp-3.12.14
eddalmond1 Jul 21, 2025
f891528
provided appropriate values factory methods in tests (#245)
Karthikeyannhs Jul 21, 2025
3f05f51
Refactor package structure (#247)
shweta-nhs Jul 21, 2025
199abd6
eli-343 following on from suggestions from AWS Security Hub, restrict…
eddalmond1 Jul 22, 2025
e8a62c4
Merge remote-tracking branch 'origin/main' into feature/eja-eli-343-a…
eddalmond1 Jul 22, 2025
50cf200
Merge pull request #249 from NHSDigital/feature/eja-eli-343-adding-de…
eddalmond1 Jul 22, 2025
fa5ae28
add lambda request id in logs events (#248)
Karthikeyannhs Jul 22, 2025
6b1848d
Feature/rgjb aa eli 329 add xray tracing for lambda (#243)
robbailiff2 Jul 22, 2025
33a630f
bugfix - Github action needs permission to modify public access block
eddalmond1 Jul 23, 2025
9b16ba0
bugfix - changing permission to be wildcard resource, as it's an acco…
eddalmond1 Jul 23, 2025
a45b390
Merge pull request #251 from NHSDigital/bugfix/eja-add-github-ec2-pub…
eddalmond1 Jul 23, 2025
ea45743
Added api gateway request id, moved request id logging to app.py (#252)
Karthikeyannhs Jul 24, 2025
de8ebac
ELI-351 and ELI-342: Refactors and fixes Cohort Schema Mismatch (#253)
shweta-nhs Jul 24, 2025
9a7014a
Feature/eli 369 dynamodb x ray tracing (#256)
ayeshalshukri1-nhs Jul 28, 2025
a8667e3
Bump slackapi/slack-github-action from 2.1.0 to 2.1.1
dependabot[bot] Jul 28, 2025
c1bed7d
Merge pull request #226 from NHSDigital/dependabot/github_actions/sla…
eddalmond1 Jul 28, 2025
c47799a
ELI-351: Refactor (#254)
shweta-nhs Jul 29, 2025
26e1e30
Bump botocore from 1.38.42 to 1.38.46
dependabot[bot] Jul 29, 2025
2d55489
Merge pull request #198 from NHSDigital/dependabot/pip/botocore-1.38.46
eddalmond1 Jul 29, 2025
f34e1dd
Bump moto from 5.1.6 to 5.1.9
dependabot[bot] Jul 29, 2025
2526f25
Merge pull request #257 from NHSDigital/dependabot/pip/moto-5.1.9
eddalmond1 Jul 30, 2025
e912753
Bump localstack from 4.5.0 to 4.6.0
dependabot[bot] Jul 30, 2025
914b494
Merge pull request #211 from NHSDigital/dependabot/pip/localstack-4.6.0
eddalmond1 Jul 30, 2025
9b0edb0
Bump pytest-asyncio from 1.0.0 to 1.1.0
dependabot[bot] Jul 30, 2025
3ac7738
Merge pull request #244 from NHSDigital/dependabot/pip/pytest-asyncio…
eddalmond1 Jul 30, 2025
2a9a729
Bump pytest-docker from 3.2.2 to 3.2.3
dependabot[bot] Jul 30, 2025
c5105e4
Merge pull request #216 from NHSDigital/dependabot/pip/pytest-docker-…
eddalmond1 Jul 30, 2025
6aec8fd
ELI-351: Refactor (#258)
shweta-nhs Jul 30, 2025
e7b3da7
Bump asgiref from 3.8.1 to 3.9.1
dependabot[bot] Aug 1, 2025
d6f8ae0
Merge pull request #260 from NHSDigital/dependabot/pip/asgiref-3.9.1
eddalmond1 Aug 1, 2025
e7b08ec
Bump gitpython from 3.1.44 to 3.1.45
dependabot[bot] Aug 1, 2025
6fee9fe
Merge pull request #263 from NHSDigital/dependabot/pip/gitpython-3.1.45
eddalmond1 Aug 1, 2025
e508991
Bump pyright from 1.1.402 to 1.1.403
dependabot[bot] Aug 1, 2025
6270652
Merge pull request #261 from NHSDigital/dependabot/pip/pyright-1.1.403
eddalmond1 Aug 1, 2025
014d138
ELI-351: Moves/deletes tests after refactoring (#265)
shweta-nhs Aug 1, 2025
9422b53
Bump aiohttp from 3.12.14 to 3.12.15
dependabot[bot] Aug 1, 2025
758d9aa
Merge pull request #267 from NHSDigital/dependabot/pip/aiohttp-3.12.15
eddalmond1 Aug 4, 2025
bea92fb
trying an approach to ensure correct version of python used in lambda…
shweta-nhs Aug 4, 2025
f1a50ed
ELI-311: Campaign Config Data Type Changes (#269)
shweta-nhs Aug 4, 2025
0aa1cce
eli-285 and eli-349 adding cloudwatch alarms for a) security and b) o…
eddalmond1 Aug 5, 2025
28a2958
eli-285 - disabling action on API calls as our internal security are …
eddalmond1 Aug 5, 2025
1ad50a9
eli-285 and 349 adding kms for sns, checkov skip for disabled alarms
eddalmond1 Aug 5, 2025
03fcfd9
work in progress
TOEL2 Aug 5, 2025
4e18992
eli-285 enable kms key rotation
eddalmond1 Aug 5, 2025
fdb4f0e
eli-285 get rid of false flag gitleak
eddalmond1 Aug 5, 2025
acb6428
Merge pull request #273 from NHSDigital/feature/eli-285-and-349-creat…
eddalmond1 Aug 6, 2025
8b80c51
eli-388 adding access log permissions for audit buckets
eddalmond1 Aug 6, 2025
d73dea5
eli-386 blocking s3 public access at account level
eddalmond1 Aug 6, 2025
81bb071
ELI-376: Audit record should log multiple F and S rules (#275)
shweta-nhs Aug 7, 2025
570765a
ELI-150: campaign config validation (#264)
ayeshalshukri1-nhs Aug 7, 2025
f1db991
Merge branch 'main' into feature/eja-eli-386-block-public-access-to-s…
eddalmond1 Aug 7, 2025
60db5d4
Merge branch 'main' into bugfix/eja-eli-388-enable-audit-logging-by-a…
eddalmond1 Aug 7, 2025
da24293
eli-386 adding github permissions to make account level public access…
eddalmond1 Aug 7, 2025
a5f5f1e
all tests passing
TOEL2 Aug 7, 2025
52c2d16
Merge pull request #278 from NHSDigital/feature/eja-eli-386-block-pub…
eddalmond1 Aug 7, 2025
3f438b2
Merge branch 'main' into bugfix/eja-eli-388-enable-audit-logging-by-a…
eddalmond1 Aug 7, 2025
53713b5
Revert "eli-386 blocking s3 public access at account level"
eddalmond1 Aug 7, 2025
4fb4711
extracting method for readability
TOEL2 Aug 7, 2025
0f07e27
Merge pull request #279 from NHSDigital/revert-278-feature/eja-eli-38…
eddalmond1 Aug 7, 2025
43abb81
Merge branch 'main' into bugfix/eja-eli-388-enable-audit-logging-by-a…
eddalmond1 Aug 7, 2025
3ba0f4a
Merge pull request #277 from NHSDigital/bugfix/eja-eli-388-enable-aud…
eddalmond1 Aug 7, 2025
7d63860
ELI-399: Fixing Future Iteration.StartDate Resulting in 500 Error (#282)
shweta-nhs Aug 7, 2025
b66a8dc
applying to filter rules and adding test
TOEL2 Aug 7, 2025
d507918
pulling in latest from main
TOEL2 Aug 7, 2025
1e55114
ELI-397: Fixing nhs number missing from path error to be FHIR complia…
shweta-nhs Aug 8, 2025
6893966
Merge branch 'main' into bug/te-ELI-373-cohortlabel
TOEL2 Aug 8, 2025
e1d20a9
Merge pull request #280 from NHSDigital/bug/te-ELI-373-cohortlabel
TOEL2 Aug 8, 2025
2e7b2dd
Added new tests
seansteberisal Aug 11, 2025
bb4aee5
ELI-399: Fixing start date validation (#287)
shweta-nhs Aug 11, 2025
dca12d8
ELI-328: cohort validations (#281)
Karthikeyannhs Aug 11, 2025
86a27ce
fixed new tests
seansteberisal Aug 11, 2025
754b6a3
ELI-404: Fix Error message returned for authorisation failure (#289)
shweta-nhs Aug 11, 2025
f5bbaec
update packages
seansteberisal Aug 11, 2025
03d4cfb
Bugfix to change response grouping from name to priority (#286)
ayeshalshukri1-nhs Aug 12, 2025
5775932
ELI-397: AWS api gateway to handle bad request param error (#291)
shweta-nhs Aug 12, 2025
8a9d7ee
Changes to tests
seansteberisal Aug 12, 2025
160cbca
Merge branch 'main' into test/ELI-365-over80
seansteberisal Aug 12, 2025
9ea07d6
linting and formatting update
seansteberisal Aug 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cicd-2-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
# asset_name: lambda-${{ needs.metadata.outputs.version }}.zip
# asset_content_type: application/zip
- name: "Notify Slack on PR merge"
uses: slackapi/slack-github-action@v2.1.0
uses: slackapi/slack-github-action@v2.1.1
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: webhook-trigger
Expand Down
3 changes: 2 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
terraform 1.12.1
pre-commit 4.2.0
vale 3.11.2
poetry 2.1.3
poetry 2.1.4
act 0.2.77
nodejs 22.18.0

# ==============================================================================
# The section below is reserved for Docker image versions.
Expand Down
28 changes: 22 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,25 @@ graph TB
direction TB
App["app.py (WireUp DI)"]
Config["config.py, error_handler.py"]
subgraph "Audit Layer"
direction TB
Audit["audit/audit_service.py"]
AuditModels["audit/audit_models.py"]
end
subgraph "Validation Layer"
direction TB
Validator["common/request_validator.py"]
ApiErrResp["common/api_error_response.py"]
end
subgraph "Presentation Layer"
direction TB
View["views/eligibility.py"]
ResponseModel["views/response_model/eligibility.py"]
ResponseModel["views/response_model/eligibility_response.py"]
end
subgraph "Business Logic Layer"
direction TB
Service["services/eligibility_services.py"]
Operators["services/rules/operators.py"]
Operators["services/operators/operators.py"]
end
subgraph "Data Access Layer"
direction TB
Expand All @@ -207,24 +217,30 @@ graph TB
end
subgraph "Models"
direction TB
ModelElig["model/eligibility.py"]
ModelRules["model/rules.py"]
ModelElig["model/eligibility_status.py"]
ModelRules["model/campaign_config.py"]
end
end

Lambda -->|"loads"| App
App -->|injects| View
View -->|calls| Service
View -->|validates via| Validator
View -->|audits via| Audit
View -->|uses| RespModel
Audit -->|uses| AuditModels
Validator -->|uses| ApiErrResp

Service -->|calls| Operators
Service -->|calls| PersonRepo
Service -->|calls| CampaignRepo
PersonRepo -->|uses| DynamoDB
CampaignRepo -->|uses| S3Bucket
View -->|uses| ResponseModel
App -->|reads| Config
App -->|wires| Factory

Service -->|uses| ModelElig
Operators -->|uses| ModelRules
App -->|wires| Factory

```

Expand Down
1 change: 1 addition & 0 deletions infrastructure/modules/dynamodb/dynamodb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ resource "aws_dynamodb_table" "dynamodb_table" {
name = "${terraform.workspace == "default" ? "" : "${terraform.workspace}-"}${var.project_name}-${var.environment}-${var.table_name_suffix}"
billing_mode = "PAY_PER_REQUEST"
hash_key = var.partition_key
deletion_protection_enabled = var.environment == "prod"

attribute {
name = var.partition_key
Expand Down
1 change: 1 addition & 0 deletions infrastructure/modules/lambda/lambda.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ resource "aws_lambda_function" "eligibility_signposting_lambda" {
KINESIS_AUDIT_STREAM_TO_S3 = var.kinesis_audit_stream_to_s3_name
ENV = var.environment
LOG_LEVEL = var.log_level
ENABLE_XRAY_PATCHING = var.enable_xray_patching
}
}

Expand Down
5 changes: 5 additions & 0 deletions infrastructure/modules/lambda/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ variable "log_level" {
description = "log level"
type = string
}

variable "enable_xray_patching"{
description = "flag to enable xray tracing, which puts an entry for dynamodb, s3 and firehose in trace map"
type = string
}
45 changes: 44 additions & 1 deletion infrastructure/modules/s3/s3.tf
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,57 @@ data "aws_iam_policy_document" "access_logs_s3_bucket_policy" {
variable = "aws:SecureTransport"
}
}

# Allow S3 Log Delivery service to write access logs
statement {
sid = "S3ServerAccessLogsPolicy"
effect = "Allow"
principals {
type = "Service"
identifiers = ["logging.s3.amazonaws.com"]
}
actions = [
"s3:PutObject"
]
resources = [
"${aws_s3_bucket.storage_bucket_access_logs.arn}/*"
]
condition {
test = "ArnEquals"
variable = "aws:SourceArn"
values = [aws_s3_bucket.storage_bucket.arn]
}
}

# Allow S3 Log Delivery service to check bucket location and get bucket ACL
statement {
sid = "S3ServerAccessLogsDeliveryRootAccess"
effect = "Allow"
principals {
type = "Service"
identifiers = ["logging.s3.amazonaws.com"]
}
actions = [
"s3:GetBucketAcl",
"s3:ListBucket"
]
resources = [
aws_s3_bucket.storage_bucket_access_logs.arn
]
condition {
test = "ArnEquals"
variable = "aws:SourceArn"
values = [aws_s3_bucket.storage_bucket.arn]
}
}
}

resource "aws_s3_bucket_server_side_encryption_configuration" "storage_bucket_access_logs_server_side_encryption_config" {
bucket = aws_s3_bucket.storage_bucket_access_logs.id

rule {
apply_server_side_encryption_by_default {
sse_algorithm = "aws:kms"
sse_algorithm = "aws:kms"
kms_master_key_id = aws_kms_key.storage_bucket_cmk.arn
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ data "aws_iam_policy_document" "assumed_role_permissions_boundary" {
"support:*",
"sqs:*",
"tag:*",
"trustedadvisor:*"
"trustedadvisor:*",
"xray:*"
]

resources = ["*"]
Expand Down
Loading
Loading