auth

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

SHA256 algorithm

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

SHA512 algorithm

Functions

This section is empty.

Types

type SASL added in v0.18.0

type SASL struct {
	Enabled   bool   `yaml:"enabled"` // false as default
	User      string `yaml:"user"`
	Password  string `yaml:"password"`
	Algorithm string `yaml:"algorithm"` // plain, sha512 or sha256
}

SASL describe SASL configuration (for Kafka)

type TLS

type TLS struct {
	Enabled bool `yaml:"enabled"`

	// For Postgres(https://www.postgresql.org/docs/9.1/libpq-ssl.html) and MySQL
	// default to require if Enable is true.
	// For MySQL: https://github.com/go-sql-driver/mysql , it also can be set in ConnectAttributes, default is tls-custom
	SSLMode string `yaml:"sslmode" `

	// CertPath and KeyPath are optional depending on server
	// config, but both fields must be omitted to avoid using a
	// client certificate
	CertFile string `yaml:"certFile"`
	KeyFile  string `yaml:"keyFile"`

	CaFile string `yaml:"caFile"` //optional depending on server config
	// If you want to verify the hostname and server cert (like a wildcard for cass cluster) then you should turn this on
	// This option is basically the inverse of InSecureSkipVerify
	// See InSecureSkipVerify in http://golang.org/pkg/crypto/tls/ for more info
	EnableHostVerification bool `yaml:"enableHostVerification"`

	ServerName string `yaml:"serverName"`
}

TLS describe TLS configuration (for Kafka, Cassandra, SQL)

type XDGSCRAMClient added in v0.18.0

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

XDGSCRAMClient is the scram client

func (*XDGSCRAMClient) Begin added in v0.18.0

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

Begin creates new client

func (*XDGSCRAMClient) Done added in v0.18.0

func (x *XDGSCRAMClient) Done() bool

Done stops the client

func (*XDGSCRAMClient) Step added in v0.18.0

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. It returns a string to be sent to the server or an error if the server message is invalid. Calling Step after a conversation completes is also an error.

Jump to

Keyboard shortcuts

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