Skip to content
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

Update Django-specific signature header to Signature-256 #207

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

thorrak
Copy link

@thorrak thorrak commented May 23, 2023

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

  • 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

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

License

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

Updates the Django-specific signature header to use SHA-256 rather than SHA-1
Fixes alexa#202
Ensures that Django support matches the requirement for SHA-256 introduced in 1.3.3
@thorrak
Copy link
Author

thorrak commented May 23, 2023

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
Copy link
Author

thorrak commented Sep 11, 2023

I updated this PR to match the latest changes

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.

None yet

1 participant