config

package
v0.0.0-...-6d13c91 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseConfigToJSONMap

func ParseConfigToJSONMap(configData string) (map[string]gjson.Result, error)

ParseConfigToJSONMap parses configuration into json object

func ReadConfigFile

func ReadConfigFile(path string) (string, error)

ReadConfigFile reads config from file

Types

type DestinationsConfig

type DestinationsConfig struct {
	InstanceClientIDPath     string                    `envconfig:"APP_DESTINATION_INSTANCE_CLIENT_ID_PATH,default=clientid"`
	InstanceClientSecretPath string                    `envconfig:"APP_DESTINATION_INSTANCE_CLIENT_SECRET_PATH,default=clientsecret"`
	InstanceURLPath          string                    `envconfig:"APP_DESTINATION_INSTANCE_URL_PATH,default=uri"`
	InstanceTokenURLPath     string                    `envconfig:"APP_DESTINATION_INSTANCE_TOKEN_URL_PATH,default=certurl"`
	InstanceCertPath         string                    `envconfig:"APP_DESTINATION_INSTANCE_X509_CERT_PATH,default=certificate"`
	InstanceKeyPath          string                    `envconfig:"APP_DESTINATION_INSTANCE_X509_KEY_PATH,default=key"`
	DestinationSecretPath    string                    `envconfig:"APP_DESTINATION_SECRET_PATH"`
	RegionToInstanceConfig   map[string]InstanceConfig `envconfig:"-"`
	OAuthMode                oauth.AuthMode            `envconfig:"APP_DESTINATION_OAUTH_MODE,default=oauth-mtls"`
}

DestinationsConfig destination service configuration

func (*DestinationsConfig) MapInstanceConfigs

func (c *DestinationsConfig) MapInstanceConfigs() error

MapInstanceConfigs creates region to destination configuration map

type InstanceConfig

type InstanceConfig struct {
	ClientID     string
	ClientSecret string
	URL          string
	TokenURL     string
	Cert         string
	Key          string
}

InstanceConfig is a service instance config

type PairingAdapterConfig

type PairingAdapterConfig struct {
	ConfigmapName        string `envconfig:"APP_PAIRING_ADAPTER_CM_NAME"`
	ConfigmapNamespace   string `envconfig:"APP_PAIRING_ADAPTER_CM_NAMESPACE"`
	ConfigmapKey         string `envconfig:"APP_PAIRING_ADAPTER_CM_KEY"`
	WatcherCorrelationID string `envconfig:"APP_PAIRING_ADAPTER_WATCHER_ID"`
}

PairingAdapterConfig contains configuration for the pairing adapters

type Provider

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

Provider missing godoc

func NewProvider

func NewProvider(fileName string) *Provider

NewProvider missing godoc

func (*Provider) GetApplicationHideSelectors

func (p *Provider) GetApplicationHideSelectors() (map[string][]string, error)

GetApplicationHideSelectors missing godoc

func (*Provider) GetRequiredGrantTypes

func (p *Provider) GetRequiredGrantTypes(path string) ([]string, error)

GetRequiredGrantTypes missing godoc

func (*Provider) GetRequiredScopes

func (p *Provider) GetRequiredScopes(path string) ([]string, error)

GetRequiredScopes missing godoc

func (*Provider) Load

func (p *Provider) Load() error

Load missing godoc

type SaasRegConfig

type SaasRegConfig struct {
	ClientID        string
	ClientSecret    string
	TokenURL        string
	SaasRegistryURL string
}

SaasRegConfig is a saas reg config

type SelfRegConfig

