config

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: MIT Imports: 10 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.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.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.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.KeyAdditionalPromoters,
		EnvName:     config.KeyAdditionalPromoters,
		Default:     "",
		Description: "promoters to be added for all services. Can be left empty, or contain a comma separated list of usernames",
		Validate:    auconfigenv.ObtainPatternValidator("^|[a-z](-?[a-z0-9]+)*(,[a-z](-?[a-z0-9]+)*)*$"),
	},
	{
		Key:         config.KeyAdditionalPromotersFromOwners,
		EnvName:     config.KeyAdditionalPromotersFromOwners,
		Default:     "",
		Description: "owner aliases from which to get additional promoters to be added for all services. Can be left empty, or contain a comma separated list of owner aliases",
		Validate:    auconfigenv.ObtainPatternValidator("^|[a-z](-?[a-z0-9]+)*(,[a-z](-?[a-z0-9]+)*)*$"),
	},
	{
		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(),
	},
}

Functions

func New

func New() auacornapi.Acorn

Types

type CustomConfigImpl

type CustomConfigImpl struct {
	VBasicAuthUsername             string
	VBasicAuthPassword             string
	VBitbucketUsername             string
	VBitbucketPassword             string
	VGitCommitterName              string
	VGitCommitterEmail             string
	VKafkaUsername                 string
	VKafkaPassword                 string
	VKafkaTopic                    string
	VKafkaSeedBrokers              string
	VAuthOidcKeySetUrl             string
	VAuthOidcTokenAudience         string
	VAuthGroupWrite                string
	VKafkaGroupIdOverride          string
	VMetadataRepoUrl               string
	VUpdateJobIntervalCronPart     string
	VUpdateJobTimeoutSeconds       uint16
	VAlertTargetPrefix             string
	VAlertTargetSuffix             string
	VAdditionalPromoters           string
	VAdditionalPromotersFromOwners 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
}

func (*CustomConfigImpl) AdditionalPromoters added in v0.6.0

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

func (*CustomConfigImpl) AdditionalPromotersFromOwners added in v0.3.0

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

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) BitbucketPassword added in v0.12.0

func (c *CustomConfigImpl) BitbucketPassword() 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) MetadataRepoUrl

func (c *CustomConfigImpl) MetadataRepoUrl() string

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) 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