mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:37:32 +00:00
feat: Iam projection (#3074)
* feat: implement projection for iam and clean up code * feat: add migration * fix: remove unused tests * fix: handler
This commit is contained in:
@@ -24,45 +24,9 @@ const (
|
||||
|
||||
type IAM struct {
|
||||
es_models.ObjectRoot
|
||||
GlobalOrgID string
|
||||
IAMProjectID string
|
||||
SetUpDone domain.Step
|
||||
SetUpStarted domain.Step
|
||||
Members []*IAMMember
|
||||
IDPs []*IDPConfig
|
||||
DefaultLoginPolicy *LoginPolicy
|
||||
DefaultLabelPolicy *LabelPolicy
|
||||
DefaultOrgIAMPolicy *OrgIAMPolicy
|
||||
DefaultPasswordComplexityPolicy *PasswordComplexityPolicy
|
||||
DefaultPasswordAgePolicy *PasswordAgePolicy
|
||||
DefaultLockoutPolicy *LockoutPolicy
|
||||
DefaultMailTemplate *MailTemplate
|
||||
DefaultMailTexts []*MailText
|
||||
}
|
||||
|
||||
func (iam *IAM) GetMember(userID string) (int, *IAMMember) {
|
||||
for i, m := range iam.Members {
|
||||
if m.UserID == userID {
|
||||
return i, m
|
||||
}
|
||||
}
|
||||
return -1, nil
|
||||
}
|
||||
|
||||
func (iam *IAM) GetIDP(idpID string) (int, *IDPConfig) {
|
||||
for i, idp := range iam.IDPs {
|
||||
if idp.IDPConfigID == idpID {
|
||||
return i, idp
|
||||
}
|
||||
}
|
||||
return -1, nil
|
||||
}
|
||||
|
||||
func (iam *IAM) GetDefaultMailText(mailTextType string, language string) (int, *MailText) {
|
||||
for i, m := range iam.DefaultMailTexts {
|
||||
if m.MailTextType == mailTextType && m.Language == language {
|
||||
return i, m
|
||||
}
|
||||
}
|
||||
return -1, nil
|
||||
GlobalOrgID string
|
||||
IAMProjectID string
|
||||
SetUpDone domain.Step
|
||||
SetUpStarted domain.Step
|
||||
Members []*IAMMember
|
||||
}
|
||||
|
Reference in New Issue
Block a user