mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-18 00:42:29 +00:00
new iam repo in all services
This commit is contained in:
@@ -4,19 +4,13 @@ import (
|
||||
"context"
|
||||
|
||||
iam_model "github.com/caos/zitadel/internal/iam/model"
|
||||
"github.com/caos/zitadel/internal/iam/repository/eventsourcing"
|
||||
iam_business "github.com/caos/zitadel/internal/v2/business/iam"
|
||||
)
|
||||
|
||||
type IAMRepository struct {
|
||||
IAMEvents *eventsourcing.IAMEventstore
|
||||
|
||||
IAMV2 *iam_business.Repository
|
||||
}
|
||||
|
||||
func (repo *IAMRepository) IAMByID(ctx context.Context, id string) (*iam_model.IAM, error) {
|
||||
if repo.IAMV2 != nil {
|
||||
return repo.IAMV2.IAMByID(ctx, id)
|
||||
}
|
||||
return repo.IAMEvents.IAMByID(ctx, id)
|
||||
return repo.IAMV2.IAMByID(ctx, id)
|
||||
}
|
||||
|
@@ -115,8 +115,7 @@ func Start(conf Config, systemDefaults sd.SystemDefaults, roles []string) (*EsRe
|
||||
UserRepo: eventstore.UserRepo{es, conf.SearchLimit, user, org, usergrant, view, systemDefaults},
|
||||
UserGrantRepo: eventstore.UserGrantRepo{conf.SearchLimit, usergrant, view},
|
||||
IAMRepository: eventstore.IAMRepository{
|
||||
IAMEvents: iam,
|
||||
IAMV2: iam_business.StartRepository(&iam_business.Config{Eventstore: esV2}),
|
||||
IAMV2: iam_business.StartRepository(&iam_business.Config{Eventstore: esV2}),
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user