Documentation
¶
Overview ¶
Package auth provides authentication management for SSH connections.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrAuthFailed = errors.New("authentication failed")
ErrAuthFailed indicates a generic authentication failure.
var ErrKeyNotSupported = errors.New("key type not supported")
ErrKeyNotSupported indicates that the key type is not supported.
var SupportedKeyTypes = []string{"ssh-ed25519"}
SupportedKeyTypes is the list of supported SSH key types.
Functions ¶
This section is empty.
Types ¶
type AuthManager ¶
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.