sasl

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: BSD-3-Clause Imports: 1 Imported by: 25

Documentation

Overview

Package sasl specifies interfaces that any sasl authentication must provide to interop with Kafka SASL.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClosingMechanism added in v1.7.0

type ClosingMechanism interface {
	// Close permanently closes a mechanism.
	Close()
}

ClosingMechanism is an optional interface for sasl mechanism's. Implementing this interface signals that the mechanism should be closed if it will never be used again.

type Mechanism

type Mechanism interface {
	// Name is the name of this SASL authentication mechanism.
	Name() string

	// Authenticate initializes an authentication session to the provided
	// host:port. If the mechanism is a client-first authentication
	// mechanism, this also returns the first message to write.
	//
	// If initializing a session fails, this can return an error to stop
	// the authentication flow.
	//
	// The provided context can be used through the duration of the session.
	Authenticate(ctx context.Context, host string) (Session, []byte, error)
}

Mechanism authenticates with SASL.

type Session

type Session interface {
	// Challenge is called with a server response. This must return
	// if the authentication is done, or, if not, the next message
	// to send. If the authentication is done, this can return an
	// additional last message to be written (for which we will not
	// read a response).
	//
	// Returning an error stops the authentication flow.
	Challenge([]byte) (bool, []byte, error)
}

Session is an authentication session.

Directories

Path Synopsis
Package aws provides AWS_MSK_IAM sasl authentication as specified in the Java source.
Package aws provides AWS_MSK_IAM sasl authentication as specified in the Java source.
kerberos module
Package oauth provides OAUTHBEARER sasl authentication as specified in RFC7628.
Package oauth provides OAUTHBEARER sasl authentication as specified in RFC7628.
Package plain provides PLAIN sasl authentication as specified in RFC4616.
Package plain provides PLAIN sasl authentication as specified in RFC4616.
Package scram provides SCRAM-SHA-256 and SCRAM-SHA-512 sasl authentication as specified in RFC5802.
Package scram provides SCRAM-SHA-256 and SCRAM-SHA-512 sasl authentication as specified in RFC5802.

Jump to

Keyboard shortcuts

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