auth

package
v0.0.0-...-ed2ac0f Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package auth provides authentication management for SSH connections.

Index

Constants

This section is empty.

Variables

View Source
var ErrAuthFailed = errors.New("authentication failed")

ErrAuthFailed indicates a generic authentication failure.

View Source
var ErrKeyNotSupported = errors.New("key type not supported")

ErrKeyNotSupported indicates that the key type is not supported.

View Source
var SupportedKeyTypes = []string{"ssh-ed25519"}

SupportedKeyTypes is the list of supported SSH key types.

Functions

This section is empty.

Types

type AuthManager

type AuthManager struct {
	models.KeyDB
}

AuthManager manages SSH authentication.

func NewAuthManager

func NewAuthManager(keyDB models.KeyDB) *AuthManager

NewAuthManager creates a new AuthManager instance.

func (*AuthManager) NoAuthCallback

func (km *AuthManager) NoAuthCallback(conn ssh.ConnMetadata) (*ssh.Permissions, error)

NoAuthCallback handles scenarios where no authentication method is supported.

func (*AuthManager) PasswordAuth

func (km *AuthManager) PasswordAuth(conn ssh.ConnMetadata, password []byte) (*ssh.Permissions, error)

PasswordAuth handles password authentication.

func (*AuthManager) PublicKeyCallback

func (km *AuthManager) PublicKeyCallback(c ssh.ConnMetadata, pubKey ssh.PublicKey) (*ssh.Permissions, error)

PublicKeyCallback handles public key authentication.

type ErrAuthFailedReason

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

ErrAuthFailedReason provides additional context for authentication failure.

func (ErrAuthFailedReason) Error

func (e ErrAuthFailedReason) Error() string

Error returns the formatted error message.

func (ErrAuthFailedReason) Unwrap

func (e ErrAuthFailedReason) Unwrap() error

Unwrap returns the underlying error.

Jump to

Keyboard shortcuts

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