refactor: cleanup unused code (#7130)

* refactor: drop unused code

* refactor: drop unused code
This commit is contained in:
Silvan
2024-01-02 15:26:31 +01:00
committed by GitHub
parent 4e3936b5bf
commit 9892fd92b6
109 changed files with 0 additions and 6282 deletions

View File

@@ -13,10 +13,6 @@ const (
stateCount
)
func (f MFAState) Valid() bool {
return f >= 0 && f < stateCount
}
type MultifactorConfigs struct {
OTP OTPConfig
}

View File

@@ -9,10 +9,6 @@ const (
notificationCount
)
func (f NotificationType) Valid() bool {
return f >= 0 && f < notificationCount
}
type NotificationProviderState int32
const (

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -11,11 +11,6 @@ type ProjectGrant struct {
RoleKeys []string
}
type ProjectGrantIDs struct {
ProjectID string
GrantID string
}
type ProjectGrantState int32
const (

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
)

View File

@@ -1,9 +0,0 @@
package domain
type UniqueConstraintMigration struct {
AggregateID string
ObjectID string
UniqueType string
UniqueField string
ErrorMessage string
}

View File

@@ -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])

View File

@@ -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
)