mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 07:47:32 +00:00
fix: change to repository event types and removed unused code (#3386)
* fix: change to repository event types and removed unused code * some fixes * remove unused code
This commit is contained in:
@@ -2,10 +2,11 @@ package model
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/caos/logging"
|
||||
|
||||
caos_errs "github.com/caos/zitadel/internal/errors"
|
||||
es_models "github.com/caos/zitadel/internal/eventstore/v1/models"
|
||||
"github.com/caos/zitadel/internal/user/model"
|
||||
)
|
||||
|
||||
type ExternalIDP struct {
|
||||
@@ -24,43 +25,6 @@ func GetExternalIDP(idps []*ExternalIDP, id string) (int, *ExternalIDP) {
|
||||
}
|
||||
return -1, nil
|
||||
}
|
||||
|
||||
func ExternalIDPsToModel(externalIDPs []*ExternalIDP) []*model.ExternalIDP {
|
||||
convertedIDPs := make([]*model.ExternalIDP, len(externalIDPs))
|
||||
for i, m := range externalIDPs {
|
||||
convertedIDPs[i] = ExternalIDPToModel(m)
|
||||
}
|
||||
return convertedIDPs
|
||||
}
|
||||
|
||||
func ExternalIDPsFromModel(externalIDPs []*model.ExternalIDP) []*ExternalIDP {
|
||||
convertedIDPs := make([]*ExternalIDP, len(externalIDPs))
|
||||
for i, m := range externalIDPs {
|
||||
convertedIDPs[i] = ExternalIDPFromModel(m)
|
||||
}
|
||||
return convertedIDPs
|
||||
}
|
||||
|
||||
func ExternalIDPFromModel(idp *model.ExternalIDP) *ExternalIDP {
|
||||
if idp == nil {
|
||||
return nil
|
||||
}
|
||||
return &ExternalIDP{
|
||||
ObjectRoot: idp.ObjectRoot,
|
||||
IDPConfigID: idp.IDPConfigID,
|
||||
UserID: idp.UserID,
|
||||
DisplayName: idp.DisplayName,
|
||||
}
|
||||
}
|
||||
|
||||
func ExternalIDPToModel(idp *ExternalIDP) *model.ExternalIDP {
|
||||
return &model.ExternalIDP{
|
||||
ObjectRoot: idp.ObjectRoot,
|
||||
IDPConfigID: idp.IDPConfigID,
|
||||
UserID: idp.UserID,
|
||||
}
|
||||
}
|
||||
|
||||
func (u *Human) appendExternalIDPAddedEvent(event *es_models.Event) error {
|
||||
idp := new(ExternalIDP)
|
||||
err := idp.setData(event)
|
||||
|
Reference in New Issue
Block a user