Skip to content

BB2-5115 added log for CAN workflow - #1726

Open
rsjimenez-icf wants to merge 1 commit into
masterfrom
BB2-5115-Add-CAN-logs
Open

BB2-5115 added log for CAN workflow#1726
rsjimenez-icf wants to merge 1 commit into
masterfrom
BB2-5115-Add-CAN-logs

Conversation

@rsjimenez-icf

Copy link
Copy Markdown
Contributor

JIRA Ticket:
BB2-5115

What Does This PR Do?

Adds a parameter for logging which CSP is used.

What Should Reviewers Watch For?

If you're reviewing this PR, please check for these things in particular:

Validation

Test the /v3/o/token endpoint locally using a client _assertion in the body that is a JWT that includes "https://verified.clearme.com/integrations/".
You should see in the logs of your local docker instance a line like this one that now includes the csp property with the matching url:
INFO [67] hhs_server.apps.dot_ext.views.authorization line:1263 {"type": "request_response_middleware", "app_name": "TestApp", "csp": "https://verified.clearme.com/integrations/", "patient": "-731271436", "path": "/v3/o/token", "patient_match_found": true}

What Security Implications Does This PR Have?

Please indicate if this PR does any of the following:

  • Adds any new software dependencies
  • Modifies any security controls
  • Adds new transmission or storage of data
  • Any other changes that could possibly affect security?
  • Yes, one or more of the above security implications apply. This PR must not be merged without the ISSO or team
    security engineer's approval.

Any Migrations?

  • Yes, there are migrations
    • The migrations should be run PRIOR to the code being deployed
    • The migrations should be run AFTER the code is deployed
    • There is a more complicated migration plan (downtime,
      etc)
  • No migrations

assert '"patient_match_found": true' in auth_logs.output[1]
assert '"req_grant_type": "client_credentials"' in request_logs.output[0]
assert '"req_app_name": "CC App"' in request_logs.output[0]
assert '"csp": "https://api.idmelabs.com/oidc"' in auth_logs.output[1]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could use the IDME_LOWER_ISS constant for this instead


log_dict['patient_match_found'] = True
log_dict['patient'] = fhir_id
log_dict['csp'] = pre_verified_ial.get('iss', None)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the test_client_credentials_returns_patient_match_not_found_401 test to pass, and to make sure we have the csp for whether the patient match was found or not, we'll need to move this line outside of the if/else. I think it would be best when the 'csp' attribute is instantiated.

assert '"patient_match_found": false' in auth_logs.output[1]
assert '"req_grant_type": "client_credentials"' in request_logs.output[0]
assert '"req_app_name": "CC App"' in request_logs.output[0]
assert '"csp": "https://api.idmelabs.com/oidc"' in auth_logs.output[1]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also use IDME_LOWER_ISS once authorization.py change is made.

@JamesDemeryNava JamesDemeryNava left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Couple small changes and this will be ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants