2023-02-15 08:14:59 +00:00
|
|
|
package domain
|
|
|
|
|
|
|
|
type IDPState int32
|
|
|
|
|
|
|
|
const (
|
|
|
|
IDPStateUnspecified IDPState = iota
|
|
|
|
IDPStateActive
|
|
|
|
IDPStateInactive
|
|
|
|
IDPStateRemoved
|
|
|
|
|
|
|
|
idpStateCount
|
|
|
|
)
|
|
|
|
|
|
|
|
func (s IDPState) Valid() bool {
|
|
|
|
return s >= 0 && s < idpStateCount
|
|
|
|
}
|
|
|
|
|
|
|
|
func (s IDPState) Exists() bool {
|
|
|
|
return s != IDPStateUnspecified && s != IDPStateRemoved
|
|
|
|
}
|
|
|
|
|
|
|
|
type IDPType int32
|
|
|
|
|
|
|
|
const (
|
|
|
|
IDPTypeUnspecified IDPType = iota
|
|
|
|
IDPTypeOIDC
|
|
|
|
IDPTypeJWT
|
|
|
|
IDPTypeOAuth
|
|
|
|
IDPTypeLDAP
|
|
|
|
IDPTypeAzureAD
|
|
|
|
IDPTypeGitHub
|
|
|
|
IDPTypeGitHubEE
|
|
|
|
IDPTypeGitLab
|
|
|
|
IDPTypeGitLabSelfHosted
|
|
|
|
IDPTypeGoogle
|
|
|
|
)
|
2023-02-28 20:20:58 +00:00
|
|
|
|
|
|
|
func (t IDPType) GetCSSClass() string {
|
|
|
|
switch t { //nolint:exhaustive
|
|
|
|
case IDPTypeGoogle:
|
|
|
|
return "google"
|
|
|
|
default:
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
}
|