sasl

package module
v0.0.0-...-b414a97 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 7 Imported by: 0

README

go-sasl

GoDoc

go-sasl is a pure golang client-side SASL implementation as defined by RFC 4422.

It supports the following mechanisms: PLAIN, EXTERNAL. Support for other mechanisms may be added in the future.

Contributing

Open an issue or PR if you want to add more SASL mechanisms.

License

MIT License (c) 2018 Mukesh Sharma

Documentation

Index

Constants

View Source
const (
	// PLAIN represents plain mechanism
	PLAIN = "plain"
	// EXTERNAL represents external mechanism
	EXTERNAL = "external"
	// DIGEST_MD5 represents digest-md5 mechanism
	DIGEST_MD5 = "digest-md5"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	EvaluateChallenge([]byte) ([]byte, error)
	Wrap([]byte) ([]byte, error)
	Unwrap([]byte) ([]byte, error)
	IsComplete() bool
	Mechanism() string
	HasInitialResponse() bool
}

Client is SASL client interface

func NewClient

func NewClient(mech string, options Options) (Client, error)

NewClient creates new SASL client

func NewDigestMD5Client

func NewDigestMD5Client() (Client, error)

NewDigestMD5Client creates a SASL DigestMd5 mechanism with optional authorization ID

func NewExternalClient

func NewExternalClient(authorizationID []byte) (Client, error)

NewExternalClient creates a SASL External mechanism with optional authorization ID

func NewPlainClient

func NewPlainClient(authenticationID []byte, authorizationID []byte, password []byte) (Client, error)

NewPlainClient creates a SASL mechanism with client credentials that it needs to participate in Plain authentication exchange with the server.

type Options

type Options struct {
	AuthorizationID  []byte
	AuthenticationID []byte
	Password         []byte
}

Options represent SASL client options. Different mechanims have different required fields

Jump to

Keyboard shortcuts

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