server_auth

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BearerAuth

func BearerAuth(r *http.Request) (bearer string, ok bool)

BearerAuth returns the bearer token Authorization header, if the request uses HTTP Basic Authentication. See RFC 2617, Section 2.

func DefaultIdentitiesFileNames

func DefaultIdentitiesFileNames(user *unix_util.User) []string

func HandleAuths

func HandleAuths(ctx context.Context, enablePasswordLogin bool, defaultMaxPacketSize uint64, handlerFunc ssh3.AuthenticatedHandlerFunc) (http.HandlerFunc, error)

func HandleBasicAuth

func HandleBasicAuth(handlerFunc ssh3.AuthenticatedHandlerFunc, conv *ssh3.Conversation) http.HandlerFunc

func HandleBearerAuth

func HandleBearerAuth(username string, base64ConversationID string, handlerFunc ssh3.UnauthenticatedBearerFunc) http.HandlerFunc

func HandleJWTAuth

func HandleJWTAuth(username string, newConv *ssh3.Conversation, identities []IdentityVerifier, handlerFunc ssh3.AuthenticatedHandlerFunc) ssh3.UnauthenticatedBearerFunc

currently only supports RS256 and EdDSA signing algorithms

func ParseBearerAuth

func ParseBearerAuth(auth string) (bearer string, ok bool)

ParseBearerAuth parses an HTTP Bearer Authentication string.

Types

type IdentityVerifier

type IdentityVerifier interface {
	// returns whether the provided candidate contains a sufficient proof to
	// be considered as equivalent to this identity
	Verify(candidate interface{}, base64ConversationID string) bool
}

func GetAuthorizedIdentities

func GetAuthorizedIdentities(user *unix_util.User) ([]IdentityVerifier, error)

func ParseAuthorizedIdentitiesFile

func ParseAuthorizedIdentitiesFile(user *unix_util.User, file *os.File) (identities []IdentityVerifier, err error)

func ParseIdentity

func ParseIdentity(user *unix_util.User, identityStr string) (ret []IdentityVerifier, err error)

type OpenIDConnectIdentity

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

func (*OpenIDConnectIdentity) Verify

func (i *OpenIDConnectIdentity) Verify(genericCandidate interface{}, base64ConversationID string) bool

type WrappedPluginVerifier

type WrappedPluginVerifier struct {
	auth.RequestIdentityVerifier
}

func (*WrappedPluginVerifier) Verify

func (w *WrappedPluginVerifier) Verify(genericCandidate interface{}, base64ConversationID string) bool

Jump to

Keyboard shortcuts

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