Merge "Do not log token string"

This commit is contained in:
Zuul 2018-08-17 00:32:34 +00:00 committed by Gerrit Code Review
commit 75b51babce
2 changed files with 2 additions and 3 deletions

View File

@ -46,11 +46,10 @@ class TestFernetTokenProvider(unit.TestCase):
def test_invalid_token_raises_token_not_found(self):
token_id = uuid.uuid4().hex
e = self.assertRaises(
self.assertRaises(
exception.TokenNotFound,
self.provider.validate_token,
token_id)
self.assertIn(token_id, u'%s' % e)
class TestValidate(unit.TestCase):

View File

@ -91,7 +91,7 @@ class TokenFormatter(object):
return self.crypto.decrypt(token.encode('utf-8'))
except fernet.InvalidToken:
raise exception.ValidationError(
_('This is not a recognized Fernet token %s') % token)
_('Could not recognize Fernet token'))
@classmethod
def restore_padding(cls, token):