-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jadudm/automatic uei waiver #4872
base: main
Are you sure you want to change the base?
Conversation
I really don't know what we want to put for the name of the entity. It might be better to leave blank. I'm going to move this to a draft PR for others to put eyes on.
Terraform plan for meta No changes. Your infrastructure matches the configuration.
📝 Plan generated in Pull Request Checks #4584 |
Terraform plan for dev Plan: 1 to add, 0 to change, 1 to destroy.Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
-/+ destroy and then create replacement
Terraform will perform the following actions:
# module.dev.module.cors.null_resource.cors_header must be replaced
-/+ resource "null_resource" "cors_header" {
!~ id = "*******************" -> (known after apply)
!~ triggers = { # forces replacement
!~ "always_run" = "2025-04-10T13:38:47Z" -> (known after apply)
}
}
Plan: 1 to add, 0 to change, 1 to destroy. 📝 Plan generated in Pull Request Checks #4584 |
This pull request is not up to date with main. Please merge main into this brach or rebase this branch onto main. This PR should not be approved until all status checks pass. If you see this message, please rerun all status checks before merging. |
Adding a check to see the waiver was granted/generated.
This pull request is not up to date with main. Please merge main into this brach or rebase this branch onto main. This PR should not be approved until all status checks pass. If you see this message, please rerun all status checks before merging. |
Because we allow a 403/404, we need to make sure we match the schema here.
|
@jadudm class MockResponse:
def __init__(self, status_code, reason=None, json_data=None):
self.status_code = status_code
self.reason = reason or self.get_reason_phrase(status_code)
self._json = json_data or {}
def json(self):
return self._json
...
...
...
resp, error = call_sam_api(SAM_API_URL, api_params, api_headers)
resp = MockResponse(403) # Simulating a 403 On the UI side, after the pop-up prompting me to input the entity name appeared, I clicked “Cancel,” then repeated the same steps three times. On the third attempt, I clicked OK and noticed that it created three |
Haiku-length summary
If SAM is away
The audits must flow anon
Grant waivers forthwith
Description
This PR catches HTTP responses from SAM.gov in the set
{401, 403, 404, 405, 406, 410, 418, 429, 451}
, which would occur if we had an API key that was no longer valid or if SAM.gov was offline. (Several of the responses are highly unlikely, but we handle them "just in case.") Currently, when this occurs, users of the FAC can no longer create audits. We have decided we must more gracefully handle SAM.gov errors, and are going to automatically issue a waiver (and log/provide an auditable trail) when we encounter this situation.This PR also brings in the ADR marking this decision.
Questions
uei.py
) That is, should we handle conditions where SAM is offline the same way (a 404)?To do
PR Checklist: Submitter
main
into your branch shortly before creating the PR. (You should also be mergingmain
into your branch regularly during development.)git status | grep migrations
. If there are any results, you probably need to add them to the branch for the PR. Your PR should have only one new migration file for each of the component apps, except in rare circumstances; you may need to delete some and re-runpython manage.py makemigrations
to reduce the number to one. (Also, unless in exceptional circumstances, your PR should not delete any migration files.)PR Checklist: Reviewer
make docker-clean; make docker-first-run && docker compose up
; then rundocker compose exec web /bin/bash -c "python manage.py test"
The larger the PR, the stricter we should be about these points.
Pre Merge Checklist: Merger
-/+ resource "null_resource" "cors_header"
should be destroying and recreating its self and~ resource "cloudfoundry_app" "clamav_api"
might be updating itssha256
for thefac-file-scanner
andfac-av-${ENV}
by default.main
.