mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 19:14:23 +00:00
53 lines
979 B
Go
53 lines
979 B
Go
|
package domain
|
||
|
|
||
|
type FlowState int32
|
||
|
|
||
|
const (
|
||
|
FlowStateActive FlowState = iota
|
||
|
FlowStateInactive
|
||
|
flowStateCount
|
||
|
)
|
||
|
|
||
|
func (s FlowState) Valid() bool {
|
||
|
return s >= 0 && s < flowStateCount
|
||
|
}
|
||
|
|
||
|
type FlowType int32
|
||
|
|
||
|
const (
|
||
|
FlowTypeUnspecified FlowType = iota
|
||
|
FlowTypeExternalAuthentication
|
||
|
flowTypeCount
|
||
|
)
|
||
|
|
||
|
func (s FlowType) Valid() bool {
|
||
|
return s > 0 && s < flowTypeCount
|
||
|
}
|
||
|
|
||
|
func (s FlowType) HasTrigger(triggerType TriggerType) bool {
|
||
|
switch triggerType {
|
||
|
case TriggerTypePostAuthentication:
|
||
|
return s == FlowTypeExternalAuthentication
|
||
|
case TriggerTypePreCreation:
|
||
|
return s == FlowTypeExternalAuthentication
|
||
|
case TriggerTypePostCreation:
|
||
|
return s == FlowTypeExternalAuthentication
|
||
|
default:
|
||
|
return false
|
||
|
}
|
||
|
}
|
||
|
|
||
|
type TriggerType int32
|
||
|
|
||
|
const (
|
||
|
TriggerTypeUnspecified TriggerType = iota
|
||
|
TriggerTypePostAuthentication
|
||
|
TriggerTypePreCreation
|
||
|
TriggerTypePostCreation
|
||
|
triggerTypeCount
|
||
|
)
|
||
|
|
||
|
func (s TriggerType) Valid() bool {
|
||
|
return s >= 0 && s < triggerTypeCount
|
||
|
}
|