-
Notifications
You must be signed in to change notification settings - Fork 12
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
add function for querying collections from CMR #290
Conversation
add function for retrieving the maximum available version for a dataset
# ssl context | ||
ctx = ssl.create_default_context() | ||
ctx.check_hostname = False | ||
ctx.verify_mode = ssl.CERT_NONE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
out of curiosity what does this do is it necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sometimes urllib
throws ssl
errors if a context is not provided
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this disables cert verification. So it protects against man-in-the-middle and things like that. There are a handful of reasons a valid cert could fail to be verified; and while I know technically we shouldn't do this, it appears in the code for CMR access elsewhere and I don't think it is overly risky as there is no sensitive information being passed in either direction.
req = urllib.request.Request(cmr_query_url) | ||
response = urllib.request.urlopen(req, context=ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requests
is a dependency
https://github.com/ICESat2-SlideRule/sliderule/blob/7e16d3e90efc932fc96219a2bba81daf040b44fa/clients/python/requirements.txt#L1
but is urllib easy enough to use instead throughout the client such that requests could be dropped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. we might want to create an issue to unify how HTTP requests work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I think this will be helpful. Suggest adding a test to:
thanks @scottyhq! I added some tests to the |
Looks like some of the tests are failing related to arcticdem file names. But this error as well: |
Looks like |
add function for retrieving the maximum available version for a dataset