mirror of
https://github.com/zitadel/zitadel.git
synced 2025-05-22 15:08:22 +00:00
move files (#125)
This commit is contained in:
parent
f14d4cc655
commit
c365a98cc8
@ -1,4 +1,4 @@
|
|||||||
package eventsourcing
|
package eventstore
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
52
internal/management/repository/eventsourcing/org.go
Normal file
52
internal/management/repository/eventsourcing/org.go
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
package eventsourcing
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/caos/zitadel/internal/errors"
|
||||||
|
org_model "github.com/caos/zitadel/internal/org/model"
|
||||||
|
org_es "github.com/caos/zitadel/internal/org/repository/eventsourcing"
|
||||||
|
)
|
||||||
|
|
||||||
|
type OrgRepository struct {
|
||||||
|
*org_es.OrgEventstore
|
||||||
|
}
|
||||||
|
|
||||||
|
func (repo *OrgRepository) OrgByID(ctx context.Context, id string) (*org_model.Org, error) {
|
||||||
|
org := org_model.NewOrg(id)
|
||||||
|
return repo.OrgEventstore.OrgByID(ctx, org)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (repo *OrgRepository) OrgByDomainGlobal(ctx context.Context, domain string) (*org_model.Org, error) {
|
||||||
|
return nil, errors.ThrowUnimplemented(nil, "EVENT-GQoS8", "not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (repo *OrgRepository) UpdateOrg(ctx context.Context, org *org_model.Org) (*org_model.Org, error) {
|
||||||
|
return nil, errors.ThrowUnimplemented(nil, "EVENT-RkurR", "not implemented")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (repo *OrgRepository) DeactivateOrg(ctx context.Context, id string) (*org_model.Org, error) {
|
||||||
|
return repo.OrgEventstore.DeactivateOrg(ctx, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (repo *OrgRepository) ReactivateOrg(ctx context.Context, id string) (*org_model.Org, error) {
|
||||||
|
return repo.OrgEventstore.ReactivateOrg(ctx, id)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (repo *OrgRepository) OrgMemberByID(ctx context.Context, orgID, userID string) (member *org_model.OrgMember, err error) {
|
||||||
|
member = org_model.NewOrgMember(orgID, userID)
|
||||||
|
return repo.OrgEventstore.OrgMemberByIDs(ctx, member)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (repo *OrgRepository) AddOrgMember(ctx context.Context, member *org_model.OrgMember) (*org_model.OrgMember, error) {
|
||||||
|
return repo.OrgEventstore.AddOrgMember(ctx, member)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (repo *OrgRepository) ChangeOrgMember(ctx context.Context, member *org_model.OrgMember) (*org_model.OrgMember, error) {
|
||||||
|
return repo.OrgEventstore.ChangeOrgMember(ctx, member)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (repo *OrgRepository) RemoveOrgMember(ctx context.Context, orgID, userID string) error {
|
||||||
|
member := org_model.NewOrgMember(orgID, userID)
|
||||||
|
return repo.OrgEventstore.RemoveOrgMember(ctx, member)
|
||||||
|
}
|
@ -31,7 +31,7 @@ type EsRepository struct {
|
|||||||
eventstore.ProjectRepo
|
eventstore.ProjectRepo
|
||||||
eventstore.UserRepo
|
eventstore.UserRepo
|
||||||
eventstore.UserGrantRepo
|
eventstore.UserGrantRepo
|
||||||
PolicyRepo
|
eventstore.PolicyRepo
|
||||||
}
|
}
|
||||||
|
|
||||||
func Start(conf Config, systemDefaults sd.SystemDefaults) (*EsRepository, error) {
|
func Start(conf Config, systemDefaults sd.SystemDefaults) (*EsRepository, error) {
|
||||||
@ -88,7 +88,7 @@ func Start(conf Config, systemDefaults sd.SystemDefaults) (*EsRepository, error)
|
|||||||
ProjectRepo: eventstore.ProjectRepo{conf.SearchLimit, project, view},
|
ProjectRepo: eventstore.ProjectRepo{conf.SearchLimit, project, view},
|
||||||
UserRepo: eventstore.UserRepo{conf.SearchLimit, user, view},
|
UserRepo: eventstore.UserRepo{conf.SearchLimit, user, view},
|
||||||
UserGrantRepo: eventstore.UserGrantRepo{conf.SearchLimit, usergrant, view},
|
UserGrantRepo: eventstore.UserGrantRepo{conf.SearchLimit, usergrant, view},
|
||||||
PolicyRepo: PolicyRepo{policy},
|
PolicyRepo: eventstore.PolicyRepo{policy},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,87 +0,0 @@
|
|||||||
package eventsourcing
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
usr_model "github.com/caos/zitadel/internal/user/model"
|
|
||||||
usr_event "github.com/caos/zitadel/internal/user/repository/eventsourcing"
|
|
||||||
)
|
|
||||||
|
|
||||||
type UserRepo struct {
|
|
||||||
UserEvents *usr_event.UserEventstore
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) UserByID(ctx context.Context, id string) (project *usr_model.User, err error) {
|
|
||||||
return repo.UserEvents.UserByID(ctx, id)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) CreateUser(ctx context.Context, user *usr_model.User) (*usr_model.User, error) {
|
|
||||||
return repo.UserEvents.CreateUser(ctx, user)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) RegisterUser(ctx context.Context, user *usr_model.User, resourceOwner string) (*usr_model.User, error) {
|
|
||||||
return repo.UserEvents.RegisterUser(ctx, user, resourceOwner)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) DeactivateUser(ctx context.Context, id string) (*usr_model.User, error) {
|
|
||||||
return repo.UserEvents.DeactivateUser(ctx, id)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) ReactivateUser(ctx context.Context, id string) (*usr_model.User, error) {
|
|
||||||
return repo.UserEvents.ReactivateUser(ctx, id)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) LockUser(ctx context.Context, id string) (*usr_model.User, error) {
|
|
||||||
return repo.UserEvents.LockUser(ctx, id)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) UnlockUser(ctx context.Context, id string) (*usr_model.User, error) {
|
|
||||||
return repo.UserEvents.UnlockUser(ctx, id)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) SetOneTimePassword(ctx context.Context, password *usr_model.Password) (*usr_model.Password, error) {
|
|
||||||
return repo.UserEvents.SetOneTimePassword(ctx, password)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) RequestSetPassword(ctx context.Context, id string, notifyType usr_model.NotificationType) error {
|
|
||||||
return repo.UserEvents.RequestSetPassword(ctx, id, notifyType)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) ProfileByID(ctx context.Context, userID string) (*usr_model.Profile, error) {
|
|
||||||
return repo.UserEvents.ProfileByID(ctx, userID)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) ChangeProfile(ctx context.Context, profile *usr_model.Profile) (*usr_model.Profile, error) {
|
|
||||||
return repo.UserEvents.ChangeProfile(ctx, profile)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) EmailByID(ctx context.Context, userID string) (*usr_model.Email, error) {
|
|
||||||
return repo.UserEvents.EmailByID(ctx, userID)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) ChangeEmail(ctx context.Context, email *usr_model.Email) (*usr_model.Email, error) {
|
|
||||||
return repo.UserEvents.ChangeEmail(ctx, email)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) CreateEmailVerificationCode(ctx context.Context, userID string) error {
|
|
||||||
return repo.UserEvents.CreateEmailVerificationCode(ctx, userID)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) PhoneByID(ctx context.Context, userID string) (*usr_model.Phone, error) {
|
|
||||||
return repo.UserEvents.PhoneByID(ctx, userID)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) ChangePhone(ctx context.Context, email *usr_model.Phone) (*usr_model.Phone, error) {
|
|
||||||
return repo.UserEvents.ChangePhone(ctx, email)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) CreatePhoneVerificationCode(ctx context.Context, userID string) error {
|
|
||||||
return repo.UserEvents.CreatePhoneVerificationCode(ctx, userID)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) AddressByID(ctx context.Context, userID string) (*usr_model.Address, error) {
|
|
||||||
return repo.UserEvents.AddressByID(ctx, userID)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserRepo) ChangeAddress(ctx context.Context, address *usr_model.Address) (*usr_model.Address, error) {
|
|
||||||
return repo.UserEvents.ChangeAddress(ctx, address)
|
|
||||||
}
|
|
@ -1,35 +0,0 @@
|
|||||||
package eventsourcing
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
grant_model "github.com/caos/zitadel/internal/usergrant/model"
|
|
||||||
grant_event "github.com/caos/zitadel/internal/usergrant/repository/eventsourcing"
|
|
||||||
)
|
|
||||||
|
|
||||||
type UserGrantRepo struct {
|
|
||||||
UserGrantEvents *grant_event.UserGrantEventStore
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserGrantRepo) UserGrantByID(ctx context.Context, grantID string) (*grant_model.UserGrant, error) {
|
|
||||||
return repo.UserGrantEvents.UserGrantByID(ctx, grantID)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserGrantRepo) AddUserGrant(ctx context.Context, grant *grant_model.UserGrant) (*grant_model.UserGrant, error) {
|
|
||||||
return repo.UserGrantEvents.AddUserGrant(ctx, grant)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserGrantRepo) ChangeUserGrant(ctx context.Context, grant *grant_model.UserGrant) (*grant_model.UserGrant, error) {
|
|
||||||
return repo.UserGrantEvents.ChangeUserGrant(ctx, grant)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserGrantRepo) DeactivateUserGrant(ctx context.Context, grantID string) (*grant_model.UserGrant, error) {
|
|
||||||
return repo.UserGrantEvents.DeactivateUserGrant(ctx, grantID)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserGrantRepo) ReactivateUserGrant(ctx context.Context, grantID string) (*grant_model.UserGrant, error) {
|
|
||||||
return repo.UserGrantEvents.ReactivateUserGrant(ctx, grantID)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (repo *UserGrantRepo) RemoveUserGrant(ctx context.Context, grantID string) error {
|
|
||||||
return repo.UserGrantEvents.RemoveUserGrant(ctx, grantID)
|
|
||||||
}
|
|
@ -41,4 +41,3 @@ func (o *Org) ContainsMember(userID string) bool {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user