sm

package
v0.11.25 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const READY_TRUE_FIELD_QUERY = "ready eq true"

Variables

View Source
var ErrBrokerPlatformCredentialsNotFound = errors.New("credentials not found")

ErrBrokerPlatformCredentialsNotFound error returned from SM when the given broker platform credentials id does not exist

View Source
var ErrConflictingBrokerPlatformCredentials = errors.New("conflicting broker platform credentials")

ErrConflictingBrokerPlatformCredentials error returned from SM when broker platform credentials already exist

Functions

This section is empty.

Types

type BasicAuthTransport

type BasicAuthTransport struct {
	Username string
	Password string

	Rt http.RoundTripper
}

BasicAuthTransport implements http.RoundTripper interface and intercepts that request that is being sent, adding basic authorization and delegates back to the original transport.

func (*BasicAuthTransport) RoundTrip

func (b *BasicAuthTransport) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip implements http.RoundTrip and adds basic authorization header before delegating to the underlying RoundTripper

type Client

type Client interface {
	GetBrokers(ctx context.Context) ([]*types.ServiceBroker, error)
	GetVisibilities(ctx context.Context, planIDs []string) ([]*types.Visibility, error)
	GetPlans(ctx context.Context) ([]*types.ServicePlan, error)
	GetServiceOfferings(ctx context.Context) ([]*types.ServiceOffering, error)
	PutCredentials(ctx context.Context, credentials *types.BrokerPlatformCredential, force bool) (*types.BrokerPlatformCredential, error)
	ActivateCredentials(ctx context.Context, credentialsID string) error
}

Client provides the logic for calling into the Service Manager

type SSLTransport added in v0.11.3

type SSLTransport struct {
	SkipSslValidation bool
	TLSCertificates   []tls.Certificate
	Rt                http.RoundTripper
}

SSLTransport implements http.RoundTripper and sets the SSL transport

func (*SSLTransport) RoundTrip added in v0.11.3

func (b *SSLTransport) RoundTrip(request *http.Request) (*http.Response, error)

RoundTrip implements http.RoundTrip and adds skip SSL validation logic

type ServiceManagerClient added in v0.1.1

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

ServiceManagerClient allows consuming Service Manager APIs

func NewClient

func NewClient(config *Settings) (*ServiceManagerClient, error)

NewClient builds a new Service Manager Client from the provided configuration

func (*ServiceManagerClient) ActivateCredentials added in v0.11.3

func (c *ServiceManagerClient) ActivateCredentials(ctx context.Context, credentialsID string) error

ActivateCredentials notifies Service Manager that the new broker credentials are valid and verified

func (*ServiceManagerClient) GetBrokers added in v0.1.1

func (c *ServiceManagerClient) GetBrokers(ctx context.Context) ([]*types.ServiceBroker, error)

GetBrokers calls the Service Manager in order to obtain all brokers that need to be registered in the service broker proxy

func (*ServiceManagerClient) GetPlans added in v0.2.0

func (c *ServiceManagerClient) GetPlans(ctx context.Context) ([]*types.ServicePlan, error)

GetPlans returns plans from Service Manager

func (*ServiceManagerClient) GetServiceOfferings added in v0.9.1

func (c *ServiceManagerClient) GetServiceOfferings(ctx context.Context) ([]*types.ServiceOffering, error)

GetServiceOfferings returns service offerings from Service Manager

func (*ServiceManagerClient) GetVisibilities added in v0.2.0

func (c *ServiceManagerClient) GetVisibilities(ctx context.Context, planIDs []string) ([]*types.Visibility, error)

GetVisibilities returns plan visibilities from Service Manager

func (*ServiceManagerClient) PutCredentials added in v0.9.0

PutCredentials sends new broker platform credentials to Service Manager

type Settings

type Settings struct {
	User                 string
	Password             string
	URL                  string
	OSBAPIPath           string        `mapstructure:"osb_api_path"`
	NotificationsAPIPath string        `mapstructure:"notifications_api_path"`
	RequestTimeout       time.Duration `mapstructure:"request_timeout"`
	SkipSSLValidation    bool          `mapstructure:"skip_ssl_validation"`
	VisibilitiesPageSize int           `mapstructure:"visibilities_page_size"`
	TLSClientKey         string        `mapstructure:"tls_client_id"`
	TLSClientCertificate string        `mapstructure:"tls_client_certificate"`
	Transport            http.RoundTripper
}

Settings type holds SM Client config properties

func DefaultSettings

func DefaultSettings() *Settings

DefaultSettings builds a default Service Manager Settings

func NewSettings

func NewSettings(env env.Environment) (*Settings, error)

NewSettings builds a Service Manager Settings from the provided Environment

func (*Settings) GetCertificates added in v0.11.3

func (c *Settings) GetCertificates() ([]tls.Certificate, error)

GetCertificates returns the client TLS certificates if configured

func (*Settings) Validate

func (c *Settings) Validate() error

Validate validates the configuration and returns appropriate errors in case it is invalid

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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