sasl

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MechPlain = "PLAIN"
)

SASL mechanism tokens

Variables

View Source
var (
	ErrUnexpectedClientResponse  = errors.New("sasl: unexpected client response")
	ErrUnexpectedServerChallenge = errors.New("sasl: unexpected server challenge")
)

Common SASL errors.

Functions

This section is empty.

Types

type AuthError added in v1.1.0

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

func (*AuthError) Error added in v1.1.0

func (e *AuthError) Error() string

Error implements error

func (*AuthError) Unwrap added in v1.1.0

func (e *AuthError) Unwrap() error

Unwrap implements support for error.Is / As

type Client

type Client interface {
	Start(mechlist []string) (mech string, initial []byte, done bool, err error)
	Step(challenge []byte) (response []byte, done bool, err error)
	Free()
	InterpretReceiveEOF(transportError error) error
}

Client is SASL client

func NewClient

func NewClient(opts *Options) Client

NewClient created new sasl client

type Mech

type Mech string

Mech is SASL mechanism token

type Options

type Options struct {
	Service  string
	Host     string
	Username string
	Password string
}

Options contains data related to SASL negotiation

type Status

type Status byte

Status is SASL negotiation status

const (
	StatusStart    Status = 1
	StatusOK       Status = 2
	StatusBad      Status = 3
	StatusError    Status = 4
	StatusComplete Status = 5
)

SASL negotiation statuses

type TSaslTransport

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

func NewTSaslTransport

func NewTSaslTransport(t thrift.TTransport, opts *Options) (*TSaslTransport, error)

func (*TSaslTransport) Close

func (t *TSaslTransport) Close() error

func (*TSaslTransport) Flush

func (t *TSaslTransport) Flush(ctx context.Context) error

func (*TSaslTransport) IsOpen

func (t *TSaslTransport) IsOpen() bool

func (*TSaslTransport) Open

func (t *TSaslTransport) Open() error

func (*TSaslTransport) Read

func (t *TSaslTransport) Read(buf []byte) (int, error)

func (*TSaslTransport) RemainingBytes

func (t *TSaslTransport) RemainingBytes() (num_bytes uint64)

func (*TSaslTransport) SetTConfiguration added in v1.0.1

func (t *TSaslTransport) SetTConfiguration(conf *thrift.TConfiguration)

func (*TSaslTransport) Write

func (t *TSaslTransport) Write(buf []byte) (int, error)

Jump to

Keyboard shortcuts

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