middlewares

package
v0.5.0-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuthFailed  = errors.New("auth failed")
	ErrAuthExpired = errors.New("auth expired")
)

Functions

func AuthAdminMiddleware added in v0.3.0

func AuthAdminMiddleware(ctx *gin.Context)

func AuthRoom added in v0.2.4

func AuthRoom(Authorization string) (*op.UserEntry, *op.RoomEntry, error)

func AuthRoomAdminMiddleware added in v0.5.0

func AuthRoomAdminMiddleware(ctx *gin.Context)

func AuthRoomCreatorMiddleware added in v0.5.0

func AuthRoomCreatorMiddleware(ctx *gin.Context)

func AuthRoomMiddleware added in v0.3.0

func AuthRoomMiddleware(ctx *gin.Context)

func AuthRootMiddleware added in v0.3.0

func AuthRootMiddleware(ctx *gin.Context)

func AuthUser added in v0.3.0

func AuthUser(Authorization string) (*op.UserEntry, error)

func AuthUserMiddleware added in v0.3.0

func AuthUserMiddleware(ctx *gin.Context)

func GetAuthorizationTokenFromContext added in v0.3.5

func GetAuthorizationTokenFromContext(ctx *gin.Context) (string, error)

func Init

func Init(e *gin.Engine)

func NewAuthRoomToken added in v0.3.0

func NewAuthRoomToken(user *op.User, room *op.Room) (string, error)

func NewAuthUserToken added in v0.3.0

func NewAuthUserToken(user *op.User) (string, error)

func NewCors

func NewCors() gin.HandlerFunc

func NewDistCacheControl added in v0.3.0

func NewDistCacheControl(prefix string) gin.HandlerFunc

func NewLimiter added in v0.3.0

func NewLimiter(Period time.Duration, Limit int64, options ...limiter.Option) gin.HandlerFunc

func NewLog added in v0.4.2

func NewLog(l *logrus.Logger) gin.HandlerFunc

func NewQuic

func NewQuic() gin.HandlerFunc

Types

type AuthClaims added in v0.2.4

type AuthClaims struct {
	UserId      string `json:"u"`
	UserVersion uint32 `json:"uv"`
	jwt.RegisteredClaims
}

type AuthRoomClaims added in v0.3.0

type AuthRoomClaims struct {
	AuthClaims
	RoomId      string `json:"r"`
	RoomVersion uint32 `json:"rv"`
}

Jump to

Keyboard shortcuts

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