Skip to content

Requests #71

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

Merged
merged 83 commits into from
Aug 21, 2020
Merged

Requests #71

merged 83 commits into from
Aug 21, 2020

Conversation

sheagcraig
Copy link
Contributor

This PR pulls out the curl wrapper used currently and replaces it with python requests.

Why?

This was predicated on having mysterious curl failures that I could only resolve by dropping from http2 down to http1.1 by editing the curl command used OR using a current brew curl instead of the OS-provided one.

Instead, I figured why not just use requests? So I created a separate project to provide requests tools to let you use the macOS keychain for verifying SSL certs (pip install macsesh) and moved all of the requests between the client and Sal into a client class.

This cleans up some of the error handling and logging as a freebie.

Outstanding, I have yet to hear from anyone regarding whether they use sal-scripts with client certs for mutual TLS that relies on specifying the cert by name (i.e. curl built with secure transport) rather than providing the path to a cert somewhere on disk. I don't have a test environment for this, and it seems unlikely that anyone else does, since the existing code seems to contradict the curl man page's information re: how to use certs by name and not actually work.

If you rely on this, and you want it to keep working, please contact me! I think we have an easy way to handle this, but I want to make sure!

sheagcraig added 30 commits May 27, 2020 16:17
This is used for making python requests use the keychain.
Also, this prevents a bug I discovered that would have a null model
being written to disk, and then no further attempts to check later.
This is used primarily for debugging to a local Sal instance, or
submitting to a staging/test server.
sheagcraig and others added 28 commits August 21, 2020 10:46
This is used primarily for debugging to a local Sal instance, or
submitting to a staging/test server.
@sheagcraig sheagcraig merged commit 60fd88c into master Aug 21, 2020
@sheagcraig sheagcraig deleted the requests branch August 21, 2020 14:48
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