Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,14 @@ rateLimits:
# # path param is treated identically to a route declaring scope "ou"
# # with {ou}.
# orgUnitScope: "workspace"

# Experimental features — not yet generally available.
# When absent, all experimental features remain disabled.
#experimental:
# # Enable org-unit soft-delete. When false (default), delete requests
# # return 501 Unimplemented.
# allow_ou_delete: true
#
# # Seconds to retain a soft-deleted org unit before the reconciler
# # hard-deletes it. Only meaningful when allow_ou_delete is true.
# hold_deleted_ou: 3600
20 changes: 20 additions & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,20 @@ type ResourceAliasesConfig struct {
OrgUnitScope string `yaml:"orgUnitScope,omitempty"`
}

// ExperimentalConfig holds feature flags and settings for features
// that are not yet generally available. When absent from the config
// file, all experimental features remain disabled.
type ExperimentalConfig struct {
// AllowOUDelete enables the org-unit soft-delete feature.
// When false (default), delete requests return 501 Unimplemented.
AllowOUDelete bool `yaml:"allow_ou_delete"`

// HoldDeletedOU is the duration in seconds to retain a
// soft-deleted org unit before the reconciler hard-deletes it.
// Only meaningful when AllowOUDelete is true.
HoldDeletedOU int `yaml:"hold_deleted_ou"`
}

// Base config struct
type BaseConfig struct {
ConfigDB *MongoDB `yaml:"configDB,omitempty"`
Expand All @@ -90,6 +104,7 @@ type BaseConfig struct {
Cors CorsConfig `yaml:"cors,omitempty"`
RateLimits RateLimitsConfig `yaml:"rateLimits"`
ResourceAliases ResourceAliasesConfig `yaml:"resourceAliases,omitempty"`
Experimental ExperimentalConfig `yaml:"experimental,omitempty"`
}

// get Config database information, if the struct
Expand Down Expand Up @@ -159,6 +174,11 @@ func (c *BaseConfig) GetResourceAliases() ResourceAliasesConfig {
return c.ResourceAliases
}

// GetExperimental returns the experimental feature configuration.
func (c *BaseConfig) GetExperimental() ExperimentalConfig {
return c.Experimental
}

// Parse YAML Config file from the provided config file path
// returns pointer to config structure and error if failed to
// generate the config struct.
Expand Down
Loading