middlewares

package
v0.0.0-...-cea7f4a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Admin

func Admin(db *bun.DB) gin.HandlerFunc

func Auth

func Auth(db *bun.DB) gin.HandlerFunc

func Editor

func Editor(db *bun.DB) gin.HandlerFunc

Editor middleware restricts access to users with the "editor" or "admin" global role, as well as service tokens. It follows the same validation flow as the Admin middleware.

func Mixed

func Mixed(db *bun.DB) gin.HandlerFunc

func PrometheusMiddleware

func PrometheusMiddleware() gin.HandlerFunc

PrometheusMiddleware records metrics for each request

func Runner

func Runner(db *bun.DB) gin.HandlerFunc

Runner validates JWT tokens for authenticated runner endpoints. The shared runner secret is NOT accepted here — use RunnerRegister for /register.

func RunnerBusyRateLimit

func RunnerBusyRateLimit() gin.HandlerFunc

RunnerBusyRateLimit allows at most one busy request per runner per second.

func RunnerHeartbeatRateLimit

func RunnerHeartbeatRateLimit() gin.HandlerFunc

RunnerHeartbeatRateLimit allows at most one heartbeat request per runner every 5 seconds.

func RunnerRegister

func RunnerRegister(db *bun.DB) gin.HandlerFunc

RunnerRegister validates runner tokens for the /register endpoint. Accepts both JWT tokens and the configured shared runner secret.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址