scram

package
Version: v0.4.16 Latest Latest
Warning

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

Go to latest
Published: May 3, 2021 License: MIT Imports: 6 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mechanism

func Mechanism(algo Algorithm, username, password string) (sasl.Mechanism, error)

Mechanism returns a new sasl.Mechanism that will use SCRAM with the provided Algorithm to securely transmit the provided credentials to Kafka.

SCRAM-SHA-256 and SCRAM-SHA-512 were added to Kafka in 0.10.2.0. These mechanisms will not work with older versions.

Types

type Algorithm

type Algorithm interface {
	// Name returns the algorithm's name, e.g. "SCRAM-SHA-256"
	Name() string

	// Hash returns a new hash.Hash.
	Hash() hash.Hash
}

Algorithm determines the hash function used by SCRAM to protect the user's credentials.

var (
	SHA256 Algorithm = sha256Algo{}
	SHA512 Algorithm = sha512Algo{}
)

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto