-
Notifications
You must be signed in to change notification settings - Fork 461
/
features.go
76 lines (66 loc) · 2.34 KB
/
features.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package domain
import (
"time"
es_models "github.com/zitadel/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"
FeatureLoginPolicyPasswordReset = FeatureLoginPolicy + ".password_reset"
FeaturePasswordComplexityPolicy = "password_complexity_policy"
FeatureLabelPolicy = "label_policy"
FeatureLabelPolicyPrivateLabel = FeatureLabelPolicy + ".private_label"
FeatureLabelPolicyWatermark = FeatureLabelPolicy + ".watermark"
FeatureCustomDomain = "custom_domain"
FeaturePrivacyPolicy = "privacy_policy"
FeatureLockoutPolicy = "lockout_policy"
FeatureMetadata = "metadata"
FeatureCustomText = "custom_text"
FeatureCustomTextMessage = FeatureCustomText + ".message"
FeatureCustomTextLogin = FeatureCustomText + ".login"
FeatureMetadataUser = FeatureMetadata + ".user"
FeatureActions = "actions"
)
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
LoginPolicyPasswordReset bool
PasswordComplexityPolicy bool
LabelPolicyPrivateLabel bool
LabelPolicyWatermark bool
CustomDomain bool
CustomTextMessage bool
CustomTextLogin bool
PrivacyPolicy bool
MetadataUser bool
LockoutPolicy bool
ActionsAllowed ActionsAllowed
MaxActions int
}
type FeaturesState int32
const (
FeaturesStateUnspecified FeaturesState = iota
FeaturesStateActive
FeaturesStateActionRequired
FeaturesStateCanceled
FeaturesStateGrandfathered
FeaturesStateRemoved
featuresStateCount
)
func (f FeaturesState) Valid() bool {
return f >= 0 && f < featuresStateCount
}