mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 11:04:25 +00:00
dc56e298ae
* fix: use domain models for v2 eventstore * fix: user domain model * Update internal/api/grpc/admin/login_policy_converter.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * fix: converter Co-authored-by: Livio Amstutz <livio.a@gmail.com>
92 lines
1.9 KiB
Go
92 lines
1.9 KiB
Go
package domain
|
|
|
|
import (
|
|
"github.com/caos/zitadel/internal/crypto"
|
|
es_models "github.com/caos/zitadel/internal/eventstore/models"
|
|
"time"
|
|
)
|
|
|
|
type IDPConfig struct {
|
|
es_models.ObjectRoot
|
|
IDPConfigID string
|
|
Type IDPConfigType
|
|
Name string
|
|
StylingType IDPConfigStylingType
|
|
State IDPConfigState
|
|
OIDCConfig *OIDCIDPConfig
|
|
}
|
|
|
|
type IDPConfigView struct {
|
|
AggregateID string
|
|
IDPConfigID string
|
|
Name string
|
|
StylingType IDPConfigStylingType
|
|
State IDPConfigState
|
|
CreationDate time.Time
|
|
ChangeDate time.Time
|
|
Sequence uint64
|
|
IDPProviderType IdentityProviderType
|
|
|
|
IsOIDC bool
|
|
OIDCClientID string
|
|
OIDCClientSecret *crypto.CryptoValue
|
|
OIDCIssuer string
|
|
OIDCScopes []string
|
|
OIDCIDPDisplayNameMapping OIDCMappingField
|
|
OIDCUsernameMapping OIDCMappingField
|
|
}
|
|
|
|
type OIDCIDPConfig struct {
|
|
es_models.ObjectRoot
|
|
IDPConfigID string
|
|
ClientID string
|
|
ClientSecret *crypto.CryptoValue
|
|
ClientSecretString string
|
|
Issuer string
|
|
Scopes []string
|
|
IDPDisplayNameMapping OIDCMappingField
|
|
UsernameMapping OIDCMappingField
|
|
}
|
|
|
|
type IDPConfigType int32
|
|
|
|
const (
|
|
IDPConfigTypeOIDC IDPConfigType = iota
|
|
IDPConfigTypeSAML
|
|
|
|
//count is for validation
|
|
idpConfigTypeCount
|
|
)
|
|
|
|
func (f IDPConfigType) Valid() bool {
|
|
return f >= 0 && f < idpConfigTypeCount
|
|
}
|
|
|
|
type IDPConfigState int32
|
|
|
|
const (
|
|
IDPConfigStateUnspecified IDPConfigState = iota
|
|
IDPConfigStateActive
|
|
IDPConfigStateInactive
|
|
IDPConfigStateRemoved
|
|
|
|
idpConfigStateCount
|
|
)
|
|
|
|
func (f IDPConfigState) Valid() bool {
|
|
return f >= 0 && f < idpConfigStateCount
|
|
}
|
|
|
|
type IDPConfigStylingType int32
|
|
|
|
const (
|
|
IDPConfigStylingTypeUnspecified IDPConfigStylingType = iota
|
|
IDPConfigStylingTypeGoogle
|
|
|
|
idpConfigStylingTypeCount
|
|
)
|
|
|
|
func (f IDPConfigStylingType) Valid() bool {
|
|
return f >= 0 && f < idpConfigStylingTypeCount
|
|
}
|