type SelfRegConfig struct {
	SelfRegisterDistinguishLabelKey string `envconfig:"APP_SELF_REGISTER_DISTINGUISH_LABEL_KEY"`
	SelfRegisterLabelKey            string `envconfig:"APP_SELF_REGISTER_LABEL_KEY,optional"`
	SelfRegisterLabelValuePrefix    string `envconfig:"APP_SELF_REGISTER_LABEL_VALUE_PREFIX,optional"`
	SelfRegisterResponseKey         string `envconfig:"APP_SELF_REGISTER_RESPONSE_KEY,optional"`
	SaaSAppNameLabelKey             string `envconfig:"APP_SELF_REGISTER_SAAS_APP_LABEL_KEY,optional"`
	SelfRegisterPath                string `envconfig:"APP_SELF_REGISTER_PATH,optional"`
	SelfRegisterNameQueryParam      string `envconfig:"APP_SELF_REGISTER_NAME_QUERY_PARAM,optional"`
	SelfRegisterTenantQueryParam    string `envconfig:"APP_SELF_REGISTER_TENANT_QUERY_PARAM,optional"`
	SelfRegisterRequestBodyPattern  string `envconfig:"APP_SELF_REGISTER_REQUEST_BODY_PATTERN,optional"`
	SelfRegisterSecretPath          string `envconfig:"APP_SELF_REGISTER_SECRET_PATH"`
	SelfRegSaaSAppSecretPath        string `envconfig:"APP_SELF_REGISTER_SAAS_APP_SECRET_PATH"`

	OAuthMode      oauth.AuthMode `envconfig:"APP_SELF_REGISTER_OAUTH_MODE,default=oauth-mtls"`
	OauthTokenPath string         `envconfig:"APP_SELF_REGISTER_OAUTH_TOKEN_PATH,optional"`

	SkipSSLValidation bool `envconfig:"APP_SELF_REGISTER_SKIP_SSL_VALIDATION,default=false"`

	ClientTimeout time.Duration `envconfig:"default=30s"`

	InstanceClientIDPath     string                    `envconfig:"APP_SELF_REGISTER_INSTANCE_CLIENT_ID_PATH"`
	InstanceClientSecretPath string                    `envconfig:"APP_SELF_REGISTER_INSTANCE_CLIENT_SECRET_PATH"`
	InstanceURLPath          string                    `envconfig:"APP_SELF_REGISTER_INSTANCE_URL_PATH"`
	InstanceTokenURLPath     string                    `envconfig:"APP_SELF_REGISTER_INSTANCE_TOKEN_URL_PATH"`
	InstanceCertPath         string                    `envconfig:"APP_SELF_REGISTER_INSTANCE_X509_CERT_PATH"`
	InstanceKeyPath          string                    `envconfig:"APP_SELF_REGISTER_INSTANCE_X509_KEY_PATH"`
	RegionToInstanceConfig   map[string]InstanceConfig `envconfig:"-"`

	SaaSAppNamePath     string            `envconfig:"APP_SELF_REGISTER_SAAS_APP_NAME_PATH"`
	RegionToSaaSAppName map[string]string `envconfig:"-"`

	ExternalClientCertSecretName string `envconfig:"APP_EXTERNAL_CLIENT_CERT_SECRET_NAME"`
}

SelfRegConfig is configuration for the runtime self-registration flow

func (*SelfRegConfig) MapInstanceConfigs

func (c *SelfRegConfig) MapInstanceConfigs() error

MapInstanceConfigs parses the InstanceConfigs json string to map with key: region name and value: InstanceConfig for the instance in the region

func (*SelfRegConfig) MapSaasAppNameToRegion

func (c *SelfRegConfig) MapSaasAppNameToRegion() error

MapSaasAppNameToRegion parses json configuration to a map with key: region and value SaaS application name

func (*SelfRegConfig) PrepareConfiguration

func (c *SelfRegConfig) PrepareConfiguration() error

PrepareConfiguration take cares to build the self register configuration

type SystemFieldDiscoveryEngineConfig

type SystemFieldDiscoveryEngineConfig struct {
	SaasRegSecretPath string `envconfig:"APP_SELF_REGISTER_SAAS_APP_SECRET_PATH"`
	OauthTokenPath    string `envconfig:"APP_SELF_REGISTER_OAUTH_TOKEN_PATH,optional"`

	SaasRegClientIDPath     string `envconfig:"APP_SELF_REGISTER_INSTANCE_CLIENT_ID_PATH"`
	SaasRegClientSecretPath string `envconfig:"APP_SELF_REGISTER_INSTANCE_CLIENT_SECRET_PATH"`
	SaasRegTokenURLPath     string `envconfig:"APP_SELF_REGISTER_INSTANCE_URL_PATH"`
	SaasRegURLPath          string `envconfig:"APP_SELF_REGISTER_SAAS_REGISTRY_URL_PATH"`

	RegionToSaasRegConfig map[string]SaasRegConfig `envconfig:"-"`
}

SystemFieldDiscoveryEngineConfig is configuration for the system field discovery engine

func (*SystemFieldDiscoveryEngineConfig) MapSaasRegConfigs

func (c *SystemFieldDiscoveryEngineConfig) MapSaasRegConfigs() error

MapSaasRegConfigs parses the SaasRegConfigs json string to map with key: region name and value: SaasRegConfig for the instance in the region

func (*SystemFieldDiscoveryEngineConfig) PrepareConfiguration

func (c *SystemFieldDiscoveryEngineConfig) PrepareConfiguration() error

PrepareConfiguration take cares to build the system field discovery engine configuration

Jump to

Keyboard shortcuts

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