alexa-skills-kit-sdk-for-python icon indicating copy to clipboard operation
alexa-skills-kit-sdk-for-python copied to clipboard

Update Django-specific signature header to Signature-256

Open thorrak opened this issue 1 year ago • 2 comments

Description

Updates the Django-specific signature header to use SHA-256 rather than SHA-1 in order to remain compatible with the changes from @doiron in #200 .

Motivation and Context

This fixes the bug highlighted in #202 and allows django_ask_sdk to be used with the latest ask-sdk-webservice-support

Testing

Tested on a skill I host. Allows the skill to be used with the other changes in the latest version of the django_ask_sdk

Types of changes

  • [x] Bug fix (non-breaking change which fixes an issue)
  • [ ] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • [x] My code follows the code style of this project
  • [ ] My change requires a change to the documentation
  • [ ] I have updated the documentation accordingly
  • [x] I have read the README document
  • [ ] I have added tests to cover my changes
  • [ ] All new and existing tests passed

License

  • [x] By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

thorrak avatar May 23 '23 18:05 thorrak

I additionally bumped the required version of ask-sdk-webservice-support to 1.3.3 or greater, so any new release of the django_ask_sdk package won't get used with an older ask-sdk-webservice-support version (since the headers specified for use in Django won't match the algorithm in use).

An alternative (though not one I'm in favor of!) would be to do something like:

from ask_sdk_webservice_support import verifier_constants
SIGNATURE_KEY = f"HTTP_{verifier_constants.SIGNATURE_HEADER.upper().replace('-','_')}"

...which should work in both legacy (<1.3.3) and up-to-date (1.3.3) ask-sdk-webservice-support

thorrak avatar May 23 '23 20:05 thorrak

I updated this PR to match the latest changes

thorrak avatar Sep 11 '23 05:09 thorrak