middleware

package
v0.55.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const MemberIDCtxKey = "memberIDCtx"
View Source
const PubSubMessageCtxKey = "pubSubMessageCtx"
View Source
const QMessageCtxKey = "qMessageCtx"

Variables

This section is empty.

Functions

func MustGetMemberIDFromContext

func MustGetMemberIDFromContext(ctx *gin.Context) uuid.UUID

MustGetAdminFromContext returns the member ID from the context.

func MustGetMessageFromContext

func MustGetMessageFromContext(ctx *gin.Context) q.PubSubMessage

MustGetMessageFromContext returns the PubSub message from the context.

func MustGetQMessageFromContext added in v0.47.0

func MustGetQMessageFromContext(ctx *gin.Context) q.QMessage

MustGetQMessageFromContext returns the Q message from the context.

func NewMemberCtx

func NewMemberCtx(tenant string, membersClient MembersClient) *memberCtx

func NewPubSubCtx

func NewPubSubCtx(l Locker) *pubSubCtx

func NewQCtx added in v0.47.0

func NewQCtx(locker Locker) *qctx

func RequireEmailVerified added in v0.27.0

func RequireEmailVerified() gin.HandlerFunc

func RequireIfServiceAccount

func RequireIfServiceAccount(userID string) gin.HandlerFunc

RequireIfServiceAccount returns a middleware that checks if the request is coming from a service account and if the user ID is the same as the one provided.

func RequireSecondFactor added in v0.54.0

func RequireSecondFactor() gin.HandlerFunc

func RequireSecondFactorPhone added in v0.27.0

func RequireSecondFactorPhone() gin.HandlerFunc

Types

type Locker

type Locker interface {
	TryToLock(ctx context.Context, key string) error
}

type MembersClient

type MembersClient interface {
	HasPermissions(ctx context.Context, tenant string, id uuid.UUID, permissions ...[]string) bool
}

Jump to

Keyboard shortcuts

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