sasl

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

Package SASL implements Simple Authentication and Security Layer, RFC 4422.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// Name as used in SMTP AUTH, e.g. PLAIN, CRAM-MD5, SCRAM-SHA-256.
	// cleartextCredentials indicates if credentials are exchanged in clear text, which influences whether they are logged.
	Info() (name string, cleartextCredentials bool)

	// Next is called for each step of the SASL communication. The first call has a nil
	// fromServer and serves to get a possible "initial response" from the client. If
	// the client sends its final message it indicates so with last. Returning an error
	// aborts the authentication attempt.
	// For the first toServer ("initial response"), a nil toServer indicates there is
	// no data, which is different from a non-nil zero-length toServer.
	Next(fromServer []byte) (toServer []byte, last bool, err error)
}

Client is a SASL client

func NewClientCRAMMD5

func NewClientCRAMMD5(username, password string) Client

NewClientCRAMMD5 returns a client for SASL CRAM-MD5 authentication.

func NewClientPlain

func NewClientPlain(username, password string) Client

NewClientPlain returns a client for SASL PLAIN authentication.

func NewClientSCRAMSHA1

func NewClientSCRAMSHA1(username, password string) Client

NewClientSCRAMSHA1 returns a client for SASL SCRAM-SHA-1 authentication.

func NewClientSCRAMSHA256

func NewClientSCRAMSHA256(username, password string) Client

NewClientSCRAMSHA256 returns a client for SASL SCRAM-SHA-256 authentication.

Jump to

Keyboard shortcuts

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