auth

package
v0.0.0-...-688b8c7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Middleware

func Middleware(next http.Handler) http.Handler

Middleware is used to authenticate requests. The request MUST be authenticated to continue.

Types

type UserData

type UserData struct {
	// Username defines the username of the user.
	Username string `json:"username" validate:"username,required,min=1"`

	// UserID defines the user ID of the user.
	UserID uint64 `json:"user_id" validate:"user_id,required"`

	// Flags is used to define the flags of a user.
	Flags uint64 `json:"flags" validate:"flags,required"`

	// AvatarURL is used to define the avatar URL of the user.
	AvatarURL string `json:"avatar_url" validate:"url,required"`

	// Hostname is used to define the hostname of the node making this request.
	Hostname string `json:"hostname,omitempty"`

	// Email is used to define the e-mail address of the user. Is blank if not this node.
	Email string `json:"email,omitempty"`

	// Confirmed is used to define if the e-mail address is confirmed. Is false if not this node.
	Confirmed bool `json:"confirmed"`
}

UserData defines any user data which was injected during the middleware.

func (*UserData) SameNode

func (u *UserData) SameNode() bool

SameNode defines if the user data is coming from this node.

Jump to

Keyboard shortcuts

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