Documentation ¶
Index ¶
- func ParsePasswordAuthenticationData(buf []byte) (*passwordAuthenticationData, error)
- type ClientAuthenticationChannels
- type ClientAuthenticationMethod
- type DefaultServerAuthenticator
- func (d *DefaultServerAuthenticator) AddMethod(method ServerAuthenticationMethod)
- func (d *DefaultServerAuthenticator) Authenticate(ctx context.Context, conn net.Conn, req message.Request) (*ServerAuthenticationResult, *ServerAuthenticationChannels)
- func (d *DefaultServerAuthenticator) ContinueAuthenticate(sac *ServerAuthenticationChannels, req message.Request) (*ServerAuthenticationResult, error)
- func (d *DefaultServerAuthenticator) SessionConnClose(id []byte)
- type NoneClientAuthenticationMethod
- type NoneServerAuthenticationMethod
- type PasswordClientAuthenticationMethod
- type PasswordServerAuthenticationMethod
- type ServerAuthenticationChannels
- type ServerAuthenticationMethod
- type ServerAuthenticationResult
- type ServerAuthenticator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClientAuthenticationChannels ¶
type ClientAuthenticationChannels struct { Data chan []byte FirstAuthReply chan *message.AuthenticationReply FinalAuthReply chan *message.AuthenticationReply Error chan error }
func NewClientAuthenticationChannels ¶
func NewClientAuthenticationChannels() *ClientAuthenticationChannels
type DefaultServerAuthenticator ¶
type DefaultServerAuthenticator struct { Methods map[byte]ServerAuthenticationMethod DisableSession bool DisableToken bool // contains filtered or unexported fields }
func NewServerAuthenticator ¶
func NewServerAuthenticator() *DefaultServerAuthenticator
func (*DefaultServerAuthenticator) AddMethod ¶
func (d *DefaultServerAuthenticator) AddMethod(method ServerAuthenticationMethod)
func (*DefaultServerAuthenticator) Authenticate ¶
func (d *DefaultServerAuthenticator) Authenticate( ctx context.Context, conn net.Conn, req message.Request, ) ( *ServerAuthenticationResult, *ServerAuthenticationChannels, )
func (*DefaultServerAuthenticator) ContinueAuthenticate ¶
func (d *DefaultServerAuthenticator) ContinueAuthenticate(sac *ServerAuthenticationChannels, req message.Request) (*ServerAuthenticationResult, error)
func (*DefaultServerAuthenticator) SessionConnClose ¶
func (d *DefaultServerAuthenticator) SessionConnClose(id []byte)
type NoneClientAuthenticationMethod ¶
type NoneClientAuthenticationMethod struct{}
func (NoneClientAuthenticationMethod) Authenticate ¶
func (f NoneClientAuthenticationMethod) Authenticate( ctx context.Context, conn net.Conn, cac ClientAuthenticationChannels, )
func (NoneClientAuthenticationMethod) ID ¶
func (f NoneClientAuthenticationMethod) ID() byte
type NoneServerAuthenticationMethod ¶
type NoneServerAuthenticationMethod struct{}
NoneServerAuthenticationMethod is IANA method 0, require no authn at all.
func (NoneServerAuthenticationMethod) Authenticate ¶
func (n NoneServerAuthenticationMethod) Authenticate( ctx context.Context, conn net.Conn, data []byte, sac *ServerAuthenticationChannels, )
func (NoneServerAuthenticationMethod) ID ¶
func (n NoneServerAuthenticationMethod) ID() byte
type PasswordClientAuthenticationMethod ¶
func (PasswordClientAuthenticationMethod) Authenticate ¶
func (p PasswordClientAuthenticationMethod) Authenticate( ctx context.Context, conn net.Conn, cac ClientAuthenticationChannels, )
func (PasswordClientAuthenticationMethod) ID ¶
func (p PasswordClientAuthenticationMethod) ID() byte
type PasswordServerAuthenticationMethod ¶
type PasswordServerAuthenticationMethod struct { // Passwords is client password table, key is user name Passwords map[string]string }
PasswordServerAuthenticationMethod is IANA method 2, check for plaintext user name and password.
func (PasswordServerAuthenticationMethod) Authenticate ¶
func (p PasswordServerAuthenticationMethod) Authenticate( ctx context.Context, conn net.Conn, data []byte, sac *ServerAuthenticationChannels, )
func (PasswordServerAuthenticationMethod) ID ¶
func (p PasswordServerAuthenticationMethod) ID() byte
type ServerAuthenticationChannels ¶
type ServerAuthenticationChannels struct { // Result is where authenticate method write it's result Result chan ServerAuthenticationResult // Continue is used by server process to signal auth step 1 result has been written to client Continue chan bool // Err used by authn method to report error Err chan error }
ServerAuthenticationChannels are three channels used to control auth step 2.
func NewServerAuthenticationChannels ¶
func NewServerAuthenticationChannels() *ServerAuthenticationChannels
type ServerAuthenticator ¶
type ServerAuthenticator interface { Authenticate( ctx context.Context, conn net.Conn, req message.Request, ) ( *ServerAuthenticationResult, *ServerAuthenticationChannels, ) ContinueAuthenticate(sac *ServerAuthenticationChannels, req message.Request) (*ServerAuthenticationResult, error) SessionConnClose(id []byte) }
Click to show internal directories.
Click to hide internal directories.