Skip to content

App id verification #32

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

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

Conversation

fernandoaguilar
Copy link

hey i wrote some code to verify application ids since its needed to pass Amazon submission. Let me know if you are fine with this code or if you need me to make any changes or if you know a cleaner way of doing this.

@@ -50,6 +55,19 @@ def access_token(self):
def session_id(self):
return self.request["session"]["sessionId"]

def application_id(self):
try:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace the generic exception handling with an explicit check, or at least catch the specific exception

class Request(object):
"""
Simple wrapper around the JSON request
received by the module
"""
def __init__(self, request_dict, metadata=None):
def __init__(self, request_dict, metadata=None, supported_app_ids=None):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't it make more sense to do the supported app IDs verification in the VoiceHandler object?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry for late reply, been really busy, but yes it does i just made this on the quickness, didnt really think about it too much, ill make the changes.

@@ -192,11 +210,18 @@ def _handler(func):

return _handler

def route_request(self, request_json, metadata=None):
def route_request(self, request_json, metadata=None, app_ids=None):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that having the app_ids as a construction parameter for the 'alexa' makes more sense than passing it into a parameter for route_request

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i agree, should i add it to the constructor somehow? or do alexa.app_ids = [...] in lambda_handler?

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.

2 participants