new pkg structure (#1150)

* fix: split command query side

* fix: split command query side

* fix: members in correct pkg structure

* fix: label policy in correct pkg structure

* fix: structure

* fix: structure of login policy

* fix: identityprovider structure

* fix: org iam policy structure

* fix: password age policy structure

* fix: password complexity policy structure

* fix: password lockout policy structure

* fix: idp structure

* fix: user events structure

* fix: user write model

* fix: profile email changed command

* fix: address changed command

* fix: user states

* fix: user

* fix: org structure and add human

* begin iam setup command side

* setup

* step2

* step2

* fix: add user

* step2

* isvalid

* fix: folder structure v2 business

Co-authored-by: Fabiennne <fabienne.gerschwiler@gmail.com>
This commit is contained in:
Livio Amstutz
2021-01-04 14:52:13 +01:00
committed by GitHub
parent 762941f0ea
commit 21ffe1b0cb
260 changed files with 7917 additions and 6570 deletions

View File

@@ -0,0 +1,16 @@
package domain
type SecondFactorType int32
const (
SecondFactorTypeUnspecified SecondFactorType = iota
SecondFactorTypeOTP
SecondFactorTypeU2F
)
type MultiFactorType int32
const (
MultiFactorTypeUnspecified MultiFactorType = iota
MultiFactorTypeU2FWithPIN
)

View File

@@ -0,0 +1,16 @@
package domain
type Gender int32
const (
GenderUnspecified Gender = iota
GenderFemale
GenderMale
GenderDiverse
genderCount
)
func (f Gender) Valid() bool {
return f >= 0 && f < genderCount
}

View File

@@ -0,0 +1,42 @@
package domain
type IDPConfigType int32
const (
IDPConfigTypeOIDC IDPConfigType = iota
IDPConfigTypeSAML
//count is for validation
idpConfigTypeCount
)
func (f IDPConfigType) Valid() bool {
return f >= 0 && f < idpConfigTypeCount
}
type IDPConfigState int32
const (
IDPConfigStateUnspecified IDPConfigState = iota
IDPConfigStateActive
IDPConfigStateInactive
IDPConfigStateRemoved
idpConfigStateCount
)
func (f IDPConfigState) Valid() bool {
return f >= 0 && f < idpConfigStateCount
}
type IDPConfigStylingType int32
const (
IDPConfigStylingTypeGoogle IDPConfigStylingType = iota + 1
idpConfigStylingTypeCount
)
func (f IDPConfigStylingType) Valid() bool {
return f >= 0 && f < idpConfigStylingTypeCount
}

View File

@@ -0,0 +1,14 @@
package domain
type MachineKeyType int32
const (
MachineKeyTypeNONE = iota
MachineKeyTypeJSON
keyCount
)
func (f MachineKeyType) Valid() bool {
return f >= 0 && f < keyCount
}

15
internal/v2/domain/mfa.go Normal file
View File

@@ -0,0 +1,15 @@
package domain
type MFAState int32
const (
MFAStateUnspecified MFAState = iota
MFAStateNotReady
MFAStateReady
stateCount
)
func (f MFAState) Valid() bool {
return f >= 0 && f < stateCount
}

View File

@@ -0,0 +1,14 @@
package domain
type NotificationType int32
const (
NotificationTypeEmail NotificationType = iota
NotificationTypeSms
notificationCount
)
func (f NotificationType) Valid() bool {
return f >= 0 && f < notificationCount
}

View File

@@ -0,0 +1,14 @@
package domain
type OIDCMappingField int32
const (
OIDCMappingFieldPreferredLoginName OIDCMappingField = iota + 1
OIDCMappingFieldEmail
// count is for validation purposes
oidcMappingFieldCount
)
func (f OIDCMappingField) Valid() bool {
return f > 0 && f < oidcMappingFieldCount
}

View File

@@ -0,0 +1,14 @@
package domain
type PasswordlessType int32
const (
PasswordlessTypeNotAllowed PasswordlessType = iota
PasswordlessTypeAllowed
passwordlessCount
)
func (f PasswordlessType) Valid() bool {
return f >= 0 && f < passwordlessCount
}

View File

@@ -0,0 +1,14 @@
package domain
type IdentityProviderType int8
const (
IdentityProviderTypeSystem IdentityProviderType = iota
IdentityProviderTypeOrg
identityProviderCount
)
func (f IdentityProviderType) Valid() bool {
return f >= 0 && f < identityProviderCount
}

View File

@@ -0,0 +1,16 @@
package domain
type Step int
const (
Step1 Step = iota + 1
Step2
Step3
Step4
Step5
Step6
Step7
Step8
//StepCount marks the the length of possible steps (StepCount-1 == last possible step)
StepCount
)

View File

@@ -0,0 +1,19 @@
package domain
type UserState int32
const (
UserStateUnspecified UserState = iota
UserStateActive
UserStateInactive
UserStateDeleted
UserStateLocked
UserStateSuspend
UserStateInitial
userStateCount
)
func (f UserState) Valid() bool {
return f >= 0 && f < userStateCount
}