mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:37:32 +00:00
fix: add prompt on oidc rp, fix idp and login policy in console (#769)
* fix: add prompt on oidc rp * fix: add prompt on oidc rp * fix: translation * fix: translation * fix: not existing login policy * fix: login policy * fix: identity provider detail * fix: idp update * fix: idps in login policy * fix: lint * fix: scss * fix: external idps on auth user detail * fix: idp create mapping fields * fix: remove idp provider * fix: angular lint * fix: login policy view * fix: translations
This commit is contained in:
@@ -11,6 +11,7 @@ type IDPProviderView struct {
|
||||
IDPProviderType IDPProviderType
|
||||
Name string
|
||||
IDPConfigType IdpConfigType
|
||||
IDPState IDPConfigState
|
||||
|
||||
CreationDate time.Time
|
||||
ChangeDate time.Time
|
||||
@@ -31,6 +32,7 @@ const (
|
||||
IDPProviderSearchKeyUnspecified IDPProviderSearchKey = iota
|
||||
IDPProviderSearchKeyAggregateID
|
||||
IDPProviderSearchKeyIdpConfigID
|
||||
IDPProviderSearchKeyState
|
||||
)
|
||||
|
||||
type IDPProviderSearchQuery struct {
|
||||
|
@@ -38,7 +38,7 @@ func IDPProvidersByIdpConfigID(db *gorm.DB, table string, idpConfigID string) ([
|
||||
return providers, nil
|
||||
}
|
||||
|
||||
func IDPProvidersByAggregateID(db *gorm.DB, table string, aggregateID string) ([]*model.IDPProviderView, error) {
|
||||
func IDPProvidersByAggregateIDAndState(db *gorm.DB, table string, aggregateID string, idpConfigState iam_model.IDPConfigState) ([]*model.IDPProviderView, error) {
|
||||
providers := make([]*model.IDPProviderView, 0)
|
||||
queries := []*iam_model.IDPProviderSearchQuery{
|
||||
{
|
||||
@@ -46,6 +46,11 @@ func IDPProvidersByAggregateID(db *gorm.DB, table string, aggregateID string) ([
|
||||
Value: aggregateID,
|
||||
Method: global_model.SearchMethodEquals,
|
||||
},
|
||||
{
|
||||
Key: iam_model.IDPProviderSearchKeyState,
|
||||
Value: int(idpConfigState),
|
||||
Method: global_model.SearchMethodEquals,
|
||||
},
|
||||
}
|
||||
query := repository.PrepareSearchQuery(table, model.IDPProviderSearchRequest{Queries: queries})
|
||||
_, err := query(db, &providers)
|
||||
|
@@ -47,6 +47,7 @@ func IDPConfigViewFromModel(idp *model.IDPConfigView) *IDPConfigView {
|
||||
return &IDPConfigView{
|
||||
IDPConfigID: idp.IDPConfigID,
|
||||
AggregateID: idp.AggregateID,
|
||||
IDPState: int32(idp.State),
|
||||
Name: idp.Name,
|
||||
LogoSrc: idp.LogoSrc,
|
||||
Sequence: idp.Sequence,
|
||||
@@ -67,6 +68,7 @@ func IDPConfigViewToModel(idp *IDPConfigView) *model.IDPConfigView {
|
||||
return &model.IDPConfigView{
|
||||
IDPConfigID: idp.IDPConfigID,
|
||||
AggregateID: idp.AggregateID,
|
||||
State: model.IDPConfigState(idp.IDPState),
|
||||
Name: idp.Name,
|
||||
LogoSrc: idp.LogoSrc,
|
||||
Sequence: idp.Sequence,
|
||||
|
@@ -16,6 +16,7 @@ import (
|
||||
const (
|
||||
IDPProviderKeyAggregateID = "aggregate_id"
|
||||
IDPProviderKeyIdpConfigID = "idp_config_id"
|
||||
IDPProviderKeyState = "idp_state"
|
||||
)
|
||||
|
||||
type IDPProviderView struct {
|
||||
@@ -28,33 +29,36 @@ type IDPProviderView struct {
|
||||
Name string `json:"-" gorm:"column:name"`
|
||||
IDPConfigType int32 `json:"-" gorm:"column:idp_config_type"`
|
||||
IDPProviderType int32 `json:"idpProviderType" gorm:"column:idp_provider_type"`
|
||||
IDPState int32 `json:"-" gorm:"column:idp_state"`
|
||||
|
||||
Sequence uint64 `json:"-" gorm:"column:sequence"`
|
||||
}
|
||||
|
||||
func IDPProviderViewFromModel(policy *model.IDPProviderView) *IDPProviderView {
|
||||
func IDPProviderViewFromModel(provider *model.IDPProviderView) *IDPProviderView {
|
||||
return &IDPProviderView{
|
||||
AggregateID: policy.AggregateID,
|
||||
Sequence: policy.Sequence,
|
||||
CreationDate: policy.CreationDate,
|
||||
ChangeDate: policy.ChangeDate,
|
||||
Name: policy.Name,
|
||||
IDPConfigID: policy.IDPConfigID,
|
||||
IDPConfigType: int32(policy.IDPConfigType),
|
||||
IDPProviderType: int32(policy.IDPProviderType),
|
||||
AggregateID: provider.AggregateID,
|
||||
Sequence: provider.Sequence,
|
||||
CreationDate: provider.CreationDate,
|
||||
ChangeDate: provider.ChangeDate,
|
||||
Name: provider.Name,
|
||||
IDPConfigID: provider.IDPConfigID,
|
||||
IDPConfigType: int32(provider.IDPConfigType),
|
||||
IDPProviderType: int32(provider.IDPProviderType),
|
||||
IDPState: int32(provider.IDPState),
|
||||
}
|
||||
}
|
||||
|
||||
func IDPProviderViewToModel(policy *IDPProviderView) *model.IDPProviderView {
|
||||
func IDPProviderViewToModel(provider *IDPProviderView) *model.IDPProviderView {
|
||||
return &model.IDPProviderView{
|
||||
AggregateID: policy.AggregateID,
|
||||
Sequence: policy.Sequence,
|
||||
CreationDate: policy.CreationDate,
|
||||
ChangeDate: policy.ChangeDate,
|
||||
Name: policy.Name,
|
||||
IDPConfigID: policy.IDPConfigID,
|
||||
IDPConfigType: model.IdpConfigType(policy.IDPConfigType),
|
||||
IDPProviderType: model.IDPProviderType(policy.IDPProviderType),
|
||||
AggregateID: provider.AggregateID,
|
||||
Sequence: provider.Sequence,
|
||||
CreationDate: provider.CreationDate,
|
||||
ChangeDate: provider.ChangeDate,
|
||||
Name: provider.Name,
|
||||
IDPConfigID: provider.IDPConfigID,
|
||||
IDPConfigType: model.IdpConfigType(provider.IDPConfigType),
|
||||
IDPProviderType: model.IDPProviderType(provider.IDPProviderType),
|
||||
IDPState: model.IDPConfigState(provider.IDPState),
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -55,6 +55,8 @@ func (key IDPProviderSearchKey) ToColumnName() string {
|
||||
return IDPProviderKeyAggregateID
|
||||
case iam_model.IDPProviderSearchKeyIdpConfigID:
|
||||
return IDPProviderKeyIdpConfigID
|
||||
case iam_model.IDPProviderSearchKeyState:
|
||||
return IDPProviderKeyState
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
|
Reference in New Issue
Block a user