util

package
v0.0.0-...-b5287a6 Latest Latest
Warning

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

Go to latest
Published: May 29, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedSASLMechanism = errors.New("unsupported SASL mechanism")
	ErrNoUsernameAndPassword    = errors.New("did not supply a SASL user and password")
)
View Source
var SHA256 scram.HashGeneratorFcn = func() hash.Hash { return sha256.New() }

SHA256 generates the SHA256 hash

View Source
var SHA512 scram.HashGeneratorFcn = func() hash.Hash { return sha512.New() }

SHA512 generates the SHA512 hash

Functions

This section is empty.

Types

type SaslConfig

type SaslConfig struct {
	Enabled   bool   `yaml:"enabled"`
	Mechanism string `yaml:"mechanism,omitempty"`
	User      string `yaml:"user,omitempty"`
	Password  string `yaml:"password,omitempty"`
}

SaslConfig holds the SASL configuration options

func (SaslConfig) Apply

func (s SaslConfig) Apply(conf *sarama.Config) error

Apply applies the SASL authentication to a Kafka producer config object

type TLSConfig

type TLSConfig struct {
	Enabled            bool     `yaml:"enabled"`
	RootCAFiles        []string `yaml:"rootCAFiles"`
	CertFile           string   `yaml:"certFile,omitempty"`
	KeyFile            string   `yaml:"keyFile,omitempty"`
	InsecureSkipVerify bool     `yaml:"insecureSkipVerify"`
}

TLSConfig holds the TLS configuration for the Kafka sink producer

func (*TLSConfig) Get

func (c *TLSConfig) Get() (*tls.Config, error)

Get returns a valid *tls.Config based on the TLS Config settings

type XDGSCRAMClient

type XDGSCRAMClient struct {
	*scram.Client
	*scram.ClientConversation
	scram.HashGeneratorFcn
}

XDGSCRAMClient represents struct to XDG Scram client to initialize conversation

func (*XDGSCRAMClient) Begin

func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error)

Begin initializes new client and conversation to securely transmit the provided credentials to Kafka

func (*XDGSCRAMClient) Done

func (x *XDGSCRAMClient) Done() bool

Done returns true if the conversation is completed or has errored.

func (*XDGSCRAMClient) Step

func (x *XDGSCRAMClient) Step(challenge string) (response string, err error)

Step takes a string provided from a server (or just an empty string for the very first conversation step) and attempts to move the authentication conversation forward

Jump to

Keyboard shortcuts

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