config

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CustomConfigItems = []auconfigapi.ConfigItem{
	{
		Key:         config.KeyBasicAuthUsername,
		EnvName:     config.KeyBasicAuthUsername,
		Default:     "",
		Description: "username for basic-auth write access to this service",
		Validate:    auconfigenv.ObtainNotEmptyValidator(),
	},
	{
		Key:         config.KeyBasicAuthPassword,
		EnvName:     config.KeyBasicAuthPassword,
		Default:     "",
		Description: "password for basic-auth write access to this service",
		Validate:    auconfigenv.ObtainNotEmptyValidator(),
	},
	{
		Key:         config.KeySSHPrivateKey,
		EnvName:     config.KeySSHPrivateKey,
		Description: "ssh private key used to access the vcs",
		Default:     "",
		Validate:    auconfigenv.ObtainNotEmptyValidator(),
	},
	{
		Key:         config.KeySSHPrivateKeyPassword,
		EnvName:     config.KeySSHPrivateKeyPassword,
		Description: "ssh private key password",
		Default:     "",
		Validate:    auconfigapi.ConfigNeedsNoValidation,
	},
	{
		Key:         config.KeySSHMetadataRepositoryUrl,
		EnvName:     config.KeySSHMetadataRepositoryUrl,
		Default:     "",
		Description: "ssh git clone url for service-metadata repository",
		Validate:    auconfigenv.ObtainNotEmptyValidator(),
	},
	{
		Key:         config.KeyBitbucketUsername,
		EnvName:     config.KeyBitbucketUsername,
		Default:     "",
		Description: "bitbucket username for api and git clone service-metadata access",
		Validate:    auconfigenv.ObtainNotEmptyValidator(),
	},
	{
		Key:         config.KeyBitbucketPassword,
		EnvName:     config.KeyBitbucketPassword,
		Default:     "",
		Description: "bitbucket password for api and git clone service-metadata access",
		Validate:    auconfigenv.ObtainNotEmptyValidator(),
	},
	{
		Key:         config.KeyBitbucketServer,
		EnvName:     config.KeyBitbucketServer,
		Default:     "https://bitbucket.com",
		Description: "base URL to the bitbucket server, including protocol",
		Validate:    auconfigenv.ObtainPatternValidator("^https?://.*$"),
	},
	{
		Key:         config.KeyBitbucketCacheSize,
		EnvName:     config.KeyBitbucketCacheSize,
		Default:     "1000",
		Description: "size of the cache for bitbucket api items",
		Validate:    auconfigenv.ObtainUintRangeValidator(10, 1000),
	},
	{
		Key:         config.KeyBitbucketCacheRetentionSeconds,
		EnvName:     config.KeyBitbucketCacheRetentionSeconds,
		Default:     "3600",
		Description: "seconds to keep items in the bitbucket api cache (only used for bitbucket users)",
		Validate:    auconfigenv.ObtainUintRangeValidator(60, math.MaxUint32),
	},
	{
		Key:         config.KeyBitbucketReviewerFallback,
		EnvName:     config.KeyBitbucketReviewerFallback,
		Default:     "",
		Description: "default fallback reviewer username or groupname",
		Validate:    auconfigenv.ObtainNotEmptyValidator(),
	},
	{
		Key:         config.KeyGitCommitterName,
		EnvName:     config.KeyGitCommitterName,
		Default:     "",
		Description: "name to use for git commits",
		Validate:    auconfigenv.ObtainNotEmptyValidator(),
	},
	{
		Key:         config.KeyGitCommitterEmail,
		EnvName:     config.KeyGitCommitterEmail,
		Default:     "",
		Description: "email address to use for git commits",
		Validate:    auconfigenv.ObtainNotEmptyValidator(),
	},
	{
		Key:         config.KeyKafkaUsername,
		EnvName:     config.KeyKafkaUsername,
		Default:     "",
		Description: "optional: kafka username (needed to send kafka notifications), leaving this or any of the other *KAFKA* fields empty will switch off all Kafka functionality",
		Validate:    auconfigapi.ConfigNeedsNoValidation,
	},
	{
		Key:         config.KeyKafkaPassword,
		EnvName:     config.KeyKafkaPassword,
		Default:     "",
		Description: "optional: kafka password (needed to send kafka notifications), leaving this or any of the other *KAFKA* fields empty will switch off all Kafka functionality",
		Validate:    auconfigapi.ConfigNeedsNoValidation,
	},
	{
		Key:         config.KeyKafkaTopic,
		EnvName:     config.KeyKafkaTopic,
		Default:     "",
		Description: "optional: kafka topic (needed to send kafka notifications), leaving this or any of the other *KAFKA* fields empty will switch off all Kafka functionality",
		Validate:    auconfigenv.ObtainPatternValidator("^(|[a-z0-9-]+)$"),
	},
	{
		Key:         config.KeyKafkaSeedBrokers,
		EnvName:     config.KeyKafkaSeedBrokers,
		Default:     "",
		Description: "optional: comma separated list of kafka seed broker URLs (needed to send kafka notifications), leaving this or any of the other *KAFKA* fields empty will switch off all Kafka functionality",
		Validate:    auconfigenv.ObtainPatternValidator("^(|([a-z0-9-]+.[a-z0-9-]+.[a-z]{2,3}:9092)(,[a-z0-9-]+.[a-z0-9-]+.[a-z]{2,3}:9092)*)$"),
	},
	{
		Key:         config.KeyKafkaGroupIdOverride,
		EnvName:     config.KeyKafkaGroupIdOverride,
		Default:     "",
		Description: "optional: a kafka group id to use for subscribing to update events. Mainly useful on localhost. If empty, group id is derived from 3rd oktet of non-trivial local ip (as proxy for the k8s worker node)",
		Validate:    auconfigenv.ObtainPatternValidator("^(|[a-z0-9-]+)$"),
	},
	{
		Key:         config.KeyAuthOidcKeySetUrl,
		EnvName:     config.KeyAuthOidcKeySetUrl,
		Default:     "",
		Description: "keyset url of oidc identity provider",
		Validate:    auconfigenv.ObtainPatternValidator("^https?:.*$"),
	},
	{
		Key:         config.KeyAuthOidcTokenAudience,
		EnvName:     config.KeyAuthOidcTokenAudience,
		Default:     "",
		Description: "expected audience of oidc access token",
		Validate:    auconfigenv.ObtainNotEmptyValidator(),
	},
	{
		Key:         config.KeyAuthGroupWrite,
		EnvName:     config.KeyAuthGroupWrite,
		Default:     "",
		Description: "group name or id for write access to this service",
		Validate:    auconfigapi.ConfigNeedsNoValidation,
	},
	{
		Key:         config.KeyMetadataRepoUrl,
		EnvName:     config.KeyMetadataRepoUrl,
		Default:     "",
		Description: "git clone url for service-metadata repository",
		Validate:    auconfigenv.ObtainNotEmptyValidator(),
	},
	{
		Key:         config.KeyMetadataRepoMainline,
		EnvName:     config.KeyMetadataRepoMainline,
		Default:     "refs/heads/main",
		Description: "ref to use as mainline",
		Validate:    auconfigenv.ObtainNotEmptyValidator(),
	},
	{
		Key:         config.KeyUpdateJobIntervalMinutes,
		EnvName:     config.KeyUpdateJobIntervalMinutes,
		Default:     "5",
		Description: "time in minutes between cache update. Must be a divisor of 60 (used in cron expression) - pick one of the choices",
		Validate:    auconfigenv.ObtainPatternValidator("^(1|2|3|4|5|6|10|12|15|20|30)$"),
	},
	{
		Key:         config.KeyUpdateJobTimeoutSeconds,
		EnvName:     config.KeyUpdateJobTimeoutSeconds,
		Default:     "30",
		Description: "timeout for the cache update job in seconds. Must be less than 60 * UPDATE_JOB_INTERVAL_MINUTES",
		Validate:    auconfigenv.ObtainUintRangeValidator(10, 60),
	},
	{
		Key:      config.KeyAlertTargetPrefix,
		EnvName:  config.KeyAlertTargetPrefix,
		Default:  "",
		Validate: auconfigenv.ObtainPatternValidator("^((http|https)://|)[a-z0-9-.]+.[a-z]{2,3}/$"),
	},
	{
		Key:      config.KeyAlertTargetSuffix,
		EnvName:  config.KeyAlertTargetSuffix,
		Default:  "",
		Validate: auconfigenv.ObtainPatternValidator("^@[a-z0-9-]+.[a-z]{2,3}$"),
	},
	{
		Key:         config.KeyElasticApmDisabled,
		EnvName:     config.KeyElasticApmDisabled,
		Default:     "false",
		Description: "disable elastic apm middleware. supports all values supported by ParseBool (https://pkg.go.dev/strconv#ParseBool).",
		Validate:    auconfigenv.ObtainIsBooleanValidator(),
	},
	{
		Key:         config.KeyOwnerAliasPermittedRegex,
		EnvName:     config.KeyOwnerAliasPermittedRegex,
		Default:     "^[a-z](-?[a-z0-9]+)*$",
		Description: "regular expression to control the owner aliases that are permitted to be be created.",
		Validate:    auconfigenv.ObtainIsRegexValidator(),
	},
	{
		Key:         config.KeyOwnerAliasProhibitedRegex,
		EnvName:     config.KeyOwnerAliasProhibitedRegex,
		Default:     "^$",
		Description: "regular expression to control the owner aliases that are prohibited to be be created.",
		Validate:    auconfigenv.ObtainIsRegexValidator(),
	},
	{
		Key:         config.KeyOwnerAliasFilterRegex,
		EnvName:     config.KeyOwnerAliasFilterRegex,
		Default:     "^.*$",
		Description: "regular expression to filter owners based on their alias. Useful on localhost or for test instances to speed up service startup.",
		Validate:    auconfigenv.ObtainIsRegexValidator(),
	},
	{
		Key:         config.KeyOwnerAliasMaxLength,
		EnvName:     config.KeyOwnerAliasMaxLength,
		Default:     "28",
		Description: "maximum length of a valid owner alias.",
		Validate:    auconfigenv.ObtainIntRangeValidator(1, 100),
	},
	{
		Key:         config.KeyServiceNamePermittedRegex,
		EnvName:     config.KeyServiceNamePermittedRegex,
		Default:     "^[a-z](-?[a-z0-9]+)*$",
		Description: "regular expression to control the service names that are permitted to be be created.",
		Validate:    auconfigenv.ObtainIsRegexValidator(),
	},
	{
		Key:         config.KeyServiceNameProhibitedRegex,
		EnvName:     config.KeyServiceNameProhibitedRegex,
		Default:     "^$",
		Description: "regular expression to control the service names that are prohibited to be be created.",
		Validate:    auconfigenv.ObtainIsRegexValidator(),
	},
	{
		Key:         config.KeyServiceNameMaxLength,
		EnvName:     config.KeyServiceNameMaxLength,
		Default:     "28",
		Description: "maximum length of a valid service name.",
		Validate:    auconfigenv.ObtainIntRangeValidator(1, 100),
	},
	{
		Key:         config.KeyRepositoryNamePermittedRegex,
		EnvName:     config.KeyRepositoryNamePermittedRegex,
		Default:     "^[a-z](-?[a-z0-9]+)*$",
		Description: "regular expression to control the repository names that are permitted to be be created.",
		Validate:    auconfigenv.ObtainIsRegexValidator(),
	},
	{
		Key:         config.KeyRepositoryNameProhibitedRegex,
		EnvName:     config.KeyRepositoryNameProhibitedRegex,
		Default:     "^$",
		Description: "regular expression to control the repository names that are prohibited to be be created.",
		Validate:    auconfigenv.ObtainIsRegexValidator(),
	},
	{
		Key:         config.KeyRepositoryNameMaxLength,
		EnvName:     config.KeyRepositoryNameMaxLength,
		Default:     "64",
		Description: "maximum length of a valid repository name.",
		Validate:    auconfigenv.ObtainIntRangeValidator(1, 100),
	},
	{
		Key:         config.KeyRepositoryTypes,
		EnvName:     config.KeyRepositoryTypes,
		Default:     "",
		Description: "comma separated list of supported repository types.",
		Validate:    auconfigenv.ObtainPatternValidator("^|[a-z](-?[a-z0-9]+)*(,[a-z](-?[a-z0-9]+)*)*$"),
	},
	{
		Key:         config.KeyRepositoryKeySeparator,
		EnvName:     config.KeyRepositoryKeySeparator,
		Default:     ".",
		Description: "single character used to separate repository name from repository type. repository name and repository type must not contain separator.",
		Validate:    auconfigenv.ObtainSingleCharacterValidator(),
	},
	{
		Key:         config.KeyNotificationConsumerConfigs,
		EnvName:     config.KeyNotificationConsumerConfigs,
		Default:     "",
		Description: "configurations for consumers of change notifications.",
		Validate: func(key string) error {
			value := auconfigenv.Get(key)
			_, err := parseNotificationConsumerConfigs(value)
			return err
		},
	},
}

Functions

func New

func New() auacornapi.Acorn

Types

type CustomConfigImpl

type CustomConfigImpl struct {
	VBasicAuthUsername              string
	VBasicAuthPassword              string
	VSSHPrivateKey                  string
	VSSHPrivateKeyPassword          string
	VSSHMetadataRepoUrl             string
	VBitbucketUsername              string
	VBitbucketPassword              string
	VBitbucketServer                string
	VBitbucketCacheSize             int
	VBitbucketCacheRetentionSeconds uint32
	VBitbucketReviewerFallback      string
	VGitCommitterName               string
	VGitCommitterEmail              string
	VKafkaUsername                  string
	VKafkaPassword                  string
	VKafkaTopic                     string
	VKafkaSeedBrokers               string
	VAuthOidcKeySetUrl              string
	VAuthOidcTokenAudience          string
	VAuthGroupWrite                 string
	VKafkaGroupIdOverride           string
	VMetadataRepoUrl                string
	VMetadataRepoMainline           string
	VUpdateJobIntervalCronPart      string
	VUpdateJobTimeoutSeconds        uint16
	VAlertTargetPrefix              string
	VAlertTargetSuffix              string
	VElasticApmDisabled             bool
	VOwnerAliasPermittedRegex       *regexp.Regexp
	VOwnerAliasProhibitedRegex      *regexp.Regexp
	VOwnerAliasMaxLength            uint16
	VOwnerAliasFilterRegex          *regexp.Regexp
	VServiceNamePermittedRegex      *regexp.Regexp
	VServiceNameProhibitedRegex     *regexp.Regexp
	VServiceNameMaxLength           uint16
	VRepositoryNamePermittedRegex   *regexp.Regexp
	VRepositoryNameProhibitedRegex  *regexp.Regexp
	VRepositoryNameMaxLength        uint16
	VRepositoryTypes                string
	VRepositoryKeySeparator         string
	VNotificationConsumerConfigs    map[string]config.NotificationConsumerConfig
}

