auth

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildKgoSASL added in v0.5.0

func BuildKgoSASL(cfg SASLConfig) (sasl.Mechanism, error)

BuildKgoSASL maps a mailer SASLConfig to a franz-go SASL mechanism (used by the transactional Kafka sink, which is built on franz-go). Returns an error if the mechanism is unsupported.

func BuildSASLMechanism

func BuildSASLMechanism(cfg SASLConfig) (sasl.Mechanism, error)

BuildSASLMechanism maps a mailer SASLConfig to a kafka-go SASL mechanism. Returns an error if the mechanism is unsupported.

func BuildTLSConfig

func BuildTLSConfig(cfg TLSConfig) (*tls.Config, error)

BuildTLSConfig converts a mailer TLSConfig into a *tls.Config suitable for use with kafka-go's Dialer (source) or Transport (sink). Returns nil if no TLS fields are set (plain connection).

Types

type SASLConfig

type SASLConfig struct {
	Mechanism SASLMechanism
	Username  string
	Password  string
}

SASLConfig holds Kafka SASL authentication settings. Used with the KafkaSASL (source) and KafkaSinkSASL (sink) options.

type SASLMechanism

type SASLMechanism string

SASLMechanism identifies a Kafka SASL authentication mechanism.

const (
	SASLPlain       SASLMechanism = "PLAIN"
	SASLScramSHA256 SASLMechanism = "SCRAM-SHA-256"
	SASLScramSHA512 SASLMechanism = "SCRAM-SHA-512"
)

type TLSConfig

type TLSConfig struct {
	CertFile           string
	KeyFile            string
	CAFile             string
	InsecureSkipVerify bool
}

TLSConfig holds Kafka TLS settings.

If CertFile and KeyFile are both set, client certificates are loaded for mutual TLS. If CAFile is set, it is added to the root CAs used to verify the broker. InsecureSkipVerify disables certificate verification (for development only).

Jump to

Keyboard shortcuts

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