mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 01:37:31 +00:00
feat: Check zitadel project (#191)
* feat: check if zitadel project is changed * feat: check if zitadel project is changed
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package eventstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
iam_model "github.com/caos/zitadel/internal/iam/model"
|
||||
"github.com/caos/zitadel/internal/iam/repository/eventsourcing"
|
||||
)
|
||||
|
||||
type IamRepository struct {
|
||||
IamEvents *eventsourcing.IamEventstore
|
||||
}
|
||||
|
||||
func (repo *IamRepository) IamByID(ctx context.Context, id string) (*iam_model.Iam, error) {
|
||||
return repo.IamEvents.IamByID(ctx, id)
|
||||
}
|
@@ -2,6 +2,7 @@ package eventsourcing
|
||||
|
||||
import (
|
||||
"context"
|
||||
es_iam "github.com/caos/zitadel/internal/iam/repository/eventsourcing"
|
||||
|
||||
sd "github.com/caos/zitadel/internal/config/systemdefaults"
|
||||
"github.com/caos/zitadel/internal/config/types"
|
||||
@@ -32,6 +33,7 @@ type EsRepository struct {
|
||||
eventstore.UserRepo
|
||||
eventstore.UserGrantRepo
|
||||
eventstore.PolicyRepo
|
||||
eventstore.IamRepository
|
||||
}
|
||||
|
||||
func Start(conf Config, systemDefaults sd.SystemDefaults, roles []string) (*EsRepository, error) {
|
||||
@@ -78,6 +80,13 @@ func Start(conf Config, systemDefaults sd.SystemDefaults, roles []string) (*EsRe
|
||||
return nil, err
|
||||
}
|
||||
org := es_org.StartOrg(es_org.OrgConfig{Eventstore: es})
|
||||
iam, err := es_iam.StartIam(es_iam.IamConfig{
|
||||
Eventstore: es,
|
||||
Cache: conf.Eventstore.Cache,
|
||||
}, systemDefaults)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
eventstoreRepos := handler.EventstoreRepos{ProjectEvents: project, UserEvents: user, OrgEvents: org}
|
||||
spool := spooler.StartSpooler(conf.Spooler, es, view, sqlClient, eventstoreRepos)
|
||||
@@ -89,6 +98,7 @@ func Start(conf Config, systemDefaults sd.SystemDefaults, roles []string) (*EsRe
|
||||
UserRepo: eventstore.UserRepo{conf.SearchLimit, user, policy, view},
|
||||
UserGrantRepo: eventstore.UserGrantRepo{conf.SearchLimit, usergrant, view},
|
||||
PolicyRepo: eventstore.PolicyRepo{policy},
|
||||
IamRepository: eventstore.IamRepository{iam},
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
10
internal/management/repository/iam.go
Normal file
10
internal/management/repository/iam.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package repository
|
||||
|
||||
import (
|
||||
"context"
|
||||
iam_model "github.com/caos/zitadel/internal/iam/model"
|
||||
)
|
||||
|
||||
type IamRepository interface {
|
||||
IamByID(ctx context.Context, id string) (*iam_model.Iam, error)
|
||||
}
|
@@ -7,4 +7,5 @@ type Repository interface {
|
||||
OrgRepository
|
||||
UserRepository
|
||||
UserGrantRepository
|
||||
IamRepository
|
||||
}
|
||||
|
Reference in New Issue
Block a user