See comments in: #58
And: https://github.com/Covata/delta-sdk-python/blob/master/src/main/python/covata/delta/signer.py
My proposal is to shift the the insertion of extra header values into the ApiClient, specifically into either the individual request methods or into the signer. My preference is for verbosity so that we are explicit about the request construction and manually add it into the header section (I feel this will also help make reading the requests easier for people that want to pattern or craft their own requests manually):
response = requests.post(
url="{base_url}{resource}".format(
base_url=self.DELTA_URL,
resource=self.RESOURCE_SECRETS),
headers={
"cvt-date": datetime.utcnow().strftime(CVT_DATE_FORMAT),
"host": self.DELTA_URL
},
....
This refactor would result in the sign_request method in ApiClient receiving a str response instead of the current dict[str,str] and result in some possible simplifications of the test_signer module.
See comments in: #58
And: https://github.com/Covata/delta-sdk-python/blob/master/src/main/python/covata/delta/signer.py
My proposal is to shift the the insertion of extra header values into the
ApiClient, specifically into either the individual request methods or into the signer. My preference is for verbosity so that we are explicit about the request construction and manually add it into the header section (I feel this will also help make reading the requests easier for people that want to pattern or craft their own requests manually):This refactor would result in the
sign_requestmethod inApiClientreceiving astrresponse instead of the currentdict[str,str]and result in some possible simplifications of thetest_signermodule.