mirror of
https://github.com/zitadel/zitadel.git
synced 2025-10-16 12:40:20 +00:00
feat: iam query (#3085)
* fix: only show factors with state ready * fix: get iam by id and clean up code * fix: get iam by id and clean up code * fix: remove unused code
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
package eventstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
iam_model "github.com/caos/zitadel/internal/iam/model"
|
||||
"github.com/caos/zitadel/internal/query"
|
||||
)
|
||||
|
||||
type IAMRepository struct {
|
||||
IAMV2Query *query.Queries
|
||||
}
|
||||
|
||||
func (repo *IAMRepository) IAMByID(ctx context.Context, id string) (*iam_model.IAM, error) {
|
||||
return repo.IAMV2Query.IAMByID(ctx, id)
|
||||
}
|
@@ -16,7 +16,6 @@ import (
|
||||
"github.com/caos/zitadel/internal/domain"
|
||||
"github.com/caos/zitadel/internal/errors"
|
||||
v1 "github.com/caos/zitadel/internal/eventstore/v1"
|
||||
"github.com/caos/zitadel/internal/i18n"
|
||||
org_model "github.com/caos/zitadel/internal/org/model"
|
||||
org_es_model "github.com/caos/zitadel/internal/org/repository/eventsourcing/model"
|
||||
org_view "github.com/caos/zitadel/internal/org/repository/view"
|
||||
@@ -38,18 +37,6 @@ type OrgRepository struct {
|
||||
supportedLangs []language.Tag
|
||||
}
|
||||
|
||||
func (repo *OrgRepository) Languages(ctx context.Context) ([]language.Tag, error) {
|
||||
if len(repo.supportedLangs) == 0 {
|
||||
langs, err := i18n.SupportedLanguages(repo.LoginDir)
|
||||
if err != nil {
|
||||
logging.Log("ADMIN-tiMWs").WithError(err).Debug("unable to parse language")
|
||||
return nil, err
|
||||
}
|
||||
repo.supportedLangs = langs
|
||||
}
|
||||
return repo.supportedLangs, nil
|
||||
}
|
||||
|
||||
func (repo *OrgRepository) OrgChanges(ctx context.Context, id string, lastSequence uint64, limit uint64, sortAscending bool, auditLogRetention time.Duration) (*org_model.OrgChanges, error) {
|
||||
changes, err := repo.getOrgChanges(ctx, id, lastSequence, limit, sortAscending, auditLogRetention)
|
||||
if err != nil {
|
||||
|
@@ -24,7 +24,6 @@ type EsRepository struct {
|
||||
eventstore.OrgRepository
|
||||
eventstore.ProjectRepo
|
||||
eventstore.UserRepo
|
||||
eventstore.IAMRepository
|
||||
}
|
||||
|
||||
func Start(conf Config, systemDefaults sd.SystemDefaults, roles []string, queries *query.Queries, staticStorage static.Storage) (*EsRepository, error) {
|
||||
@@ -55,8 +54,7 @@ func Start(conf Config, systemDefaults sd.SystemDefaults, roles []string, querie
|
||||
NotificationTranslationFileContents: make(map[string][]byte),
|
||||
Query: queries,
|
||||
},
|
||||
ProjectRepo: eventstore.ProjectRepo{es, roles, systemDefaults.IamID, assetsAPI, queries},
|
||||
UserRepo: eventstore.UserRepo{es, queries, systemDefaults, assetsAPI},
|
||||
IAMRepository: eventstore.IAMRepository{IAMV2Query: queries},
|
||||
ProjectRepo: eventstore.ProjectRepo{es, roles, systemDefaults.IamID, assetsAPI, queries},
|
||||
UserRepo: eventstore.UserRepo{es, queries, systemDefaults, assetsAPI},
|
||||
}, nil
|
||||
}
|
||||
|
@@ -1,10 +0,0 @@
|
||||
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)
|
||||
}
|
@@ -4,13 +4,10 @@ import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"golang.org/x/text/language"
|
||||
|
||||
org_model "github.com/caos/zitadel/internal/org/model"
|
||||
)
|
||||
|
||||
type OrgRepository interface {
|
||||
Languages(ctx context.Context) ([]language.Tag, error)
|
||||
OrgChanges(ctx context.Context, id string, lastSequence uint64, limit uint64, sortAscending bool, auditLogRetention time.Duration) (*org_model.OrgChanges, error)
|
||||
|
||||
GetOrgMemberRoles(isGlobal bool) []string
|
||||
|
@@ -4,5 +4,4 @@ type Repository interface {
|
||||
ProjectRepository
|
||||
OrgRepository
|
||||
UserRepository
|
||||
IamRepository
|
||||
}
|
||||
|
Reference in New Issue
Block a user