Skip to content

Conversation

@reweeden
Copy link
Contributor

@reweeden reweeden commented Dec 30, 2024

Refactor urllib request calls to EDL to an EDL client so that each request is handled consistently with regards to the timing code, log calls and error handling.

I tested this by deploying a dev stack of TEA and running a few checks with bearer tokens and browser downloads. asfadmin/thin-egress-app#855

@reweeden reweeden force-pushed the rew/pr-3242-refactor-edl-client branch 3 times, most recently from 7b41a12 to 9b6ebb2 Compare December 31, 2024 01:33
@reweeden reweeden force-pushed the rew/pr-3242-refactor-edl-client branch 2 times, most recently from fb2e5e6 to 82d4657 Compare December 31, 2024 02:11
@reweeden reweeden force-pushed the rew/pr-3242-refactor-edl-client branch from 82d4657 to bc42fec Compare December 31, 2024 02:14
gjclark
gjclark previously approved these changes Jan 2, 2025
# sample json in this case:
# `{"status_code": 403, "error_description": "EULA Acceptance Failure",
# "resolution_url": "http://uat.urs.earthdata.nasa.gov/approve_app?client_id=LqWhtVpLmwaD4VqHeoN7ww"}`
log.warning('user needs to sign the EULA')
Copy link
Contributor

Choose a reason for hiding this comment

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

is it bad to log the user name here? It would make searching the logs far easier in something like tea?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the TEA code the username is added to the log context meaning it will automatically show up when JSON logging is used.

I don't actually know how to get the username here in general. I think it would have to come from the request params somehow, but might not be entirely consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It wouldn't be bad though.

mattp0
mattp0 previously approved these changes Jan 3, 2025
@reweeden reweeden dismissed stale reviews from mattp0 and gjclark via 7898c91 January 6, 2025 19:05
@reweeden reweeden force-pushed the rew/pr-3242-refactor-edl-client branch from bc42fec to 7898c91 Compare January 6, 2025 19:05
@reweeden reweeden requested review from gjclark and mattp0 January 6, 2025 19:06
@reweeden reweeden merged commit 1be6756 into master Jan 7, 2025
7 of 8 checks passed
@reweeden reweeden deleted the rew/pr-3242-refactor-edl-client branch January 7, 2025 00:52
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.

5 participants