-
Notifications
You must be signed in to change notification settings - Fork 56
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
base: master
Are you sure you want to change the base?
App id verification #32
Conversation
…in route request if any app ids are passed in.
@@ -50,6 +55,19 @@ def access_token(self): | |||
def session_id(self): | |||
return self.request["session"]["sessionId"] | |||
|
|||
def application_id(self): | |||
try: |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
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.