sasl

package module
v0.0.0-...-777fdcb Latest Latest
Warning

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

Go to latest
Published: May 15, 2017 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package sasl implements the framework for RFC4422(https://tools.ietf.org/html/rfc4422). It provides high-level methods to conduct an authentication exchange as both a server and as a client. Mechanism implementations are defined in other packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConverseAsClient

func ConverseAsClient(ctx context.Context, mech ClientMech, incoming <-chan []byte, outgoing chan<- []byte) error

ConverseAsClient conducts an authentication exchange as a client.

func ConverseAsServer

func ConverseAsServer(ctx context.Context, mech ServerMech, response []byte, incoming <-chan []byte, outgoing chan<- []byte) error

ConverseAsServer conducts an authentication exchange as a server.

Types

type Client

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

Client aids in the encapsulation of all the supported mechanisms.

func (*Client) Auth

func (c *Client) Auth(ctx context.Context, state interface{}, mechName string, incoming <-chan []byte, outgoing chan<- []byte) error

Auth authenticates/authorizes a user with the named mechanism.

func (*Client) RegisterMechFactory

func (c *Client) RegisterMechFactory(mechName string, factory ClientMechFactory)

RegisterMechFactory registers the mechanism factory by name.

type ClientMech

type ClientMech interface {
	// Start initializes the mechanism and begins the authentication exchange.
	Start(context.Context) (string, []byte, error)

	// Next continues the exchange.
	Next(context.Context, []byte) ([]byte, error)

	// Completed indicates if the authentication exchange is complete from
	// the client's perspective.
	Completed() bool
}

ClientMech handles authenticating with a server.

type ClientMechFactory

type ClientMechFactory func(state interface{}) ClientMech

ClientMechFactory is used to create a server mechanism.

type Error

type Error struct {
	Msg   string
	Inner error
}

Error is always the type of error returned from ConverseAsClient and ConverseAsServer.

func (*Error) Error

func (e *Error) Error() string

type Server

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

Server aids in the encapsulation of all the supported mechanisms.

func (*Server) Auth

func (s *Server) Auth(ctx context.Context, state interface{}, mechName string, response []byte, incoming <-chan []byte, outgoing chan<- []byte) error

Auth authenticates/authorizes a user with the named mechanism.

func (*Server) RegisterMechFactory

func (s *Server) RegisterMechFactory(mechName string, factory ServerMechFactory)

RegisterMechFactory registers the mechanism factory by name.

type ServerMech

type ServerMech interface {
	// Start initializes the mechanism and begins the authentication exchange.
	Start(context.Context, []byte) (string, []byte, error)

	// Next continues the exchange.
	Next(context.Context, []byte) ([]byte, error)

	// Completed indicates if the authentication exchange is complete from
	// the server's perspective.
	Completed() bool
}

ServerMech handles authenticating with a client.

type ServerMechFactory

type ServerMechFactory func(state interface{}) ServerMech

ServerMechFactory is used to create a server mechanism.

Directories

Path Synopsis
Package anonymous implements the client and server portions of RFC4505 (https://tools.ietf.org/html/rfc4505).
Package anonymous implements the client and server portions of RFC4505 (https://tools.ietf.org/html/rfc4505).
Package anonymous implements the client and server portions of RFC4422 (https://tools.ietf.org/html/rfc4422).
Package anonymous implements the client and server portions of RFC4422 (https://tools.ietf.org/html/rfc4422).
internal
Package anonymous implements the client and server portions of RFC4616 (https://tools.ietf.org/html/rfc4616).
Package anonymous implements the client and server portions of RFC4616 (https://tools.ietf.org/html/rfc4616).
Package scramsha1 implements the client and server portions of RFC5802 (https://tools.ietf.org/html/rfc5802).
Package scramsha1 implements the client and server portions of RFC5802 (https://tools.ietf.org/html/rfc5802).

Jump to

Keyboard shortcuts

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