configuration

package
v0.0.0-...-1f07f51 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: BSD-3-Clause, MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const OAUTH2 = "OAuth2"

OAUTH2 represents the authorization type for OAuth2

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationType

type AuthorizationType string

AuthorizationType represents the type of authentication that is used. Currently only OAuth2 is supported

type CommunicatorConfiguration

type CommunicatorConfiguration struct {
	// APIEndpoint represents the API endpoint of for the communicator
	APIEndpoint url.URL
	// ConnectTimeout represents the connect timeout
	ConnectTimeout time.Duration
	// SocketTimeout represents the request timeout
	SocketTimeout time.Duration
	// IdleTimeout represents the idle connection timeout
	IdleTimeout time.Duration
	// KeepAliveTimeout represents the HTTP KeepAlive interval
	KeepAliveTimeout time.Duration
	// MaxConnections represents the maximum amount of concurrent pooled connections
	MaxConnections int
	// AuthorizationType represents authorizationType used to sign the requests
	AuthorizationType AuthorizationType
	// AuthorizationID represents an id used for authorization. The meaning of this id is different for each authorization type.
	// For instance, for OAuth2 this is the client ID.
	AuthorizationID string
	// AuthorizationSecret represents a secret used for authorization. The meaning of this secret is different for each authorization type.
	// For instance, for OAuth2 this is the client secret.
	AuthorizationSecret string
	// OAuth2TokenURI represents the OAuth2 token URI.
	OAuth2TokenURI string
	// Proxy represents the URL for the connection proxy
	Proxy *url.URL
	// Integrator represents the integrator name
	Integrator string
	// ShoppingCartExtension represents the shopping cart extension used in the metadata headers
	ShoppingCartExtension *domain.ShoppingCartExtension
}

CommunicatorConfiguration represents the configuration to be used by a Communicator

func DefaultOAuth2Configuration

func DefaultOAuth2Configuration(clientID, clientSecret, tokenURI, integrator string) (*CommunicatorConfiguration, error)

DefaultOAuth2Configuration returns the default communicator configuration for authenticating using OAuth2

func (*CommunicatorConfiguration) GetOAuth2ClientID

func (c *CommunicatorConfiguration) GetOAuth2ClientID() string

GetOAuth2ClientID returns the OAuth2 client ID.

This function is an alias for getting c.AuthorizationID

func (*CommunicatorConfiguration) GetOAuth2ClientSecret

func (c *CommunicatorConfiguration) GetOAuth2ClientSecret() string

GetOAuth2ClientSecret returns the OAuth2 client secret.

This function is an alias for getting c.AuthorizationSecret

func (*CommunicatorConfiguration) SetOAuth2ClientID

func (c *CommunicatorConfiguration) SetOAuth2ClientID(oauth2ClientID string)

SetOAuth2ClientID sets the OAuth2 client ID.

This function is an alias for setting c.AuthorizationID

func (*CommunicatorConfiguration) SetOAuth2ClientSecret

func (c *CommunicatorConfiguration) SetOAuth2ClientSecret(oauth2ClientSecret string)

SetOAuth2ClientSecret sets the OAuth2 client secret.

This function is an alias for setting c.AuthorizationSecret

Jump to

Keyboard shortcuts

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