mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-10-02 21:48:28 -04:00
add org.matrix.login.jwt so that m.login.jwt can be deprecated (#7675)
This commit is contained in:
parent
8bbe87f42d
commit
6920e58136
3 changed files with 12 additions and 4 deletions
|
@ -526,7 +526,9 @@ class JWTTestCase(unittest.HomeserverTestCase):
|
|||
return jwt.encode(token, secret, "HS256").decode("ascii")
|
||||
|
||||
def jwt_login(self, *args):
|
||||
params = json.dumps({"type": "m.login.jwt", "token": self.jwt_encode(*args)})
|
||||
params = json.dumps(
|
||||
{"type": "org.matrix.login.jwt", "token": self.jwt_encode(*args)}
|
||||
)
|
||||
request, channel = self.make_request(b"POST", LOGIN_URL, params)
|
||||
self.render(request)
|
||||
return channel
|
||||
|
@ -568,7 +570,7 @@ class JWTTestCase(unittest.HomeserverTestCase):
|
|||
self.assertEqual(channel.json_body["error"], "Invalid JWT")
|
||||
|
||||
def test_login_no_token(self):
|
||||
params = json.dumps({"type": "m.login.jwt"})
|
||||
params = json.dumps({"type": "org.matrix.login.jwt"})
|
||||
request, channel = self.make_request(b"POST", LOGIN_URL, params)
|
||||
self.render(request)
|
||||
self.assertEqual(channel.result["code"], b"401", channel.result)
|
||||
|
@ -640,7 +642,9 @@ class JWTPubKeyTestCase(unittest.HomeserverTestCase):
|
|||
return jwt.encode(token, secret, "RS256").decode("ascii")
|
||||
|
||||
def jwt_login(self, *args):
|
||||
params = json.dumps({"type": "m.login.jwt", "token": self.jwt_encode(*args)})
|
||||
params = json.dumps(
|
||||
{"type": "org.matrix.login.jwt", "token": self.jwt_encode(*args)}
|
||||
)
|
||||
request, channel = self.make_request(b"POST", LOGIN_URL, params)
|
||||
self.render(request)
|
||||
return channel
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue