auth

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

View Source
const (
	TypeClientCredential = "client_credentials"
	TypeDeviceCode       = "device_code"
)
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

func GetDefaultTransport added in v0.5.0

func GetDefaultTransport(config *common.Config) http.RoundTripper

func MakeKeyringStore added in v0.5.0

func MakeKeyringStore() (store.Store, error)

Types

type OAuth2Provider added in v0.5.0

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

func NewAuthenticationOAuth2 added in v0.5.0

func NewAuthenticationOAuth2(issuer oauth2.Issuer, store store.Store) (*OAuth2Provider, error)

func NewAuthenticationOAuth2WithParams added in v0.5.0

func NewAuthenticationOAuth2WithParams(
	issueEndpoint,
	clientID,
	audience string,
	transport http.RoundTripper) (*OAuth2Provider, error)

func (*OAuth2Provider) RoundTrip added in v0.5.0

func (o *OAuth2Provider) RoundTrip(req *http.Request) (*http.Response, error)

func (*OAuth2Provider) Transport added in v0.5.0

func (o *OAuth2Provider) Transport() http.RoundTripper

func (*OAuth2Provider) WithTransport added in v0.5.0

func (o *OAuth2Provider) WithTransport(tripper http.RoundTripper)

type Provider added in v0.2.0

type Provider interface {
	RoundTrip(req *http.Request) (*http.Response, error)
	Transport() http.RoundTripper
	WithTransport(tripper 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)

func NewAuthenticationOAuth2WithDefaultFlow added in v0.5.0

func NewAuthenticationOAuth2WithDefaultFlow(issuer oauth2.Issuer, keyFile string) (Provider, error)

NewAuthenticationOAuth2WithDefaultFlow uses memory to save the grant

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

func (*TLSAuthProvider) WithTransport added in v0.5.0

func (p *TLSAuthProvider) WithTransport(tripper 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

func (*TokenAuthProvider) WithTransport added in v0.5.0

func (p *TokenAuthProvider) WithTransport(tripper 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