diff options
author | Till <2353100+S7evinK@users.noreply.github.com> | 2022-11-11 10:52:08 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-11 10:52:08 +0100 |
commit | d35a5642e89a2a1b64f1c2ed1cb13e6080987b1c (patch) | |
tree | ee1d6aa33fad1b2ec52cbd81024d321febd3dbf1 /setup/mscs/msc2946 | |
parent | 0193549201299f5dcce919b2aeb3b1c40bdfcefa (diff) |
Deny guest access on several endpoints (#2873)
Second part for guest access, this adds a `WithAllowGuests()` option to
`MakeAuthAPI`, allowing guests to access the specified endpoints.
Endpoints taken from the
[spec](https://spec.matrix.org/v1.4/client-server-api/#client-behaviour-14)
and by checking Synapse endpoints for `allow_guest=true`.
Diffstat (limited to 'setup/mscs/msc2946')
-rw-r--r-- | setup/mscs/msc2946/msc2946.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/setup/mscs/msc2946/msc2946.go b/setup/mscs/msc2946/msc2946.go index bc9df0f9..d7c02254 100644 --- a/setup/mscs/msc2946/msc2946.go +++ b/setup/mscs/msc2946/msc2946.go @@ -57,7 +57,7 @@ func Enable( base *base.BaseDendrite, rsAPI roomserver.RoomserverInternalAPI, userAPI userapi.UserInternalAPI, fsAPI fs.FederationInternalAPI, keyRing gomatrixserverlib.JSONVerifier, cache caching.SpaceSummaryRoomsCache, ) error { - clientAPI := httputil.MakeAuthAPI("spaces", userAPI, spacesHandler(rsAPI, fsAPI, cache, base.Cfg.Global.ServerName)) + clientAPI := httputil.MakeAuthAPI("spaces", userAPI, spacesHandler(rsAPI, fsAPI, cache, base.Cfg.Global.ServerName), httputil.WithAllowGuests()) base.PublicClientAPIMux.Handle("/v1/rooms/{roomID}/hierarchy", clientAPI).Methods(http.MethodGet, http.MethodOptions) base.PublicClientAPIMux.Handle("/unstable/org.matrix.msc2946/rooms/{roomID}/hierarchy", clientAPI).Methods(http.MethodGet, http.MethodOptions) |