middlewares

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: AGPL-3.0 Imports: 12 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 Auth added in v0.2.4

func Auth(Authorization string, rooms *room.Rooms) (*room.User, error)

func AuthOrNewWithPassword added in v0.2.4

func AuthOrNewWithPassword(roomId, roomPassword, username, password string, rooms *room.Rooms) (*room.User, error)

func AuthRoom added in v0.2.4

func AuthRoom(ctx *gin.Context)

func AuthWithPassword added in v0.2.4

func AuthWithPassword(roomId, roomPassword, username, password string, rooms *room.Rooms) (*room.User, error)

func Init

func Init(e *gin.Engine, r *room.Rooms)

func NewAuthToken added in v0.2.4

func NewAuthToken(user *room.User) (string, error)

func NewCors

func NewCors() gin.HandlerFunc

func NewQuic

func NewQuic() gin.HandlerFunc

func NewRooms added in v0.2.4

func NewRooms(r *room.Rooms) gin.HandlerFunc

Types

type AuthClaims added in v0.2.4

type AuthClaims struct {
	RoomId      string `json:"id"`
	Version     uint64 `json:"v"`
	Username    string `json:"un"`
	UserVersion uint64 `json:"uv"`
	jwt.RegisteredClaims
}

Jump to

Keyboard shortcuts

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