2021-03-25 17:26:21 +01:00
|
|
|
package domain
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
es_models "github.com/caos/zitadel/internal/eventstore/v1/models"
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
FeatureLoginPolicy = "login_policy"
|
|
|
|
FeatureLoginPolicyFactors = FeatureLoginPolicy + ".factors"
|
|
|
|
FeatureLoginPolicyIDP = FeatureLoginPolicy + ".idp"
|
|
|
|
FeatureLoginPolicyPasswordless = FeatureLoginPolicy + ".passwordless"
|
|
|
|
FeatureLoginPolicyRegistration = FeatureLoginPolicy + ".registration"
|
|
|
|
FeatureLoginPolicyUsernameLogin = FeatureLoginPolicy + ".username_login"
|
|
|
|
FeaturePasswordComplexityPolicy = "password_complexity_policy"
|
|
|
|
FeatureLabelPolicy = "label_policy"
|
2021-04-19 16:43:36 +02:00
|
|
|
FeatureCustomDomain = "custom_domain"
|
2021-03-25 17:26:21 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type Features struct {
|
|
|
|
es_models.ObjectRoot
|
|
|
|
|
|
|
|
TierName string
|
|
|
|
TierDescription string
|
|
|
|
State FeaturesState
|
|
|
|
StateDescription string
|
|
|
|
IsDefault bool
|
|
|
|
|
|
|
|
AuditLogRetention time.Duration
|
|
|
|
LoginPolicyFactors bool
|
|
|
|
LoginPolicyIDP bool
|
|
|
|
LoginPolicyPasswordless bool
|
|
|
|
LoginPolicyRegistration bool
|
|
|
|
LoginPolicyUsernameLogin bool
|
|
|
|
PasswordComplexityPolicy bool
|
|
|
|
LabelPolicy bool
|
2021-04-19 16:43:36 +02:00
|
|
|
CustomDomain bool
|
2021-03-25 17:26:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type FeaturesState int32
|
|
|
|
|
|
|
|
const (
|
|
|
|
FeaturesStateUnspecified FeaturesState = iota
|
|
|
|
FeaturesStateActive
|
|
|
|
FeaturesStateActionRequired
|
|
|
|
FeaturesStateCanceled
|
|
|
|
FeaturesStateGrandfathered
|
|
|
|
FeaturesStateRemoved
|
|
|
|
|
|
|
|
featuresStateCount
|
|
|
|
)
|
|
|
|
|
|
|
|
func (f FeaturesState) Valid() bool {
|
|
|
|
return f >= 0 && f < featuresStateCount
|
|
|
|
}
|