app

package
v0.0.0-...-93e329f Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddIdentity

func AddIdentity(redisAddr, name, password string) error

func RemoveIdentity

func RemoveIdentity(redisAddr, name string) error

func ServeRADIUS

func ServeRADIUS(ctx context.Context, sharedSecret, redis string) error

Types

type EAPAuthenticator

type EAPAuthenticator struct {
	SharedSecret       []byte
	Send               func(b []byte, addr net.Addr) error
	CredentialProvider EAPCredentialProvider
	// contains filtered or unexported fields
}

EAPAuthenticator implements a RADIUS server with minimal support for EAP authentication.

EAPAuthenticator is safe for concurrent use.

func (*EAPAuthenticator) Handle

func (auth *EAPAuthenticator) Handle(b []byte, addr net.Addr) (interface{}, error)

Handles a RADIUS packet. Errors are returned for internal issues such as the authenticator's Send function returning an error. Under normal operation, even in cases such as malformed packets, a non-nil result and nil error are returned.

type EAPAuthenticatorDiscardResult

type EAPAuthenticatorDiscardResult struct {
	Reason error
}

type EAPAuthenticatorEAPFailureResult

type EAPAuthenticatorEAPFailureResult struct {
	Identity string
	Reason   error
}

type EAPAuthenticatorEAPRequestResult

type EAPAuthenticatorEAPRequestResult struct {
	Identity string
}

type EAPAuthenticatorEAPSuccessResult

type EAPAuthenticatorEAPSuccessResult struct {
	Identity string
}

type EAPAuthenticatorRejectResult

type EAPAuthenticatorRejectResult struct {
	Reason error
}

type EAPConnectionState

type EAPConnectionState struct {
	CreationTime            time.Time
	Identity                string
	MD5ChallengeValue       []byte
	CompletedAuthentication bool

	MSCHAPv2ChallengeValues [][]byte
	MSCHAPv2SuccessSent     bool
	MSCHAPv2NTResponse      []byte
	// contains filtered or unexported fields
}

type EAPCredentialProvider

type EAPCredentialProvider interface {
	CredentialsForIdentity(id string) (EAPCredentials, error)
}

type EAPCredentials

type EAPCredentials interface {
	PlaintextPassword() []byte
}

type RADIUSServer

type RADIUSServer struct {
	Logger logrus.FieldLogger

	SharedSecret       []byte
	CredentialProvider EAPCredentialProvider
	// contains filtered or unexported fields
}

func (*RADIUSServer) Start

func (s *RADIUSServer) Start() error

func (*RADIUSServer) Stop

func (s *RADIUSServer) Stop()

type RedisCredentialProvider

type RedisCredentialProvider struct {
	Redis string
	// contains filtered or unexported fields
}

func (*RedisCredentialProvider) CredentialsForIdentity

func (p *RedisCredentialProvider) CredentialsForIdentity(id string) (EAPCredentials, error)

Jump to

Keyboard shortcuts

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