auth

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider interface {
	// Init the authentication provider.
	Init() error

	// Name func returns the identifier for this authentication method.
	Name() string

	// return a client certificate chain, or nil if the data are not available
	GetTLSCertificate() (*tls.Certificate, error)

	// GetData returns the authentication data identifying this client that will be sent to the broker.
	GetData() ([]byte, error)

	io.Closer
}

Provider is a interface of authentication providers.

func NewAuthDisabled

func NewAuthDisabled() Provider

NewAuthDisabled return a interface of Provider

func NewAuthenticationTLS

func NewAuthenticationTLS(certificatePath string, privateKeyPath string) Provider

NewAuthenticationTLS initialize the authentication provider

func NewAuthenticationTLSWithParams

func NewAuthenticationTLSWithParams(params map[string]string) Provider

NewAuthenticationTLSWithParams initialize the authentication provider with map param.

func NewAuthenticationToken

func NewAuthenticationToken(token string) Provider

NewAuthenticationToken return a interface of Provider with a string token.

func NewAuthenticationTokenFromFile

func NewAuthenticationTokenFromFile(tokenFilePath string) Provider

NewAuthenticationTokenFromFile return a interface of a Provider with a string token file path.

func NewAuthenticationTokenWithParams

func NewAuthenticationTokenWithParams(params map[string]string) (Provider, error)

NewAuthenticationTokenWithParams return a interface of Provider with string map.

func NewProvider

func NewProvider(name string, params string) (Provider, error)

NewProvider get/create an authentication data provider which provides the data that this client will be sent to the broker. Some authentication method need to auth between each client channel. So it need the broker, who it will talk to.

Jump to

Keyboard shortcuts

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