Help us shape the future of Go! Take the 2026 Go Developer Survey

middleware

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package middleware provides HTTP middleware for the outtake API.

Index

Constants

View Source
const SessionKeyToken = identity.SessionKeyToken

SessionKeyToken is the session key used to store the Plex authentication token.

Variables

This section is empty.

Functions

func AuthGuard

func AuthGuard(env string) fiber.Handler

AuthGuard rejects a request that has no Plex token in its session.

Parameters:

  • env: Configured environment. The e2e environment skips the check.

Returns:

  • handler: Middleware that redirects or answers anonymous requests.

func BindCSRFToken

func BindCSRFToken() fiber.Handler

BindCSRFToken copies the Fiber CSRF token onto the request context for templates.

Returns:

  • handler: Middleware that stores the token and continues the chain.

func RequestLogger

func RequestLogger() fiber.Handler

RequestLogger logs one line per request after the handler chain returns.

Returns:

  • handler: Middleware that logs method, path, status, and duration.

func RestoreToken

func RestoreToken(store identity.TokenStore) fiber.Handler

RestoreToken loads a persisted Plex token into the session when missing.

Parameters:

  • store: Persisted token store.

Returns:

  • handler: Middleware that seeds the session and continues the chain.

Types

This section is empty.

Jump to

Keyboard shortcuts

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