auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthenticateFunc

type AuthenticateFunc func(context.Context, AuthenticateRequest) bool

func (AuthenticateFunc) Authenticate

func (f AuthenticateFunc) Authenticate(ctx context.Context, req AuthenticateRequest) bool

type AuthenticateRequest

type AuthenticateRequest struct {
	User       string
	Password   string
	PublicKey  gossh.PublicKey
	RemoteAddr net.Addr
	LocalAddr  net.Addr
}

type Authenticator

type Authenticator interface {
	Authenticate(context.Context, AuthenticateRequest) bool
}

func MergeAuthenticators

func MergeAuthenticators(slice ...Authenticator) Authenticator

func UserPasswordAuthenticator

func UserPasswordAuthenticator(c UserPasswordChecker) Authenticator

func UserPublicKeysAuthenticator

func UserPublicKeysAuthenticator(c UserPublicKeys) Authenticator

type Authenticators

type Authenticators []Authenticator

func (Authenticators) Authenticate

func (slice Authenticators) Authenticate(ctx context.Context, req AuthenticateRequest) bool

type AuthorizeFunc

type AuthorizeFunc func(context.Context, AuthorizeRequest) bool

func (AuthorizeFunc) Authorize

func (f AuthorizeFunc) Authorize(ctx context.Context, req AuthorizeRequest) bool

type AuthorizeRequest

type AuthorizeRequest struct {
	User       string
	Target     string
	RemoteAddr net.Addr
	LocalAddr  net.Addr
}

type Authorizer

type Authorizer interface {
	Authorize(context.Context, AuthorizeRequest) bool
}

func MergeAuthorizers

func MergeAuthorizers(slice ...Authorizer) Authorizer

func UserGlobsAuthorizer

func UserGlobsAuthorizer(c UserGlobs) Authorizer

type Authorizers

type Authorizers []Authorizer

func (Authorizers) Authorize

func (slice Authorizers) Authorize(ctx context.Context, req AuthorizeRequest) bool

type PublicKeysDir

type PublicKeysDir string

func (PublicKeysDir) PublicKeys

func (d PublicKeysDir) PublicKeys(ctx context.Context, user string) []gossh.PublicKey

type UserGlobs

type UserGlobs interface {
	Globs(ctx context.Context, user string) []glob.Glob
}

type UserGlobsDir

type UserGlobsDir string

func (UserGlobsDir) Globs

func (d UserGlobsDir) Globs(ctx context.Context, user string) []glob.Glob

type UserGlobsFunc

type UserGlobsFunc func(ctx context.Context, user string) []glob.Glob

func (UserGlobsFunc) Globs

func (f UserGlobsFunc) Globs(ctx context.Context, user string) []glob.Glob

type UserGlobsMap

type UserGlobsMap map[string][]glob.Glob

func (UserGlobsMap) Globs

func (m UserGlobsMap) Globs(ctx context.Context, user string) []glob.Glob

type UserPasswordChecker

type UserPasswordChecker interface {
	Check(ctx context.Context, user, password string) bool
}

type UserPasswordFunc

type UserPasswordFunc func(ctx context.Context, user, password string) bool

func (UserPasswordFunc) Check

func (f UserPasswordFunc) Check(ctx context.Context, user, password string) bool

type UserPasswordMap

type UserPasswordMap map[string]string

func (UserPasswordMap) Check

func (m UserPasswordMap) Check(ctx context.Context, user, password string) bool

type UserPublicKeys

type UserPublicKeys interface {
	PublicKeys(ctx context.Context, user string) []gossh.PublicKey
}

type UserPublicKeysFunc

type UserPublicKeysFunc func(ctx context.Context, user string) []gossh.PublicKey

func (UserPublicKeysFunc) PublicKeys

func (f UserPublicKeysFunc) PublicKeys(ctx context.Context, user string) []gossh.PublicKey

type UserPublicKeysMap

type UserPublicKeysMap map[string][]gossh.PublicKey

func (UserPublicKeysMap) PublicKeys

func (m UserPublicKeysMap) PublicKeys(ctx context.Context, user string) []gossh.PublicKey

Jump to

Keyboard shortcuts

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