2021-01-08 11:33:45 +01:00
|
|
|
package domain
|
|
|
|
|
|
|
|
import (
|
2021-02-23 15:13:04 +01:00
|
|
|
"github.com/caos/zitadel/internal/eventstore/v1/models"
|
2021-01-08 11:33:45 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type Org struct {
|
|
|
|
models.ObjectRoot
|
|
|
|
|
|
|
|
State OrgState
|
|
|
|
Name string
|
|
|
|
|
2021-01-15 09:32:59 +01:00
|
|
|
PrimaryDomain string
|
2021-01-08 11:33:45 +01:00
|
|
|
Domains []*OrgDomain
|
|
|
|
Members []*Member
|
|
|
|
OrgIamPolicy *OrgIAMPolicy
|
|
|
|
LoginPolicy *LoginPolicy
|
|
|
|
LabelPolicy *LabelPolicy
|
|
|
|
PasswordComplexityPolicy *PasswordComplexityPolicy
|
|
|
|
PasswordAgePolicy *PasswordAgePolicy
|
|
|
|
PasswordLockoutPolicy *PasswordLockoutPolicy
|
|
|
|
IDPs []*IDPConfig
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *Org) IsValid() bool {
|
|
|
|
return o.Name != ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (o *Org) AddIAMDomain(iamDomain string) {
|
2021-04-19 16:43:36 +02:00
|
|
|
o.Domains = append(o.Domains, &OrgDomain{Domain: NewIAMDomainName(o.Name, iamDomain), Verified: true, Primary: true})
|
2021-01-08 11:33:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type OrgState int32
|
|
|
|
|
|
|
|
const (
|
2021-01-15 09:32:59 +01:00
|
|
|
OrgStateUnspecified OrgState = iota
|
|
|
|
OrgStateActive
|
2021-01-08 11:33:45 +01:00
|
|
|
OrgStateInactive
|
2021-01-18 11:24:15 +01:00
|
|
|
OrgStateRemoved
|
2021-01-08 11:33:45 +01:00
|
|
|
)
|