mirror of
https://github.com/zitadel/zitadel.git
synced 2025-03-01 00:47:23 +00:00

* Label Policy added * save * chore: update docs action * Save * Save * Get colors from DB * Variables inserted * Get images from global directory. * Add tests * Add tests * Corrections from mergerequest * Corrections from mergerequest * Test corrected. * Added colors to all notifications. * Added colors to Corrected text and formatting.all notifications. * Spelling error corrected. * fix: tests * Merge Branch corrected. * Step6 added * Corrections from mergerequest * fix: generate management * Formatted texts. * fix: migrations Co-authored-by: Florian Forster <florian@caos.ch> Co-authored-by: adlerhurst <silvan.reusser@gmail.com> Co-authored-by: Fabiennne <fabienne.gerschwiler@gmail.com>
53 lines
1.2 KiB
Go
53 lines
1.2 KiB
Go
package model
|
|
|
|
import (
|
|
es_models "github.com/caos/zitadel/internal/eventstore/models"
|
|
)
|
|
|
|
type Step int
|
|
|
|
const (
|
|
Step1 Step = iota + 1
|
|
Step2
|
|
Step3
|
|
Step4
|
|
Step5
|
|
Step6
|
|
//StepCount marks the the length of possible steps (StepCount-1 == last possible step)
|
|
StepCount
|
|
)
|
|
|
|
type IAM struct {
|
|
es_models.ObjectRoot
|
|
GlobalOrgID string
|
|
IAMProjectID string
|
|
SetUpDone Step
|
|
SetUpStarted Step
|
|
Members []*IAMMember
|
|
IDPs []*IDPConfig
|
|
DefaultLoginPolicy *LoginPolicy
|
|
DefaultLabelPolicy *LabelPolicy
|
|
DefaultOrgIAMPolicy *OrgIAMPolicy
|
|
DefaultPasswordComplexityPolicy *PasswordComplexityPolicy
|
|
DefaultPasswordAgePolicy *PasswordAgePolicy
|
|
DefaultPasswordLockoutPolicy *PasswordLockoutPolicy
|
|
}
|
|
|
|
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
|
|
}
|