auth

package
v0.0.0-...-52c27b0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnforceChallenges

func EnforceChallenges(auth *data.Authentication, specs []ChallengeSpec) error

Types

type Captcha

type Captcha interface {
	Verify(string) bool
}

func NewCaptchaHandler

func NewCaptchaHandler(secret string) Captcha

type CaptchaHandler

type CaptchaHandler struct {
	// contains filtered or unexported fields
}

func (*CaptchaHandler) Verify

func (c *CaptchaHandler) Verify(token string) bool

type ChallengeSpec

type ChallengeSpec struct {
	Type   ChallengeType `json:"type"`
	MaxAge time.Duration `json:"maxAge"`
}

type ChallengeType

type ChallengeType string
const (
	PasswordChallenge ChallengeType = "password"
	CaptchaChallenge  ChallengeType = "captcha"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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