Fix some formatting to use tuples

This commit is contained in:
Daniel Wagner-Hall 2015-08-18 15:18:50 +01:00
parent 1469141023
commit 3e6fdfda00
2 changed files with 5 additions and 5 deletions

View File

@ -279,11 +279,11 @@ class RegistrationHandler(BaseHandler):
identifier = "key",
key = self.hs.config.macaroon_secret_key)
macaroon.add_first_party_caveat("gen = 1")
macaroon.add_first_party_caveat("user_id = %s" % user_id)
macaroon.add_first_party_caveat("user_id = %s" % (user_id,))
macaroon.add_first_party_caveat("type = access")
now = self.hs.get_clock().time()
expiry = now + 60 * 60
macaroon.add_first_party_caveat("time < %s" % expiry)
now = self.hs.get_clock().time_msec()
expiry = now + (60 * 60 * 1000)
macaroon.add_first_party_caveat("time < %d" % (expiry,))
return macaroon.serialize()

View File

@ -67,4 +67,4 @@ class RegisterTestCase(unittest.TestCase):
v.satisfy_general(verify_user)
v.satisfy_general(verify_type)
v.satisfy_general(verify_expiry)
v.verify(macaroon, self.hs.config.macaroon_secret_key)
v.verify(macaroon, self.hs.config.macaroon_secret_key)