middleware

package
v1.15.20 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: GPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(svc *svc.ServiceContext) app.HandlerFunc

func AuthenticateRequest added in v1.2.14

func AuthenticateRequest(ctx context.Context, svc *svc.ServiceContext, token string, path string) (context.Context, error)

func CorsMiddleware

func CorsMiddleware(c context.Context, ctx *app.RequestContext)

func DecryptDeviceRequest added in v1.3.13

func DecryptDeviceRequest(ctx *app.RequestContext, encryptionKey string) bool

DecryptDeviceRequest decrypts device-login query and request-body payloads in place.

func DeviceMiddleware added in v1.1.8

func DeviceMiddleware(srvCtx *svc.ServiceContext) app.HandlerFunc

func EncryptDeviceResponse added in v1.3.13

func EncryptDeviceResponse(ctx *app.RequestContext, encryptionKey string)

EncryptDeviceResponse encrypts the top-level data field of a device-login response in place.

func LoggerMiddleware

func LoggerMiddleware(svc *svc.ServiceContext) app.HandlerFunc

func NotifyMiddleware

func NotifyMiddleware(svc *svc.ServiceContext) app.HandlerFunc

func OptionalAuthMiddleware added in v1.14.15

func OptionalAuthMiddleware(svc *svc.ServiceContext) app.HandlerFunc

OptionalAuthMiddleware authenticates a request when it supplies an Authorization header, while preserving anonymous access for routes that intentionally support guest checkout. Handlers on those routes must still explicitly require an authenticated user before operating on a user-owned resource.

func PaymentNotifyContext added in v1.2.14

func PaymentNotifyContext(ctx context.Context, svc *svc.ServiceContext, platform, token string) (context.Context, error)

func TraceMiddleware

func TraceMiddleware(_ *svc.ServiceContext) app.HandlerFunc

Types

type PaymentParams

type PaymentParams struct {
	Platform string `uri:"platform"`
	Token    string `uri:"token"`
}

Jump to

Keyboard shortcuts

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