func (*CustomConfigImpl) AlertTargetPrefix

func (c *CustomConfigImpl) AlertTargetPrefix() string

func (*CustomConfigImpl) AlertTargetSuffix

func (c *CustomConfigImpl) AlertTargetSuffix() string

func (*CustomConfigImpl) AuthGroupWrite added in v0.13.0

func (c *CustomConfigImpl) AuthGroupWrite() string

func (*CustomConfigImpl) AuthOidcKeySetUrl added in v0.13.0

func (c *CustomConfigImpl) AuthOidcKeySetUrl() string

func (*CustomConfigImpl) AuthOidcTokenAudience added in v0.13.0

func (c *CustomConfigImpl) AuthOidcTokenAudience() string

func (*CustomConfigImpl) BasicAuthPassword added in v0.12.0

func (c *CustomConfigImpl) BasicAuthPassword() string

func (*CustomConfigImpl) BasicAuthUsername added in v0.12.0

func (c *CustomConfigImpl) BasicAuthUsername() string

func (*CustomConfigImpl) BitbucketCacheRetentionSeconds added in v0.16.0

func (c *CustomConfigImpl) BitbucketCacheRetentionSeconds() uint32

func (*CustomConfigImpl) BitbucketCacheSize added in v0.16.0

func (c *CustomConfigImpl) BitbucketCacheSize() int

