-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathauthentication_method_feature.go
45 lines (43 loc) · 1.61 KB
/
authentication_method_feature.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package models
type AuthenticationMethodFeature int
const (
SSPRREGISTERED_AUTHENTICATIONMETHODFEATURE AuthenticationMethodFeature = iota
SSPRENABLED_AUTHENTICATIONMETHODFEATURE
SSPRCAPABLE_AUTHENTICATIONMETHODFEATURE
PASSWORDLESSCAPABLE_AUTHENTICATIONMETHODFEATURE
MFACAPABLE_AUTHENTICATIONMETHODFEATURE
UNKNOWNFUTUREVALUE_AUTHENTICATIONMETHODFEATURE
)
func (i AuthenticationMethodFeature) String() string {
return []string{"ssprRegistered", "ssprEnabled", "ssprCapable", "passwordlessCapable", "mfaCapable", "unknownFutureValue"}[i]
}
func ParseAuthenticationMethodFeature(v string) (any, error) {
result := SSPRREGISTERED_AUTHENTICATIONMETHODFEATURE
switch v {
case "ssprRegistered":
result = SSPRREGISTERED_AUTHENTICATIONMETHODFEATURE
case "ssprEnabled":
result = SSPRENABLED_AUTHENTICATIONMETHODFEATURE
case "ssprCapable":
result = SSPRCAPABLE_AUTHENTICATIONMETHODFEATURE
case "passwordlessCapable":
result = PASSWORDLESSCAPABLE_AUTHENTICATIONMETHODFEATURE
case "mfaCapable":
result = MFACAPABLE_AUTHENTICATIONMETHODFEATURE
case "unknownFutureValue":
result = UNKNOWNFUTUREVALUE_AUTHENTICATIONMETHODFEATURE
default:
return nil, nil
}
return &result, nil
}
func SerializeAuthenticationMethodFeature(values []AuthenticationMethodFeature) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i AuthenticationMethodFeature) isMultiValue() bool {
return false
}