auth

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	TLSPluginName = "org.apache.pulsar.client.impl.auth.AuthenticationTls"
)
View Source
const (
	TokenPluginName = "org.apache.pulsar.client.impl.auth.AuthenticationToken"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider added in v0.2.0

type Provider interface {
	RoundTrip(req *http.Request) (*http.Response, error)
	Transport() http.RoundTripper
}

Provider provide a general method to add auth message

func GetAuthProvider added in v0.4.0

func GetAuthProvider(config *common.Config) (*Provider, error)

type TLSAuthProvider

type TLSAuthProvider struct {
	T http.RoundTripper
	// contains filtered or unexported fields
}

func NewAuthenticationTLS

func NewAuthenticationTLS(certificatePath string, privateKeyPath string,
	transport http.RoundTripper) (*TLSAuthProvider, error)

NewAuthenticationTLS initialize the authentication provider

func NewAuthenticationTLSFromAuthParams added in v0.4.0

func NewAuthenticationTLSFromAuthParams(encodedAuthParams string,
	transport http.RoundTripper) (*TLSAuthProvider, error)

func (*TLSAuthProvider) GetTLSCertificate

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

func (*TLSAuthProvider) RoundTrip added in v0.4.0

func (p *TLSAuthProvider) RoundTrip(req *http.Request) (*http.Response, error)

func (*TLSAuthProvider) Transport added in v0.4.0

func (p *TLSAuthProvider) Transport() http.RoundTripper

type TokenAuthProvider

type TokenAuthProvider struct {
	T http.RoundTripper
	// contains filtered or unexported fields
}

func NewAuthenticationToken

func NewAuthenticationToken(token string, transport http.RoundTripper) (*TokenAuthProvider, error)

NewAuthenticationToken return a interface of Provider with a string token.

func NewAuthenticationTokenFromAuthParams added in v0.4.0

func NewAuthenticationTokenFromAuthParams(encodedAuthParam string,
	transport http.RoundTripper) (*TokenAuthProvider, error)

func NewAuthenticationTokenFromFile

func NewAuthenticationTokenFromFile(tokenFilePath string, transport http.RoundTripper) (*TokenAuthProvider, error)

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

func (*TokenAuthProvider) RoundTrip added in v0.4.0

func (p *TokenAuthProvider) RoundTrip(req *http.Request) (*http.Response, error)

func (*TokenAuthProvider) Transport added in v0.4.0

func (p *TokenAuthProvider) Transport() http.RoundTripper

type Transport added in v0.4.0

type Transport struct {
	T http.RoundTripper
}

Jump to

Keyboard shortcuts

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