mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 18:17:35 +00:00
feat(login): use new IDP templates (#5315)
The login uses the new template based IDPs with backwards compatibility for old IDPs
This commit is contained in:
@@ -68,65 +68,3 @@ func (r *IDPProviderSearchRequest) EnsureLimit(limit uint64) error {
|
||||
func (r *IDPProviderSearchRequest) AppendAggregateIDQuery(aggregateID string) {
|
||||
r.Queries = append(r.Queries, &IDPProviderSearchQuery{Key: IDPProviderSearchKeyAggregateID, Method: domain.SearchMethodEquals, Value: aggregateID})
|
||||
}
|
||||
|
||||
func IdpProviderViewsToDomain(idpProviders []*IDPProviderView) []*domain.IDPProvider {
|
||||
providers := make([]*domain.IDPProvider, len(idpProviders))
|
||||
for i, provider := range idpProviders {
|
||||
p := &domain.IDPProvider{
|
||||
IDPConfigID: provider.IDPConfigID,
|
||||
Type: idpProviderTypeToDomain(provider.IDPProviderType),
|
||||
Name: provider.Name,
|
||||
IDPConfigType: idpConfigTypeToDomain(provider.IDPConfigType),
|
||||
StylingType: idpStylingTypeToDomain(provider.StylingType),
|
||||
IDPState: idpStateToDomain(provider.IDPState),
|
||||
}
|
||||
providers[i] = p
|
||||
}
|
||||
return providers
|
||||
}
|
||||
|
||||
func idpProviderTypeToDomain(idpType IDPProviderType) domain.IdentityProviderType {
|
||||
switch idpType {
|
||||
case IDPProviderTypeSystem:
|
||||
return domain.IdentityProviderTypeSystem
|
||||
case IDPProviderTypeOrg:
|
||||
return domain.IdentityProviderTypeOrg
|
||||
default:
|
||||
return domain.IdentityProviderTypeSystem
|
||||
}
|
||||
}
|
||||
|
||||
func idpConfigTypeToDomain(idpType IdpConfigType) domain.IDPConfigType {
|
||||
switch idpType {
|
||||
case IDPConfigTypeOIDC:
|
||||
return domain.IDPConfigTypeOIDC
|
||||
case IDPConfigTypeSAML:
|
||||
return domain.IDPConfigTypeSAML
|
||||
case IDPConfigTypeJWT:
|
||||
return domain.IDPConfigTypeJWT
|
||||
default:
|
||||
return domain.IDPConfigTypeOIDC
|
||||
}
|
||||
}
|
||||
|
||||
func idpStylingTypeToDomain(stylingType IDPStylingType) domain.IDPConfigStylingType {
|
||||
switch stylingType {
|
||||
case IDPStylingTypeGoogle:
|
||||
return domain.IDPConfigStylingTypeGoogle
|
||||
default:
|
||||
return domain.IDPConfigStylingTypeUnspecified
|
||||
}
|
||||
}
|
||||
|
||||
func idpStateToDomain(state IDPConfigState) domain.IDPConfigState {
|
||||
switch state {
|
||||
case IDPConfigStateActive:
|
||||
return domain.IDPConfigStateActive
|
||||
case IDPConfigStateInactive:
|
||||
return domain.IDPConfigStateInactive
|
||||
case IDPConfigStateRemoved:
|
||||
return domain.IDPConfigStateRemoved
|
||||
default:
|
||||
return domain.IDPConfigStateActive
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user