middleware

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const AdminClaimsKey = "admin_claims"

Variables

This section is empty.

Functions

func FiberMiddleware

func FiberMiddleware(a *fiber.App, healthChecker *health.Checker)

FiberMiddleware provide Fiber's built-in middlewares. See: https://docs.gofiber.io/api/middleware

func FormatResponse

func FormatResponse() fiber.Handler

FormatResponse middleware formats the response to a standard format.

func GetAdminClaims

func GetAdminClaims(c *fiber.Ctx) *auth.Claims

GetAdminClaims retrieves admin claims from the Fiber context

Types

type AuthMiddleware

type AuthMiddleware struct {
	// contains filtered or unexported fields
}

AuthMiddleware handles JWT authentication for protected routes

func NewAuthMiddleware

func NewAuthMiddleware(jwtService *auth.JWTService, config *config.StellarConfig) *AuthMiddleware

NewAuthMiddleware creates a new auth middleware instance

func (*AuthMiddleware) RequireAuth

func (m *AuthMiddleware) RequireAuth() fiber.Handler

RequireAuth is a middleware that validates JWT tokens from cookies

type Response

type Response struct {
	Status  string `json:"status"`
	Code    int    `json:"code"`
	Data    any    `json:"data"`
	Message string `json:"message"`
}

Response represents the response format

Jump to

Keyboard shortcuts

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