mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-13 11:34:26 +00:00
c25d853820
* feat: add domain list * feat: domain tests * feat: add redirect url on adding instance domain * Update internal/command/instance_domain.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * feat: remove unused code * fix Co-authored-by: Livio Amstutz <livio.a@gmail.com>
28 lines
565 B
Go
28 lines
565 B
Go
package domain
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
type InstanceDomainState int32
|
|
|
|
const (
|
|
InstanceDomainStateUnspecified InstanceDomainState = iota
|
|
InstanceDomainStateActive
|
|
InstanceDomainStateRemoved
|
|
|
|
instanceDomainStateCount
|
|
)
|
|
|
|
func (f InstanceDomainState) Valid() bool {
|
|
return f >= 0 && f < instanceDomainStateCount
|
|
}
|
|
|
|
func (f InstanceDomainState) Exists() bool {
|
|
return f == InstanceDomainStateActive
|
|
}
|
|
|
|
func NewGeneratedInstanceDomain(instanceName, iamDomain string) string {
|
|
return strings.ToLower(strings.ReplaceAll(instanceName, " ", "-") + "." + iamDomain)
|
|
}
|