Skip to content

Signer should return string being the value of the authorization header #64

Description

@numbat

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions