mirror of
https://mau.dev/maunium/synapse.git
synced 2024-11-18 16:02:15 +01:00
Always check guest = true in macaroons
This commit is contained in:
parent
f5e25c5f35
commit
f20d064e05
1 changed files with 2 additions and 1 deletions
|
@ -589,7 +589,7 @@ class Auth(object):
|
||||||
macaroon = pymacaroons.Macaroon.deserialize(macaroon_str)
|
macaroon = pymacaroons.Macaroon.deserialize(macaroon_str)
|
||||||
self.validate_macaroon(
|
self.validate_macaroon(
|
||||||
macaroon, "access",
|
macaroon, "access",
|
||||||
[lambda c: c == "guest = true", lambda c: c.startswith("time < ")]
|
[lambda c: c.startswith("time < ")]
|
||||||
)
|
)
|
||||||
|
|
||||||
user_prefix = "user_id = "
|
user_prefix = "user_id = "
|
||||||
|
@ -643,6 +643,7 @@ class Auth(object):
|
||||||
v.satisfy_exact("gen = 1")
|
v.satisfy_exact("gen = 1")
|
||||||
v.satisfy_exact("type = " + type_string)
|
v.satisfy_exact("type = " + type_string)
|
||||||
v.satisfy_general(lambda c: c.startswith("user_id = "))
|
v.satisfy_general(lambda c: c.startswith("user_id = "))
|
||||||
|
v.satisfy_exact("guest = true")
|
||||||
|
|
||||||
for validation_function in additional_validation_functions:
|
for validation_function in additional_validation_functions:
|
||||||
v.satisfy_general(validation_function)
|
v.satisfy_general(validation_function)
|
||||||
|
|
Loading…
Reference in a new issue