Add support for requests parameters verify and cert#12
Open
tosinator wants to merge 1 commit intoemesik:masterfrom
Open
Add support for requests parameters verify and cert#12tosinator wants to merge 1 commit intoemesik:masterfrom
tosinator wants to merge 1 commit intoemesik:masterfrom
Conversation
emesik
requested changes
Nov 24, 2021
| _log.debug("WalletREST backend url: {:s}".format(self.base_url)) | ||
|
|
||
| def raw_request(self, method, path, params=None): | ||
| def raw_request(self, method, path, params=None, verify=None, cert=None): |
Owner
There was a problem hiding this comment.
It seems this method doesn't use the new keywords
Author
There was a problem hiding this comment.
Yikes, seems like I need to get some sleep.
I'll take a look at this (and other comments) tomorrow with fresh eyes and will re-submit.
Thanks for fast review!
| u"{method} {url}\nParams:\n{params}".format( | ||
| method=method, | ||
| url=url, | ||
| verify=verify, |
Owner
There was a problem hiding this comment.
These aren't used in the resulting message
| ) | ||
| rsp = getattr(requests, method.lower())( | ||
| url, headers=hdr, data=json.dumps(params), timeout=self.timeout | ||
| url, headers=hdr, data=json.dumps(params), timeout=self.timeout, verify=self.verify, cert=self.cert |
Owner
There was a problem hiding this comment.
kwargs are dropped but instead values from self. are used (which is right)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have been using Daedalus as my cardano-wallet provider. Daedalus uses HTTPS with custom CA and client certificates. In order to be able to use them properly, we need to pass "verify" and "cert" parameters to requests library. This patch accomplishes that.
I'm not sure if I need to consider anything else (I used this library only for a little).
If not a direct contribution to code, hopefully this at least serves as a feature request.
Thanks!