-
Notifications
You must be signed in to change notification settings - Fork 766
ValidationClient for client validation, add ClientValidationJwt #309
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
Conversation
✅ Smoke tested |
👍 |
|
||
def test_build_validation_payload_complex(self): | ||
self.request.body = 'foobar' | ||
self.request.url = self.request.url + '?WestCoast=BestCoast&EastCoast=LeastCoast' |
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.
Let's go with a more inclusive example here @efossier. :D
'sub': 'AC123', | ||
}, jwt.payload) | ||
self.assertGreaterEqual(jwt.payload['exp'], time.time(), 'JWT exp is before now') | ||
self.assertLessEqual(jwt.payload['exp'], time.time() + 501, 'JWT exp is after now + 5mins') |
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.
501 seconds is actually closer to 8 minutes.
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.
Nevermind.
twilio/jwt/validation/__init__.py
Outdated
input_str = input_str.encode('utf-8') | ||
|
||
return sha256(input_str).hexdigest() | ||
|
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 8000 .
Kill blank line.
Still need to smoke test this.