feat: serve the quiz API under /_quizzes/api/v1 behind jwt.auth

This commit is contained in:
Jakub Zych
2026-10-02 14:13:30 +02:00
parent 4d4da5dc14
commit effe640549
16 changed files with 2232 additions and 11 deletions

View File

@@ -32,13 +32,28 @@ var langFS embed.FS
var mailFS embed.FS
// Plugin is the golem15.quizzes plugin.
type Plugin struct{}
type Plugin struct {
app *backpack.App
}
func (p *Plugin) ID() string { return "golem15.quizzes" }
func (p *Plugin) Requires() []string { return nil }
func (p *Plugin) ID() string { return "golem15.quizzes" }
func (p *Plugin) Register(*backpack.App) error { return nil }
func (p *Plugin) Boot(*backpack.App) error { return nil }
// Requires golem15.user: the API runs behind its jwt.auth middleware and
// attempts reference its users table.
func (p *Plugin) Requires() []string { return []string{"golem15.user"} }
// Register keeps the application, so route handlers and commands can reach
// its services, such as the database, when they run.
func (p *Plugin) Register(app *backpack.App) error {
p.app = app
return nil
}
// Boot keeps the application.
func (p *Plugin) Boot(app *backpack.App) error {
p.app = app
return nil
}
func (p *Plugin) ConfigFS() fs.FS { return configFS }
func (p *Plugin) LangFS() fs.FS { return langFS }