accessstrategy

package
v0.0.0-...-ea62a40 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UnsupportedErr = errors.New("unsupported access strategy")

UnsupportedErr is an error produced when execution of unsupported access strategy takes place.

Functions

func NewCMPmTLSAccessStrategyExecutor

func NewCMPmTLSAccessStrategyExecutor(certCache credloader.CertCache, tenantProviderFunc func(ctx context.Context) (string, error), externalClientCertSecretName string) *cmpMTLSAccessStrategyExecutor

NewCMPmTLSAccessStrategyExecutor creates a new Executor for the CMP mTLS Access Strategy

func NewOpenAccessStrategyExecutor

func NewOpenAccessStrategyExecutor() *openAccessStrategyExecutor

NewOpenAccessStrategyExecutor creates a new Executor for the Open Access Strategy

Types

type AccessStrategies

type AccessStrategies []AccessStrategy

AccessStrategies is a slice of AccessStrategy objects

func (AccessStrategies) GetSupported

func (as AccessStrategies) GetSupported() (Type, bool)

GetSupported returns the first AccessStrategy in the slice that is supported by CMP

type AccessStrategy

type AccessStrategy struct {
	Type              Type   `json:"type"`
	CustomType        Type   `json:"customType"`
	CustomDescription string `json:"customDescription"`
}

AccessStrategy is an ORD object

func (AccessStrategy) Validate

func (as AccessStrategy) Validate() error

Validate validates a given access strategy

type Executor

type Executor interface {
	Execute(ctx context.Context, client *http.Client, url, tnt string, additionalHeaders *sync.Map) (*http.Response, error)
}

Executor defines an interface for execution of different access strategies

type ExecutorProvider

type ExecutorProvider interface {
	Provide(accessStrategyType Type) (Executor, error)
}

ExecutorProvider defines an interface for access strategy executor provider

type HTTPRoundTripper

type HTTPRoundTripper interface {
	RoundTrip(*http.Request) (*http.Response, error)
	Clone() HTTPRoundTripper
	GetTransport() *http.Transport
}

HTTPRoundTripper missing godoc

type Provider

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

Provider is responsible to provides an access strategy executors

func NewDefaultExecutorProvider

func NewDefaultExecutorProvider(certCache credloader.CertCache, externalClientCertSecretName string) *Provider

NewDefaultExecutorProvider returns a new access strategy executor provider with the default static type <-> executor mapping

func NewExecutorProvider

func NewExecutorProvider(executors map[Type]Executor) *Provider

NewExecutorProvider returns a new access strategy executor provider based on type <-> executor mapping

func NewExecutorProviderWithTenant

func NewExecutorProviderWithTenant(certCache credloader.CertCache, tenantProviderFunc func(ctx context.Context) (string, error), externalClientCertSecretName string) *Provider

NewExecutorProviderWithTenant returns a new access strategy executor provider by given tenant provider function

func (*Provider) Provide

func (p *Provider) Provide(accessStrategyType Type) (Executor, error)

Provide provides an executor for a given access strategy if supported, UnsupportedErr otherwise

type Type

type Type string

Type represents the possible type of the AccessStrategy

const (
	// OpenAccessStrategy is an AccessStrategyType indicating that the ORD document is not secured
	OpenAccessStrategy Type = "open"

	// CMPmTLSAccessStrategy is an AccessStrategyType indicating that the ORD document trusts CMP's client certificate.
	CMPmTLSAccessStrategy Type = "sap:cmp-mtls:v1"

	// CustomAccessStrategy is an AccessStrategyType indicating that not a standard ORD security mechanism is used for the ORD document
	CustomAccessStrategy Type = "custom"

	// MinDescriptionLength represents the minimal accepted length of the Description field
	MinDescriptionLength = 1
	// MaxDescriptionLength represents the minimal accepted length of the Description field
	MaxDescriptionLength = 5000
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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