func (*CustomConfigImpl) BitbucketPassword added in v0.12.0

func (c *CustomConfigImpl) BitbucketPassword() string

func (*CustomConfigImpl) BitbucketReviewerFallback added in v0.16.0

func (c *CustomConfigImpl) BitbucketReviewerFallback() string

func (*CustomConfigImpl) BitbucketServer added in v0.16.0

func (c *CustomConfigImpl) BitbucketServer() string

func (*CustomConfigImpl) BitbucketUsername added in v0.12.0

func (c *CustomConfigImpl) BitbucketUsername() string

func (*CustomConfigImpl) ElasticApmEnabled added in v0.5.0

func (c *CustomConfigImpl) ElasticApmEnabled() bool

func (*CustomConfigImpl) GitCommitterEmail

func (c *CustomConfigImpl) GitCommitterEmail() string

func (*CustomConfigImpl) GitCommitterName

func (c *CustomConfigImpl) GitCommitterName() string

func (*CustomConfigImpl) KafkaGroupIdOverride

func (c *CustomConfigImpl) KafkaGroupIdOverride() string

func (*CustomConfigImpl) KafkaPassword added in v0.12.0

func (c *CustomConfigImpl) KafkaPassword() string

func (*CustomConfigImpl) KafkaSeedBrokers

