middleware

package
v0.0.0-...-300d8f5 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitJWT

func InitJWT() *jwt.GinJWTMiddleware

func InstanceJWT

func InstanceJWT() *jwt.GinJWTMiddleware

func SudoCheckToken

func SudoCheckToken(c *gin.Context)

SudoCheckToken checks if the `sudo` claim is present and less than 5 minutes ago

func SudoModeMiddleware

func SudoModeMiddleware() gin.HandlerFunc

SudoModeMiddleware is used by general API endpoints to check for superuser token

func SudoUbusCallsMiddleware

func SudoUbusCallsMiddleware() gin.HandlerFunc

SudoUbusCallsMiddleware is a middleware that checks if the ubus call requires sudo privileges This needs to parse the request body to check the path and method of the ubus call, then check if it's in the protectedPaths map

Types

This section is empty.

Jump to

Keyboard shortcuts

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