2021-01-04 13:52:13 +00:00
|
|
|
package domain
|
2020-12-11 14:49:19 +00:00
|
|
|
|
|
|
|
type SecondFactorType int32
|
|
|
|
|
|
|
|
const (
|
|
|
|
SecondFactorTypeUnspecified SecondFactorType = iota
|
|
|
|
SecondFactorTypeOTP
|
|
|
|
SecondFactorTypeU2F
|
2021-03-19 10:12:56 +00:00
|
|
|
|
|
|
|
secondFactorCount
|
2020-12-11 14:49:19 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type MultiFactorType int32
|
|
|
|
|
|
|
|
const (
|
|
|
|
MultiFactorTypeUnspecified MultiFactorType = iota
|
|
|
|
MultiFactorTypeU2FWithPIN
|
2021-03-19 10:12:56 +00:00
|
|
|
|
|
|
|
multiFactorCount
|
2020-12-11 14:49:19 +00:00
|
|
|
)
|
2021-01-07 15:06:45 +00:00
|
|
|
|
|
|
|
type FactorState int32
|
|
|
|
|
|
|
|
const (
|
|
|
|
FactorStateUnspecified FactorState = iota
|
|
|
|
FactorStateActive
|
|
|
|
FactorStateRemoved
|
|
|
|
|
|
|
|
factorStateCount
|
|
|
|
)
|
|
|
|
|
2021-03-19 10:12:56 +00:00
|
|
|
func (f SecondFactorType) Valid() bool {
|
|
|
|
return f > 0 && f < secondFactorCount
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f MultiFactorType) Valid() bool {
|
|
|
|
return f > 0 && f < multiFactorCount
|
|
|
|
}
|
|
|
|
|
2021-01-07 15:06:45 +00:00
|
|
|
func (f FactorState) Valid() bool {
|
|
|
|
return f >= 0 && f < factorStateCount
|
|
|
|
}
|