auth

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider added in v0.2.0

type Provider interface {
	// HasDataForHTTP is used to check if data for HTTP are available
	HasDataForHTTP() bool

	// GetHTTPHeaders is used to get all auth headers
	GetHTTPHeaders() (map[string]string, error)
}

Provider provide a general method to add auth message

type TLSAuthProvider

type TLSAuthProvider struct {
	// contains filtered or unexported fields
}

func NewAuthenticationTLS

func NewAuthenticationTLS(certificatePath string, privateKeyPath string,
	allowInsecureConnection bool) *TLSAuthProvider

NewAuthenticationTLS initialize the authentication provider

func (*TLSAuthProvider) GetHTTPHeaders added in v0.2.0

func (p *TLSAuthProvider) GetHTTPHeaders() (map[string]string, error)

func (*TLSAuthProvider) GetTLSCertificate

func (p *TLSAuthProvider) GetTLSCertificate() (*tls.Certificate, error)

func (*TLSAuthProvider) GetTLSConfig added in v0.2.0

func (p *TLSAuthProvider) GetTLSConfig(certFile string, allowInsecureConnection bool) (*tls.Config, error)

func (*TLSAuthProvider) HasDataForHTTP added in v0.2.0

func (p *TLSAuthProvider) HasDataForHTTP() bool

func (*TLSAuthProvider) Init

func (p *TLSAuthProvider) Init() error

func (*TLSAuthProvider) Name

func (p *TLSAuthProvider) Name() string

type TokenAuthProvider

type TokenAuthProvider struct {
	// contains filtered or unexported fields
}

func NewAuthenticationToken

func NewAuthenticationToken(token string) *TokenAuthProvider

NewAuthenticationToken return a interface of Provider with a string token.

func NewAuthenticationTokenFromFile

func NewAuthenticationTokenFromFile(tokenFilePath string) *TokenAuthProvider

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

func (*TokenAuthProvider) GetData

func (p *TokenAuthProvider) GetData() ([]byte, error)

func (*TokenAuthProvider) GetHTTPHeaders added in v0.2.0

func (p *TokenAuthProvider) GetHTTPHeaders() (map[string]string, error)

func (*TokenAuthProvider) HasDataForHTTP added in v0.2.0

func (p *TokenAuthProvider) HasDataForHTTP() bool

func (*TokenAuthProvider) Init

func (p *TokenAuthProvider) Init() error

Jump to

Keyboard shortcuts

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