func (c *CustomConfigImpl) KafkaSeedBrokers() string

func (*CustomConfigImpl) KafkaTopic

func (c *CustomConfigImpl) KafkaTopic() string

func (*CustomConfigImpl) KafkaUsername added in v0.12.0

func (c *CustomConfigImpl) KafkaUsername() string

func (*CustomConfigImpl) MetadataRepoMainline added in v0.20.0

func (c *CustomConfigImpl) MetadataRepoMainline() string

func (*CustomConfigImpl) MetadataRepoUrl

func (c *CustomConfigImpl) MetadataRepoUrl() string

func (*CustomConfigImpl) NotificationConsumerConfigs added in v0.32.0

func (c *CustomConfigImpl) NotificationConsumerConfigs() map[string]config.NotificationConsumerConfig

func (*CustomConfigImpl) Obtain

func (c *CustomConfigImpl) Obtain(getter func(key string) string)

func (*CustomConfigImpl) OwnerAliasMaxLength added in v0.9.0

func (c *CustomConfigImpl) OwnerAliasMaxLength() uint16

func (*CustomConfigImpl) OwnerAliasPermittedRegex added in v0.9.0

func (c *CustomConfigImpl) OwnerAliasPermittedRegex() *regexp.Regexp

func (*CustomConfigImpl) OwnerAliasProhibitedRegex added in v0.9.0

func (c *CustomConfigImpl) OwnerAliasProhibitedRegex() *regexp.Regexp

func (*CustomConfigImpl) OwnerFilterAliasRegex added in v0.9.0

func (c *CustomConfigImpl) OwnerFilterAliasRegex() *regexp.Regexp

func (*CustomConfigImpl) RepositoryKeySeparator added in v0.9.0

func (c *CustomConfigImpl) RepositoryKeySeparator() string

func (*CustomConfigImpl) RepositoryNameMaxLength added in v0.9.0

func (c *CustomConfigImpl) RepositoryNameMaxLength() uint16

func (*CustomConfigImpl) RepositoryNamePermittedRegex added in v0.9.0

func (c *CustomConfigImpl) RepositoryNamePermittedRegex() *regexp.Regexp

func (*CustomConfigImpl) RepositoryNameProhibitedRegex added in v0.9.0

func (c *CustomConfigImpl) RepositoryNameProhibitedRegex() *regexp.Regexp

func (*CustomConfigImpl) RepositoryTypes added in v0.9.0

func (c *CustomConfigImpl) RepositoryTypes() []string

func (*CustomConfigImpl) SSHMetadataRepositoryUrl added in v0.23.0

func (c *CustomConfigImpl) SSHMetadataRepositoryUrl() string

func (*CustomConfigImpl) SSHPrivateKey added in v0.23.0

func (c *CustomConfigImpl) SSHPrivateKey() string

func (*CustomConfigImpl) SSHPrivateKeyPassword added in v0.23.0

func (c *CustomConfigImpl) SSHPrivateKeyPassword() string

func (*CustomConfigImpl) ServiceNameMaxLength added in v0.9.0

func (c *CustomConfigImpl) ServiceNameMaxLength() uint16

func (*CustomConfigImpl) ServiceNamePermittedRegex added in v0.9.0

func (c *CustomConfigImpl) ServiceNamePermittedRegex() *regexp.Regexp

func (*CustomConfigImpl) ServiceNameProhibitedRegex added in v0.9.0

func (c *CustomConfigImpl) ServiceNameProhibitedRegex() *regexp.Regexp

func (*CustomConfigImpl) UpdateJobIntervalCronPart

func (c *CustomConfigImpl) UpdateJobIntervalCronPart() string

func (*CustomConfigImpl) UpdateJobTimeoutSeconds

func (c *CustomConfigImpl) UpdateJobTimeoutSeconds() uint16

Jump to

Keyboard shortcuts

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