fix: change to repository event types and removed unused code (#3386)

* fix: change to repository event types and removed unused code

* some fixes

* remove unused code
This commit is contained in:
Livio Amstutz
2022-03-31 11:36:26 +02:00
committed by GitHub
parent 55af4a18a2
commit 87560157c1
170 changed files with 999 additions and 9581 deletions

View File

@@ -1,18 +1,16 @@
package model
import (
"github.com/caos/zitadel/internal/domain"
caos_errors "github.com/caos/zitadel/internal/errors"
"time"
req_model "github.com/caos/zitadel/internal/auth_request/model"
"github.com/caos/zitadel/internal/domain"
caos_errors "github.com/caos/zitadel/internal/errors"
)
type UserSessionView struct {
CreationDate time.Time
ChangeDate time.Time
State req_model.UserSessionState
State domain.UserSessionState
ResourceOwner string
UserAgentID string
UserID string
@@ -26,9 +24,9 @@ type UserSessionView struct {
PasswordlessVerification time.Time
ExternalLoginVerification time.Time
SecondFactorVerification time.Time
SecondFactorVerificationType req_model.MFAType
SecondFactorVerificationType domain.MFAType
MultiFactorVerification time.Time
MultiFactorVerificationType req_model.MFAType
MultiFactorVerificationType domain.MFAType
Sequence uint64
}

View File

@@ -5,15 +5,13 @@ import (
"net/url"
"time"
"github.com/caos/zitadel/internal/domain"
"github.com/caos/zitadel/internal/static"
"golang.org/x/text/language"
req_model "github.com/caos/zitadel/internal/auth_request/model"
"github.com/caos/zitadel/internal/domain"
"github.com/caos/zitadel/internal/errors"
"github.com/caos/zitadel/internal/eventstore/v1/models"
iam_model "github.com/caos/zitadel/internal/iam/model"
"github.com/caos/zitadel/internal/static"
)
type UserView struct {
@@ -58,7 +56,7 @@ type HumanView struct {
OTPState MFAState
U2FTokens []*WebAuthNView
PasswordlessTokens []*WebAuthNView
MFAMaxSetUp req_model.MFALevel
MFAMaxSetUp domain.MFALevel
MFAInitSkipped time.Time
InitRequired bool
PasswordlessInitRequired bool
@@ -226,9 +224,9 @@ func (u *UserView) HasRequiredOrgMFALevel(policy *iam_model.LoginPolicyView) boo
return true
}
switch u.MFAMaxSetUp {
case req_model.MFALevelSecondFactor:
case domain.MFALevelSecondFactor:
return policy.HasSecondFactors()
case req_model.MFALevelMultiFactor:
case domain.MFALevelMultiFactor:
return policy.HasMultiFactors()
default:
return false