middleware

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Admin

func Admin(cfg config.Config) echo.MiddlewareFunc

Admin enforces DNSFLEET_ADMIN_TOKEN on /api/v1 when AdminInsecureDisable is false. Bearer in Authorization takes precedence for comparison when both headers carry a token value.

func AdminWS

func AdminWS(cfg config.Config) echo.MiddlewareFunc

AdminWS enforces DNSFLEET_ADMIN_TOKEN for WebSocket Upgrade on routes under the /api/v1/ws group (v0.1: GET /logs → full path GET /api/v1/ws/logs). The group prefix alone is not a leaf URL. Unlike Admin, it accepts Query "token" as an alternative to Authorization Bearer / X-Admin-Token (Step 4 §4.A). REST /api/v1 routes must not use this middleware; keep Query "token" off the general Admin path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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