mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-15 00:27:35 +00:00
feat: features (#1427)
* features * features * features * fix json tags * add features handler to auth * mocks for tests * add setup step * fixes * add featurelist to auth api * grandfather state and typos * typo * merge new-eventstore * fix login policy tests * label policy in features * audit log retention
This commit is contained in:
54
internal/domain/features.go
Normal file
54
internal/domain/features.go
Normal file
@@ -0,0 +1,54 @@
|
||||
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"
|
||||
)
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
type FeaturesState int32
|
||||
|
||||
const (
|
||||
FeaturesStateUnspecified FeaturesState = iota
|
||||
FeaturesStateActive
|
||||
FeaturesStateActionRequired
|
||||
FeaturesStateCanceled
|
||||
FeaturesStateGrandfathered
|
||||
FeaturesStateRemoved
|
||||
|
||||
featuresStateCount
|
||||
)
|
||||
|
||||
func (f FeaturesState) Valid() bool {
|
||||
return f >= 0 && f < featuresStateCount
|
||||
}
|
Reference in New Issue
Block a user