backend

package
v0.0.0-...-0fd5418 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadYAML

func LoadYAML(path string, obj interface{}) error

LoadYAML loads and unmarshals a YAML file.

func ResolvePath

func ResolvePath(path, base string) string

ResolvePath returns the path evaluated as relative to base.

Types

type AppSpecificPassword

type AppSpecificPassword struct {
	ID                string
	Service           string
	EncryptedPassword []byte
}

AppSpecificPassword is a password tied to a single service.

type ServiceBackend

type ServiceBackend interface {
	GetUser(context.Context, string) (*User, bool)
}

ServiceBackend looks up user info for a specific service.

type Spec

type Spec struct {
	BackendName  string    `yaml:"backend"`
	Params       yaml.Node `yaml:"params"`
	StaticGroups []string  `yaml:"static_groups"`
}

Spec specifies backend-specific configuration for a service.

type User

type User struct {
	Name                  string
	Email                 string
	Shard                 string
	EncryptedPassword     []byte
	TOTPSecret            string
	WebAuthnRegistrations []webauthn.Credential
	AppSpecificPasswords  []*AppSpecificPassword
	Groups                []string
}

User contains the attributes of a user account as relevant to the authentication server. It is only used internally, to communicate between the authserver and its storage backends.

func (*User) Has2FA

func (u *User) Has2FA() bool

Has2FA returns true if the user supports any interactive 2FA method.

func (*User) HasASPs

func (u *User) HasASPs(service string) bool

HasASPs returns true if the user has app-specific passwords.

func (*User) HasOTP

func (u *User) HasOTP() bool

HasOTP returns true if the user supports (T)OTP.

func (*User) HasU2F

func (u *User) HasU2F() bool

HasU2F returns true if the user supports U2F.

func (*User) UserInfo

func (u *User) UserInfo() *auth.UserInfo

UserInfo returns extra user information in the format required by the auth wire protocol.

type UserBackend

type UserBackend interface {
	Close()
	NewServiceBackend(*Spec) (ServiceBackend, error)
}

UserBackend provides us with per-service user information.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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