2021-01-07 15:06:45 +00:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
2023-08-15 12:47:05 +00:00
|
|
|
"time"
|
|
|
|
|
2022-04-26 23:01:45 +00:00
|
|
|
"github.com/zitadel/zitadel/internal/crypto"
|
|
|
|
"github.com/zitadel/zitadel/internal/domain"
|
|
|
|
"github.com/zitadel/zitadel/internal/eventstore"
|
|
|
|
"github.com/zitadel/zitadel/internal/repository/user"
|
2021-01-07 15:06:45 +00:00
|
|
|
)
|
|
|
|
|
2023-08-02 16:57:53 +00:00
|
|
|
type HumanTOTPWriteModel struct {
|
2021-01-07 15:06:45 +00:00
|
|
|
eventstore.WriteModel
|
|
|
|
|
2024-04-10 09:14:55 +00:00
|
|
|
State domain.MFAState
|
|
|
|
Secret *crypto.CryptoValue
|
|
|
|
CheckFailedCount uint64
|
|
|
|
UserLocked bool
|
2021-01-07 15:06:45 +00:00
|
|
|
}
|
|
|
|
|
2023-08-02 16:57:53 +00:00
|
|
|
func NewHumanTOTPWriteModel(userID, resourceOwner string) *HumanTOTPWriteModel {
|
|
|
|
return &HumanTOTPWriteModel{
|
2021-01-07 15:06:45 +00:00
|
|
|
WriteModel: eventstore.WriteModel{
|
2021-01-12 11:59:51 +00:00
|
|
|
AggregateID: userID,
|
|
|
|
ResourceOwner: resourceOwner,
|
2021-01-07 15:06:45 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-02 16:57:53 +00:00
|
|
|
func (wm *HumanTOTPWriteModel) Reduce() error {
|
2021-01-07 15:06:45 +00:00
|
|
|
for _, event := range wm.Events {
|
|
|
|
switch e := event.(type) {
|
|
|
|
case *user.HumanOTPAddedEvent:
|
|
|
|
wm.Secret = e.Secret
|
2021-01-15 08:32:59 +00:00
|
|
|
wm.State = domain.MFAStateNotReady
|
|
|
|
case *user.HumanOTPVerifiedEvent:
|
|
|
|
wm.State = domain.MFAStateReady
|
2024-04-10 09:14:55 +00:00
|
|
|
wm.CheckFailedCount = 0
|
|
|
|
case *user.HumanOTPCheckSucceededEvent:
|
|
|
|
wm.CheckFailedCount = 0
|
|
|
|
case *user.HumanOTPCheckFailedEvent:
|
|
|
|
wm.CheckFailedCount++
|
|
|
|
case *user.UserLockedEvent:
|
|
|
|
wm.UserLocked = true
|
|
|
|
case *user.UserUnlockedEvent:
|
|
|
|
wm.CheckFailedCount = 0
|
|
|
|
wm.UserLocked = false
|
2021-01-07 15:06:45 +00:00
|
|
|
case *user.HumanOTPRemovedEvent:
|
2021-01-15 08:32:59 +00:00
|
|
|
wm.State = domain.MFAStateRemoved
|
2021-01-07 15:06:45 +00:00
|
|
|
case *user.UserRemovedEvent:
|
2021-01-15 08:32:59 +00:00
|
|
|
wm.State = domain.MFAStateRemoved
|
2021-01-07 15:06:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return wm.WriteModel.Reduce()
|
|
|
|
}
|
|
|
|
|
2023-08-02 16:57:53 +00:00
|
|
|
func (wm *HumanTOTPWriteModel) Query() *eventstore.SearchQueryBuilder {
|
2021-07-06 11:55:57 +00:00
|
|
|
query := eventstore.NewSearchQueryBuilder(eventstore.ColumnsEvent).
|
|
|
|
AddQuery().
|
|
|
|
AggregateTypes(user.AggregateType).
|
2021-02-18 13:48:27 +00:00
|
|
|
AggregateIDs(wm.AggregateID).
|
|
|
|
EventTypes(user.HumanMFAOTPAddedType,
|
|
|
|
user.HumanMFAOTPVerifiedType,
|
|
|
|
user.HumanMFAOTPRemovedType,
|
2024-04-10 09:14:55 +00:00
|
|
|
user.HumanMFAOTPCheckSucceededType,
|
|
|
|
user.HumanMFAOTPCheckFailedType,
|
|
|
|
user.UserLockedType,
|
|
|
|
user.UserUnlockedType,
|
2021-04-06 07:57:58 +00:00
|
|
|
user.UserRemovedType,
|
|
|
|
user.UserV1MFAOTPAddedType,
|
|
|
|
user.UserV1MFAOTPVerifiedType,
|
2021-07-06 11:55:57 +00:00
|
|
|
user.UserV1MFAOTPRemovedType).
|
|
|
|
Builder()
|
|
|
|
|
2021-02-08 10:30:30 +00:00
|
|
|
if wm.ResourceOwner != "" {
|
|
|
|
query.ResourceOwner(wm.ResourceOwner)
|
|
|
|
}
|
|
|
|
return query
|
2021-01-07 15:06:45 +00:00
|
|
|
}
|
2023-08-02 16:57:53 +00:00
|
|
|
|
2023-08-15 12:47:05 +00:00
|
|
|
type OTPWriteModel interface {
|
|
|
|
OTPAdded() bool
|
|
|
|
ResourceOwner() string
|
|
|
|
}
|
|
|
|
|
|
|
|
type OTPCodeWriteModel interface {
|
|
|
|
OTPWriteModel
|
|
|
|
CodeCreationDate() time.Time
|
|
|
|
CodeExpiry() time.Duration
|
|
|
|
Code() *crypto.CryptoValue
|
2024-04-10 09:14:55 +00:00
|
|
|
CheckFailedCount() uint64
|
|
|
|
UserLocked() bool
|
2024-09-26 07:14:33 +00:00
|
|
|
GeneratorID() string
|
|
|
|
ProviderVerificationID() string
|
2024-04-10 09:14:55 +00:00
|
|
|
eventstore.QueryReducer
|
2023-08-15 12:47:05 +00:00
|
|
|
}
|
|
|
|
|
2023-08-02 16:57:53 +00:00
|
|
|
type HumanOTPSMSWriteModel struct {
|
|
|
|
eventstore.WriteModel
|
|
|
|
|
|
|
|
phoneVerified bool
|
|
|
|
otpAdded bool
|
|
|
|
}
|
|
|
|
|
2023-08-15 12:47:05 +00:00
|
|
|
func (wm *HumanOTPSMSWriteModel) OTPAdded() bool {
|
|
|
|
return wm.otpAdded
|
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPSMSWriteModel) ResourceOwner() string {
|
|
|
|
return wm.WriteModel.ResourceOwner
|
|
|
|
}
|
|
|
|
|
2023-08-02 16:57:53 +00:00
|
|
|
func NewHumanOTPSMSWriteModel(userID, resourceOwner string) *HumanOTPSMSWriteModel {
|
|
|
|
return &HumanOTPSMSWriteModel{
|
|
|
|
WriteModel: eventstore.WriteModel{
|
|
|
|
AggregateID: userID,
|
|
|
|
ResourceOwner: resourceOwner,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPSMSWriteModel) Reduce() error {
|
|
|
|
for _, event := range wm.Events {
|
|
|
|
switch event.(type) {
|
|
|
|
case *user.HumanPhoneVerifiedEvent:
|
|
|
|
wm.phoneVerified = true
|
|
|
|
case *user.HumanOTPSMSAddedEvent:
|
|
|
|
wm.otpAdded = true
|
|
|
|
case *user.HumanOTPSMSRemovedEvent:
|
|
|
|
wm.otpAdded = false
|
|
|
|
case *user.HumanPhoneRemovedEvent,
|
|
|
|
*user.UserRemovedEvent:
|
|
|
|
wm.phoneVerified = false
|
|
|
|
wm.otpAdded = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return wm.WriteModel.Reduce()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPSMSWriteModel) Query() *eventstore.SearchQueryBuilder {
|
|
|
|
query := eventstore.NewSearchQueryBuilder(eventstore.ColumnsEvent).
|
|
|
|
AddQuery().
|
|
|
|
AggregateTypes(user.AggregateType).
|
|
|
|
AggregateIDs(wm.AggregateID).
|
|
|
|
EventTypes(user.HumanPhoneVerifiedType,
|
|
|
|
user.HumanOTPSMSAddedType,
|
|
|
|
user.HumanOTPSMSRemovedType,
|
|
|
|
user.HumanPhoneRemovedType,
|
|
|
|
user.UserRemovedType,
|
|
|
|
).
|
|
|
|
Builder()
|
|
|
|
|
2023-08-15 12:47:05 +00:00
|
|
|
if wm.WriteModel.ResourceOwner != "" {
|
|
|
|
query.ResourceOwner(wm.WriteModel.ResourceOwner)
|
|
|
|
}
|
|
|
|
return query
|
|
|
|
}
|
|
|
|
|
|
|
|
type HumanOTPSMSCodeWriteModel struct {
|
|
|
|
*HumanOTPSMSWriteModel
|
|
|
|
|
2024-05-30 22:08:48 +00:00
|
|
|
otpCode *OTPCode
|
2024-04-10 09:14:55 +00:00
|
|
|
|
|
|
|
checkFailedCount uint64
|
|
|
|
userLocked bool
|
2023-08-15 12:47:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPSMSCodeWriteModel) CodeCreationDate() time.Time {
|
2024-05-30 22:08:48 +00:00
|
|
|
if wm.otpCode == nil {
|
|
|
|
return time.Time{}
|
|
|
|
}
|
|
|
|
return wm.otpCode.CreationDate
|
2023-08-15 12:47:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPSMSCodeWriteModel) CodeExpiry() time.Duration {
|
2024-05-30 22:08:48 +00:00
|
|
|
if wm.otpCode == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
return wm.otpCode.Expiry
|
2023-08-15 12:47:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPSMSCodeWriteModel) Code() *crypto.CryptoValue {
|
2024-05-30 22:08:48 +00:00
|
|
|
if wm.otpCode == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return wm.otpCode.Code
|
2023-08-15 12:47:05 +00:00
|
|
|
}
|
|
|
|
|
2024-04-10 09:14:55 +00:00
|
|
|
func (wm *HumanOTPSMSCodeWriteModel) CheckFailedCount() uint64 {
|
|
|
|
return wm.checkFailedCount
|
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPSMSCodeWriteModel) UserLocked() bool {
|
|
|
|
return wm.userLocked
|
|
|
|
}
|
|
|
|
|
2024-09-26 07:14:33 +00:00
|
|
|
func (wm *HumanOTPSMSCodeWriteModel) GeneratorID() string {
|
|
|
|
if wm.otpCode == nil {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
return wm.otpCode.GeneratorID
|
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPSMSCodeWriteModel) ProviderVerificationID() string {
|
|
|
|
if wm.otpCode == nil {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
return wm.otpCode.VerificationID
|
|
|
|
}
|
|
|
|
|
2023-08-15 12:47:05 +00:00
|
|
|
func NewHumanOTPSMSCodeWriteModel(userID, resourceOwner string) *HumanOTPSMSCodeWriteModel {
|
|
|
|
return &HumanOTPSMSCodeWriteModel{
|
|
|
|
HumanOTPSMSWriteModel: NewHumanOTPSMSWriteModel(userID, resourceOwner),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPSMSCodeWriteModel) Reduce() error {
|
|
|
|
for _, event := range wm.Events {
|
2024-04-10 09:14:55 +00:00
|
|
|
switch e := event.(type) {
|
|
|
|
case *user.HumanOTPSMSCodeAddedEvent:
|
2024-05-30 22:08:48 +00:00
|
|
|
wm.otpCode = &OTPCode{
|
|
|
|
Code: e.Code,
|
|
|
|
CreationDate: e.CreationDate(),
|
|
|
|
Expiry: e.Expiry,
|
2024-09-26 07:14:33 +00:00
|
|
|
GeneratorID: e.GeneratorID,
|
2024-05-30 22:08:48 +00:00
|
|
|
}
|
2024-09-26 07:14:33 +00:00
|
|
|
case *user.HumanOTPSMSCodeSentEvent:
|
|
|
|
wm.otpCode.GeneratorID = e.GeneratorInfo.GetID()
|
|
|
|
wm.otpCode.VerificationID = e.GeneratorInfo.GetVerificationID()
|
2024-04-10 09:14:55 +00:00
|
|
|
case *user.HumanOTPSMSCheckSucceededEvent:
|
|
|
|
wm.checkFailedCount = 0
|
|
|
|
case *user.HumanOTPSMSCheckFailedEvent:
|
|
|
|
wm.checkFailedCount++
|
|
|
|
case *user.UserLockedEvent:
|
|
|
|
wm.userLocked = true
|
|
|
|
case *user.UserUnlockedEvent:
|
|
|
|
wm.checkFailedCount = 0
|
|
|
|
wm.userLocked = false
|
2023-08-15 12:47:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return wm.HumanOTPSMSWriteModel.Reduce()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPSMSCodeWriteModel) Query() *eventstore.SearchQueryBuilder {
|
|
|
|
query := eventstore.NewSearchQueryBuilder(eventstore.ColumnsEvent).
|
|
|
|
AddQuery().
|
|
|
|
AggregateTypes(user.AggregateType).
|
|
|
|
AggregateIDs(wm.AggregateID).
|
|
|
|
EventTypes(
|
|
|
|
user.HumanOTPSMSCodeAddedType,
|
2024-09-26 07:14:33 +00:00
|
|
|
user.HumanOTPSMSCodeSentType,
|
2024-04-10 09:14:55 +00:00
|
|
|
user.HumanOTPSMSCheckSucceededType,
|
|
|
|
user.HumanOTPSMSCheckFailedType,
|
|
|
|
user.UserLockedType,
|
|
|
|
user.UserUnlockedType,
|
2023-08-15 12:47:05 +00:00
|
|
|
user.HumanPhoneVerifiedType,
|
|
|
|
user.HumanOTPSMSAddedType,
|
|
|
|
user.HumanOTPSMSRemovedType,
|
|
|
|
user.HumanPhoneRemovedType,
|
|
|
|
user.UserRemovedType,
|
|
|
|
).
|
|
|
|
Builder()
|
|
|
|
|
|
|
|
if wm.WriteModel.ResourceOwner != "" {
|
|
|
|
query.ResourceOwner(wm.WriteModel.ResourceOwner)
|
2023-08-02 16:57:53 +00:00
|
|
|
}
|
|
|
|
return query
|
|
|
|
}
|
|
|
|
|
|
|
|
type HumanOTPEmailWriteModel struct {
|
|
|
|
eventstore.WriteModel
|
|
|
|
|
|
|
|
emailVerified bool
|
|
|
|
otpAdded bool
|
|
|
|
}
|
|
|
|
|
2023-08-15 12:47:05 +00:00
|
|
|
func (wm *HumanOTPEmailWriteModel) OTPAdded() bool {
|
|
|
|
return wm.otpAdded
|
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPEmailWriteModel) ResourceOwner() string {
|
|
|
|
return wm.WriteModel.ResourceOwner
|
|
|
|
}
|
|
|
|
|
2023-08-02 16:57:53 +00:00
|
|
|
func NewHumanOTPEmailWriteModel(userID, resourceOwner string) *HumanOTPEmailWriteModel {
|
|
|
|
return &HumanOTPEmailWriteModel{
|
|
|
|
WriteModel: eventstore.WriteModel{
|
|
|
|
AggregateID: userID,
|
|
|
|
ResourceOwner: resourceOwner,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPEmailWriteModel) Reduce() error {
|
|
|
|
for _, event := range wm.Events {
|
|
|
|
switch event.(type) {
|
|
|
|
case *user.HumanEmailVerifiedEvent:
|
|
|
|
wm.emailVerified = true
|
|
|
|
case *user.HumanOTPEmailAddedEvent:
|
|
|
|
wm.otpAdded = true
|
|
|
|
case *user.HumanOTPEmailRemovedEvent:
|
|
|
|
wm.otpAdded = false
|
|
|
|
case *user.UserRemovedEvent:
|
|
|
|
wm.emailVerified = false
|
|
|
|
wm.otpAdded = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return wm.WriteModel.Reduce()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPEmailWriteModel) Query() *eventstore.SearchQueryBuilder {
|
|
|
|
query := eventstore.NewSearchQueryBuilder(eventstore.ColumnsEvent).
|
|
|
|
AddQuery().
|
|
|
|
AggregateTypes(user.AggregateType).
|
|
|
|
AggregateIDs(wm.AggregateID).
|
2023-08-15 12:47:05 +00:00
|
|
|
EventTypes(
|
|
|
|
user.HumanEmailVerifiedType,
|
2023-08-02 16:57:53 +00:00
|
|
|
user.HumanOTPEmailAddedType,
|
|
|
|
user.HumanOTPEmailRemovedType,
|
|
|
|
user.UserRemovedType,
|
|
|
|
).
|
|
|
|
Builder()
|
|
|
|
|
2023-08-15 12:47:05 +00:00
|
|
|
if wm.WriteModel.ResourceOwner != "" {
|
|
|
|
query.ResourceOwner(wm.WriteModel.ResourceOwner)
|
|
|
|
}
|
|
|
|
return query
|
|
|
|
}
|
|
|
|
|
|
|
|
type HumanOTPEmailCodeWriteModel struct {
|
|
|
|
*HumanOTPEmailWriteModel
|
|
|
|
|
2024-05-30 22:08:48 +00:00
|
|
|
otpCode *OTPCode
|
2024-04-10 09:14:55 +00:00
|
|
|
|
|
|
|
checkFailedCount uint64
|
|
|
|
userLocked bool
|
2023-08-15 12:47:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPEmailCodeWriteModel) CodeCreationDate() time.Time {
|
2024-05-30 22:08:48 +00:00
|
|
|
if wm.otpCode == nil {
|
|
|
|
return time.Time{}
|
|
|
|
}
|
|
|
|
return wm.otpCode.CreationDate
|
2023-08-15 12:47:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPEmailCodeWriteModel) CodeExpiry() time.Duration {
|
2024-05-30 22:08:48 +00:00
|
|
|
if wm.otpCode == nil {
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
return wm.otpCode.Expiry
|
2023-08-15 12:47:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPEmailCodeWriteModel) Code() *crypto.CryptoValue {
|
2024-05-30 22:08:48 +00:00
|
|
|
if wm.otpCode == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return wm.otpCode.Code
|
2023-08-15 12:47:05 +00:00
|
|
|
}
|
|
|
|
|
2024-04-10 09:14:55 +00:00
|
|
|
func (wm *HumanOTPEmailCodeWriteModel) CheckFailedCount() uint64 {
|
|
|
|
return wm.checkFailedCount
|
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPEmailCodeWriteModel) UserLocked() bool {
|
|
|
|
return wm.userLocked
|
|
|
|
}
|
|
|
|
|
2024-09-26 07:14:33 +00:00
|
|
|
func (wm *HumanOTPEmailCodeWriteModel) GeneratorID() string {
|
|
|
|
if wm.otpCode == nil {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
return wm.otpCode.GeneratorID
|
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPEmailCodeWriteModel) ProviderVerificationID() string {
|
|
|
|
if wm.otpCode == nil {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
return wm.otpCode.VerificationID
|
|
|
|
}
|
|
|
|
|
2023-08-15 12:47:05 +00:00
|
|
|
func NewHumanOTPEmailCodeWriteModel(userID, resourceOwner string) *HumanOTPEmailCodeWriteModel {
|
|
|
|
return &HumanOTPEmailCodeWriteModel{
|
|
|
|
HumanOTPEmailWriteModel: NewHumanOTPEmailWriteModel(userID, resourceOwner),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPEmailCodeWriteModel) Reduce() error {
|
|
|
|
for _, event := range wm.Events {
|
2024-04-10 09:14:55 +00:00
|
|
|
switch e := event.(type) {
|
|
|
|
case *user.HumanOTPEmailCodeAddedEvent:
|
2024-05-30 22:08:48 +00:00
|
|
|
wm.otpCode = &OTPCode{
|
|
|
|
Code: e.Code,
|
|
|
|
CreationDate: e.CreationDate(),
|
|
|
|
Expiry: e.Expiry,
|
|
|
|
}
|
2024-04-10 09:14:55 +00:00
|
|
|
case *user.HumanOTPEmailCheckSucceededEvent:
|
|
|
|
wm.checkFailedCount = 0
|
|
|
|
case *user.HumanOTPEmailCheckFailedEvent:
|
|
|
|
wm.checkFailedCount++
|
|
|
|
case *user.UserLockedEvent:
|
|
|
|
wm.userLocked = true
|
|
|
|
case *user.UserUnlockedEvent:
|
|
|
|
wm.checkFailedCount = 0
|
|
|
|
wm.userLocked = false
|
2023-08-15 12:47:05 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return wm.HumanOTPEmailWriteModel.Reduce()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (wm *HumanOTPEmailCodeWriteModel) Query() *eventstore.SearchQueryBuilder {
|
|
|
|
query := eventstore.NewSearchQueryBuilder(eventstore.ColumnsEvent).
|
|
|
|
AddQuery().
|
|
|
|
AggregateTypes(user.AggregateType).
|
|
|
|
AggregateIDs(wm.AggregateID).
|
|
|
|
EventTypes(
|
|
|
|
user.HumanOTPEmailCodeAddedType,
|
2024-04-10 09:14:55 +00:00
|
|
|
user.HumanOTPEmailCheckSucceededType,
|
|
|
|
user.HumanOTPEmailCheckFailedType,
|
|
|
|
user.UserLockedType,
|
|
|
|
user.UserUnlockedType,
|
2023-08-15 12:47:05 +00:00
|
|
|
user.HumanEmailVerifiedType,
|
|
|
|
user.HumanOTPEmailAddedType,
|
|
|
|
user.HumanOTPEmailRemovedType,
|
|
|
|
user.UserRemovedType,
|
|
|
|
).
|
|
|
|
Builder()
|
|
|
|
|
|
|
|
if wm.WriteModel.ResourceOwner != "" {
|
|
|
|
query.ResourceOwner(wm.WriteModel.ResourceOwner)
|
2023-08-02 16:57:53 +00:00
|
|
|
}
|
|
|
|
return query
|
|
|
|
}
|