feat: open realtime tokens to chat members

The connection-token route is guarded by jz.bm.realtime-access instead
of presentations.realtime-owner: chat-group members get a token, and
when golem15.presentations is active so does everyone its owner guard
lets through (looked up by name among the activated plugins, no import).
Everyone else gets 401, 403 or 503 in the guard's error shape. The
realtime routes mount when golem15.chat or golem15.presentations is
active. /_chat, /_chatchannels and /_chatbots are reserved prefixes of
the student app.
This commit is contained in:
2026-10-26 15:49:29 +01:00
parent cb7ba7ec8a
commit eea171cee6
4 changed files with 131 additions and 17 deletions

View File

@@ -37,10 +37,10 @@ const (
const defaultAdminPath = "/bmadmin"
// reservedPrefixes are the path prefixes the student app never answers: the
// APIs of the plugins, the public uploads and /oauth (the social sign-in
// routes of golem15.sociallogin and their provider callbacks). The admin
// path is added from the configuration.
var reservedPrefixes = []string{"/_user", "/_bm", "/_quizzes", "/_presentations", "/api", "/storage", "/oauth"}
// APIs of the plugins (the chat plugins' included), the public uploads and
// /oauth (the social sign-in routes of golem15.sociallogin and their
// provider callbacks). The admin path is added from the configuration.
var reservedPrefixes = []string{"/_user", "/_bm", "/_quizzes", "/_presentations", "/_chat", "/_chatchannels", "/_chatbots", "/api", "/storage", "/oauth"}
// errMissingIndex reports a tree without index.html (an unbuilt tree).
var errMissingIndex = errors.New("jz.bm: public/index.html missing; run the frontend build (cd frontend && npm ci && npm run build)")