auth

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const DIGITS = 6

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthProvider

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

func NewAuthProvider

func NewAuthProvider(enabled bool, users, groups, counters string, window uint64) (*AuthProvider, error)

func (*AuthProvider) Authorize

func (a *AuthProvider) Authorize(resource, action, uid string) error

func (*AuthProvider) Cards

func (a *AuthProvider) Cards(uid string) []string

func (*AuthProvider) Enabled

func (a *AuthProvider) Enabled() bool

func (*AuthProvider) VerifyHOTP

func (a *AuthProvider) VerifyHOTP(uid, otp string) error

func (*AuthProvider) VerifyPassword

func (a *AuthProvider) VerifyPassword(uid, pwd string) error

type HOTP

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

func NewHOTP

func NewHOTP(window uint64, counters string) (*HOTP, error)

func (*HOTP) Validate

func (hotp *HOTP) Validate(uid, secret, otp string) error

type IAuth

type IAuth interface {
	Enabled() bool
	VerifyPassword(user, pwd string) error
	VerifyHOTP(user, otp string) error
	Authorize(resource, action, user string) error
	Cards(user string) []string
}

Jump to

Keyboard shortcuts

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