mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:37:32 +00:00
refactor: cleanup unused code (#7130)
* refactor: drop unused code * refactor: drop unused code
This commit is contained in:
@@ -13,10 +13,6 @@ const (
|
||||
stateCount
|
||||
)
|
||||
|
||||
func (f MFAState) Valid() bool {
|
||||
return f >= 0 && f < stateCount
|
||||
}
|
||||
|
||||
type MultifactorConfigs struct {
|
||||
OTP OTPConfig
|
||||
}
|
||||
|
@@ -9,10 +9,6 @@ const (
|
||||
notificationCount
|
||||
)
|
||||
|
||||
func (f NotificationType) Valid() bool {
|
||||
return f >= 0 && f < notificationCount
|
||||
}
|
||||
|
||||
type NotificationProviderState int32
|
||||
|
||||
const (
|
||||
|
@@ -10,10 +10,6 @@ const (
|
||||
policyStateCount
|
||||
)
|
||||
|
||||
func (f PolicyState) Valid() bool {
|
||||
return f >= 0 && f < policyStateCount
|
||||
}
|
||||
|
||||
func (s PolicyState) Exists() bool {
|
||||
return s != PolicyStateUnspecified && s != PolicyStateRemoved
|
||||
}
|
||||
|
@@ -83,11 +83,3 @@ func (f LabelPolicy) IsValid() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f LabelPolicyState) Valid() bool {
|
||||
return f >= 0 && f < labelPolicyStateCount
|
||||
}
|
||||
|
||||
func (s LabelPolicyState) Exists() bool {
|
||||
return s != LabelPolicyStateUnspecified && s != LabelPolicyStateRemoved
|
||||
}
|
||||
|
@@ -66,12 +66,6 @@ func (p IDPProvider) IsValid() bool {
|
||||
return p.IDPConfigID != ""
|
||||
}
|
||||
|
||||
// DisplayName returns the name or a default
|
||||
// to be used when always a name must be displayed (e.g. login)
|
||||
func (p IDPProvider) DisplayName() string {
|
||||
return IDPName(p.Name, p.IDPType)
|
||||
}
|
||||
|
||||
type PasswordlessType int32
|
||||
|
||||
const (
|
||||
@@ -88,7 +82,3 @@ func (f PasswordlessType) Valid() bool {
|
||||
func (p *LoginPolicy) HasSecondFactors() bool {
|
||||
return len(p.SecondFactors) > 0
|
||||
}
|
||||
|
||||
func (p *LoginPolicy) HasMultiFactors() bool {
|
||||
return len(p.MultiFactors) > 0
|
||||
}
|
||||
|
@@ -11,11 +11,6 @@ type ProjectGrant struct {
|
||||
RoleKeys []string
|
||||
}
|
||||
|
||||
type ProjectGrantIDs struct {
|
||||
ProjectID string
|
||||
GrantID string
|
||||
}
|
||||
|
||||
type ProjectGrantState int32
|
||||
|
||||
const (
|
||||
|
@@ -12,17 +12,6 @@ type ProjectGrantMember struct {
|
||||
Roles []string
|
||||
}
|
||||
|
||||
func NewProjectGrantMember(aggregateID, userID, grantID string, roles ...string) *ProjectGrantMember {
|
||||
return &ProjectGrantMember{
|
||||
ObjectRoot: es_models.ObjectRoot{
|
||||
AggregateID: aggregateID,
|
||||
},
|
||||
GrantID: grantID,
|
||||
UserID: userID,
|
||||
Roles: roles,
|
||||
}
|
||||
}
|
||||
|
||||
func (i *ProjectGrantMember) IsValid() bool {
|
||||
return i.AggregateID != "" && i.GrantID != "" && i.UserID != "" && len(i.Roles) != 0
|
||||
}
|
||||
|
@@ -9,10 +9,6 @@ const (
|
||||
identityProviderCount
|
||||
)
|
||||
|
||||
func (f IdentityProviderType) Valid() bool {
|
||||
return f >= 0 && f < identityProviderCount
|
||||
}
|
||||
|
||||
type IdentityProviderState int32
|
||||
|
||||
const (
|
||||
@@ -22,7 +18,3 @@ const (
|
||||
|
||||
idpProviderState
|
||||
)
|
||||
|
||||
func (s IdentityProviderState) Valid() bool {
|
||||
return s >= 0 && s < idpProviderState
|
||||
}
|
||||
|
@@ -1,29 +0,0 @@
|
||||
package domain
|
||||
|
||||
type Step int
|
||||
|
||||
const (
|
||||
Step1 Step = iota + 1
|
||||
Step2
|
||||
Step3
|
||||
Step4
|
||||
Step5
|
||||
Step6
|
||||
Step7
|
||||
Step8
|
||||
Step9
|
||||
Step10
|
||||
Step11
|
||||
Step12
|
||||
Step13
|
||||
Step14
|
||||
Step15
|
||||
Step16
|
||||
Step17
|
||||
Step18
|
||||
Step19
|
||||
Step20
|
||||
Step21
|
||||
//StepCount marks the the length of possible steps (StepCount-1 == last possible step)
|
||||
StepCount
|
||||
)
|
@@ -1,9 +0,0 @@
|
||||
package domain
|
||||
|
||||
type UniqueConstraintMigration struct {
|
||||
AggregateID string
|
||||
ObjectID string
|
||||
UniqueType string
|
||||
UniqueField string
|
||||
ErrorMessage string
|
||||
}
|
@@ -1,10 +1,5 @@
|
||||
package domain
|
||||
|
||||
type User interface {
|
||||
GetUsername() string
|
||||
GetState() UserState
|
||||
}
|
||||
|
||||
type UserState int32
|
||||
|
||||
const (
|
||||
@@ -19,10 +14,6 @@ const (
|
||||
userStateCount
|
||||
)
|
||||
|
||||
func (f UserState) Valid() bool {
|
||||
return f >= 0 && f < userStateCount
|
||||
}
|
||||
|
||||
func (s UserState) Exists() bool {
|
||||
return s != UserStateUnspecified && s != UserStateDeleted
|
||||
}
|
||||
@@ -40,10 +31,6 @@ const (
|
||||
userTypeCount
|
||||
)
|
||||
|
||||
func (f UserType) Valid() bool {
|
||||
return f >= 0 && f < userTypeCount
|
||||
}
|
||||
|
||||
type UserAuthMethodType int32
|
||||
|
||||
const (
|
||||
@@ -58,10 +45,6 @@ const (
|
||||
userAuthMethodTypeCount
|
||||
)
|
||||
|
||||
func (f UserAuthMethodType) Valid() bool {
|
||||
return f >= 0 && f < userAuthMethodTypeCount
|
||||
}
|
||||
|
||||
// HasMFA checks whether the user authenticated with multiple auth factors.
|
||||
// This can either be true if the list contains a [UserAuthMethodType] which by itself is MFA (e.g. [UserAuthMethodTypePasswordless])
|
||||
// or if multiple factors were used (e.g. [UserAuthMethodTypePassword] and [UserAuthMethodTypeU2F])
|
||||
|
@@ -1,29 +0,0 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
type UserMembership struct {
|
||||
UserID string
|
||||
MemberType MemberType
|
||||
AggregateID string
|
||||
//ObjectID differs from aggregate id if obejct is sub of an aggregate
|
||||
ObjectID string
|
||||
|
||||
Roles []string
|
||||
DisplayName string
|
||||
CreationDate time.Time
|
||||
ChangeDate time.Time
|
||||
ResourceOwner string
|
||||
ResourceOwnerName string
|
||||
Sequence uint64
|
||||
}
|
||||
|
||||
type MemberType int32
|
||||
|
||||
const (
|
||||
MemberTypeUnspecified MemberType = iota
|
||||
MemberTypeOrganisation
|
||||
MemberTypeProject
|
||||
MemberTypeProjectGrant
|
||||
MemberTypeIam
|
||||
)
|
Reference in New Issue
Block a user