sudo_fiber

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeviceIdParse

func DeviceIdParse(c *fiber.Ctx) string

DeviceIdParser represents the device ID parser.

func New

func New(cnf Config) fiber.Handler

New creates a new sudo middleware.

func NewDeviceId

func NewDeviceId(cnf DeviceIdConfig) fiber.Handler

NewDeviceId creates a new device ID middleware.

Types

type Config

type Config struct {
	// Service is the sudo service.
	Service sudo.Service

	// UserParser is the function used to parse the current user.
	UserParser CurrentUserParser

	// LocaleParser is the function used to parse the locale.
	LocaleParser LocaleParser

	// AccessKey is the name of the header used to store the access key.
	AccessKey string

	// VerifyKey is the name of the header used to store the verify key.
	VerifyKey string

	// CodeKey is the name of the header used to store the code.
	CodeKey string
}

Config holds the configuration for the sudo middleware.

type CurrentUser

type CurrentUser struct {
	// TwoFactorEnabled indicates whether the two-factor authentication is enabled for the user.
	TwoFactorEnabled bool

	// UUID is the unique identifier of the user.
	UUID string

	// Phone is the phone number of the user.
	Phone string

	// Email is the email of the user.
	Email string
}

CurrentUser represents the current user.

type CurrentUserParser

type CurrentUserParser func(ctx *fiber.Ctx) CurrentUser

CurrentUserParser represents the current user parser.

type DeviceIdConfig

type DeviceIdConfig struct {
	// CookieName is the name of the cookie used to store the device ID.
	CookieName string
}

DeviceIdConfig holds the configuration for the device ID middleware.

type LocaleParser

type LocaleParser func(ctx *fiber.Ctx) string

LocaleConfig holds the configuration for the locale middleware.

Jump to

Keyboard shortcuts

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