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