Documentation ¶
Index ¶
- Constants
- func GetDefaultTransport(config *config.Config) http.RoundTripper
- func MakeKeyringStore() (store.Store, error)
- func NewDefaultTransport(config *config.Config) (http.RoundTripper, error)
- type DefaultProvider
- type OAuth2ClientCredentials
- type OAuth2Provider
- func NewAuthenticationOAuth2(issuer oauth2.Issuer, store store.Store) (*OAuth2Provider, error)
- func NewAuthenticationOAuth2FromAuthParams(encodedAuthParam string, transport http.RoundTripper) (*OAuth2Provider, error)
- func NewAuthenticationOAuth2WithParams(issuerEndpoint, clientID, audience string, scope string, ...) (*OAuth2Provider, error)
- type Provider
- func GetAuthProvider(config *config.Config) (Provider, error)
- func NewAuthenticationOAuth2WithDefaultFlow(issuer oauth2.Issuer, keyFile string) (Provider, error)
- func NewAuthenticationOAuth2WithFlow(issuer oauth2.Issuer, flowOptions oauth2.ClientCredentialsFlowOptions) (Provider, error)
- func NewDefaultProvider(t http.RoundTripper) Provider
- type TLS
- type TLSAuthProvider
- type Token
- type TokenAuthProvider
- func NewAuthenticationToken(token string, transport http.RoundTripper) (*TokenAuthProvider, error)
- func NewAuthenticationTokenFromAuthParams(encodedAuthParam string, transport http.RoundTripper) (*TokenAuthProvider, error)
- func NewAuthenticationTokenFromFile(tokenFilePath string, transport http.RoundTripper) (*TokenAuthProvider, error)
- type Transport
Constants ¶
View Source
const ( OAuth2PluginName = "org.apache.pulsar.client.impl.auth.oauth2.AuthenticationOAuth2" OAuth2PluginShortName = "oauth2" )
View Source
const ( TLSPluginName = "org.apache.pulsar.client.impl.auth.AuthenticationTls" TLSPluginShortName = "tls" )
View Source
const ( TokenPluginName = "org.apache.pulsar.client.impl.auth.AuthenticationToken" TokePluginShortName = "token" )
Variables ¶
This section is empty.
Functions ¶
func GetDefaultTransport ¶
func GetDefaultTransport(config *config.Config) http.RoundTripper
GetDefaultTransport gets a default transport. Deprecated: Use NewDefaultTransport instead.
func MakeKeyringStore ¶
func NewDefaultTransport ¶
func NewDefaultTransport(config *config.Config) (http.RoundTripper, error)
Types ¶
type DefaultProvider ¶
type DefaultProvider struct {
// contains filtered or unexported fields
}
func (*DefaultProvider) Transport ¶
func (dp *DefaultProvider) Transport() http.RoundTripper
func (*DefaultProvider) WithTransport ¶
func (dp *DefaultProvider) WithTransport(t http.RoundTripper)
type OAuth2ClientCredentials ¶
type OAuth2Provider ¶
type OAuth2Provider struct {
// contains filtered or unexported fields
}
func NewAuthenticationOAuth2 ¶
func NewAuthenticationOAuth2FromAuthParams ¶
func NewAuthenticationOAuth2FromAuthParams(encodedAuthParam string, transport http.RoundTripper) (*OAuth2Provider, error)
func NewAuthenticationOAuth2WithParams ¶
func NewAuthenticationOAuth2WithParams( issuerEndpoint, clientID, audience string, scope string, transport http.RoundTripper) (*OAuth2Provider, error)
func (*OAuth2Provider) Transport ¶
func (o *OAuth2Provider) Transport() http.RoundTripper
func (*OAuth2Provider) WithTransport ¶
func (o *OAuth2Provider) WithTransport(tripper http.RoundTripper)
type Provider ¶
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 NewAuthenticationOAuth2WithDefaultFlow ¶
NewAuthenticationOAuth2WithDefaultFlow uses memory to save the grant
func NewDefaultProvider ¶
func NewDefaultProvider(t http.RoundTripper) Provider
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 ¶
func NewAuthenticationTLSFromAuthParams(encodedAuthParams string, transport http.RoundTripper) (*TLSAuthProvider, error)
func (*TLSAuthProvider) GetTLSCertificate ¶
func (p *TLSAuthProvider) GetTLSCertificate() (*tls.Certificate, error)
func (*TLSAuthProvider) Transport ¶
func (p *TLSAuthProvider) Transport() http.RoundTripper
func (*TLSAuthProvider) WithTransport ¶
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 ¶
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) Transport ¶
func (p *TokenAuthProvider) Transport() http.RoundTripper
func (*TokenAuthProvider) WithTransport ¶
func (p *TokenAuthProvider) WithTransport(tripper http.RoundTripper)
type Transport ¶
type Transport struct {
T http.RoundTripper
}
Click to show internal directories.
Click to hide internal directories.