adds support for cors on storage accounts#193
Conversation
df5f53f to
371fdfd
Compare
| allowed_methods = cors_rule.value.allowed_methods | ||
| allowed_origins = cors_rule.value.allowed_origins | ||
| exposed_headers = cors_rule.value.exposed_headers | ||
| max_age_in_seconds = cors_rule.value.max_age_in_seconds |
There was a problem hiding this comment.
Should we hardcode, or restrict any of these values? e.g. exposed_headers might be something we could hardcode depending on what TV require, as that might be common for all services that want to use this?
for allowed_origins maybe we want to stop * if that's possible?
ff6bd19 to
eea1eae
Compare
98bd3e6 to
4c2c7fc
Compare
| })) | ||
| description = "A list of CORS rules to apply to the stroage account" | ||
| default = [] | ||
| } No newline at end of file |
There was a problem hiding this comment.
The defaults look to be good ones to me
hopep-mobilise
left a comment
There was a problem hiding this comment.
The defaults look to be good choices to me
| type = list(object({ | ||
| allowed_headers = optional(list(string), ["Content-Type", "Content-MD5", "Content-Disposition", "x-ms-blob-content-disposition", "x-ms-blob-type"]), | ||
| allowed_methods = optional(list(string), ["PUT"]), | ||
| allowed_origins = optional(list(string)), |
There was a problem hiding this comment.
can we stop * for allowed origins using a validation rule? i.e. https://developer.hashicorp.com/terraform/language/block/variable#validation
| allowed_headers = optional(list(string), ["Content-Type", "Content-MD5", "Content-Disposition", "x-ms-blob-content-disposition", "x-ms-blob-type"]), | ||
| allowed_methods = optional(list(string), ["PUT"]), | ||
| allowed_origins = optional(list(string)), | ||
| exposed_headers = optional(list(string), ["*"]), |
There was a problem hiding this comment.
same here, we don't want to allow *. Think we should restrict allowed_headers to specifics (and allowed_headers) using a validation rule if possible
e72da6b to
100b6b1
Compare
ec67939 to
d642022
Compare
d642022 to
4f4aba7
Compare
Setup CORS rules through Terraform that will set & stay between deployments. They will allow Direct Uploads (Browser -> Storage server) in all our environments. Infra team has enabled for us the support for CORS config on the storage accounts: DFE-Digital/terraform-modules#193
Setup CORS rules through Terraform that will set & stay between deployments. They will allow Direct Uploads (Browser -> Storage server) in all our environments. Infra team has enabled for us the support for CORS config on the storage accounts: DFE-Digital/terraform-modules#193
## Trello card URL https://trello.com/c/IdNp4YfN/2667-file-attachment-error-in-candidate-message-section-ats-evaluation-march-2026 ## Changes in this PR: Set up CORS rules through Terraform that will set & stay between deployments. They will allow Direct Uploads (Browser -> Storage server) in all our environments. Infra team has enabled for us the support for CORS config on the storage accounts: DFE-Digital/terraform-modules#193 ## Screenshots of UI changes: ### Before <img width="2478" height="478" alt="Screenshot From 2026-06-12 16-55-33" src="https://github.com/user-attachments/assets/668470e6-7645-4816-b78a-f5917daa2d29" /> ### After <img width="2525" height="476" alt="Screenshot From 2026-06-12 16-53-57" src="https://github.com/user-attachments/assets/1d684749-f4f0-4c5a-a79a-c5fdd541c4a2" /> <img width="2532" height="539" alt="image" src="https://github.com/user-attachments/assets/c5fe47fd-c520-4317-9d25-e82194f2740a" /> ## Checklists: ### Data & Schema Changes If this PR modifies data structures or validations, check the following: - [ ] Adds/removes model validations - [ ] Adds/removes database fields - [ ] Modifies Vacancy enumerables (phases, working patterns, job roles, key stages, etc.) <details> <summary>If any of the above options has changed then the author must check/resolve all of the following...</summary> ### Integration Impact Does this change affect any of these integrations? - [ ] DfE Analytics platform - [ ] Legacy imports mappings - [ ] DWP Find a Job export mappings - [ ] Publisher ATS API (may require mapping updates or API versioning) ### User Experience & Data Integrity Could this change impact: - [ ] Existing subscription alerts (will legacy subscription search filters break?) - [ ] Legacy vacancy copying (will copied vacancies fail new validations?) - [ ] In-progress drafts for Vacancies or Job Applications </details>
Context
Adds the ability to set cors rules on storage accounts via the terraform module.
Changes proposed in this pull request
Adds the a dynamic block for cors_rules to the blob_properties of the stroage account reasource.
Guidance to review
Can be tested by deploying a review app that uses a storage account and adding to cors_rule block as described in the readme.
Before merging
After merging
Checklist
Devopslabel