Documentation ¶
Overview ¶
Package auth implements the apic service account token management. Contributed by Xenon team
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApicAuth ¶
type ApicAuth struct {
// contains filtered or unexported fields
}
ApicAuth provides authentication methods for calls against APIC Cloud services.
func NewWithFlow ¶
func NewWithFlow(tenantID, privKey, publicKey, password, url, aud, clientID string, singleURL string, timeout time.Duration) *ApicAuth
NewWithFlow returns an ApicAuth that uses the axway authentication flow
func NewWithStatic ¶
NewWithStatic returns an ApicAuth that uses a fixed token
func (*ApicAuth) Authenticate ¶
func (aa *ApicAuth) Authenticate(hs HeaderSetter) error
Authenticate applies the authentication headers
type Config ¶
type Config struct { PrivateKey string `mapstructure:"private_key"` PublicKey string `mapstructure:"public_key"` KeyPassword string `mapstructure:"key_password"` URL string `mapstructure:"url"` Audience string `mapstructure:"audience"` ClientID string `mapstructure:"client_id"` Timeout time.Duration `mapstructure:"timeout"` }
Config the auth config
type HeaderSetter ¶
type HeaderSetter interface { // SetHeader sets a header on a http request SetHeader(key, value string) }
HeaderSetter sets a header for a request
type NetHeaderSetter ¶
NetHeaderSetter sets headers an a net/http request
func (NetHeaderSetter) SetHeader ¶
func (nhs NetHeaderSetter) SetHeader(key, value string)
SetHeader sets a header on a net/http request
type PlatformTokenGetter ¶
type PlatformTokenGetter interface {
// contains filtered or unexported methods
}
PlatformTokenGetter - Interface for token getter
func NewPlatformTokenGetter ¶
func NewPlatformTokenGetter(privKey, publicKey, password, url, aud, clientID string, singleURL string, timeout time.Duration) PlatformTokenGetter
NewPlatformTokenGetter returns a token getter for axway ID
func NewPlatformTokenGetterWithCentralConfig ¶
func NewPlatformTokenGetterWithCentralConfig(centralCfg config.CentralConfig) PlatformTokenGetter
NewPlatformTokenGetterWithCentralConfig returns a token getter for axway ID
type TokenGetter ¶
TokenGetter provides a bearer token to be used in api calls. Might block
func NewTokenAuth ¶
func NewTokenAuth(ac Config, tenantID string) TokenGetter
NewTokenAuth Create a new auth token requester