mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 21:37:32 +00:00
fix: todos (#1346)
* fix: pub sub in new eventstore * fix: todos * fix: todos * fix: todos * fix: todos * fix: todos
This commit is contained in:
@@ -64,3 +64,7 @@ const (
|
||||
func (s PhoneState) Valid() bool {
|
||||
return s >= 0 && s < phoneStateCount
|
||||
}
|
||||
|
||||
func (s PhoneState) Exists() bool {
|
||||
return s == PhoneStateActive
|
||||
}
|
||||
|
@@ -29,8 +29,6 @@ type WebAuthNLogin struct {
|
||||
Challenge string
|
||||
AllowedCredentialIDs [][]byte
|
||||
UserVerification UserVerificationRequirement
|
||||
//TODO: Add Auth Request
|
||||
//*model.AuthRequest
|
||||
}
|
||||
|
||||
type UserVerificationRequirement int32
|
||||
|
@@ -73,8 +73,12 @@ const (
|
||||
idpConfigStateCount
|
||||
)
|
||||
|
||||
func (f IDPConfigState) Valid() bool {
|
||||
return f >= 0 && f < idpConfigStateCount
|
||||
func (s IDPConfigState) Valid() bool {
|
||||
return s >= 0 && s < idpConfigStateCount
|
||||
}
|
||||
|
||||
func (s IDPConfigState) Exists() bool {
|
||||
return s != IDPConfigStateUnspecified || s == IDPConfigStateRemoved
|
||||
}
|
||||
|
||||
type IDPConfigStylingType int32
|
||||
|
@@ -1,5 +1,7 @@
|
||||
package domain
|
||||
|
||||
import "github.com/caos/zitadel/internal/crypto"
|
||||
|
||||
type MFAState int32
|
||||
|
||||
const (
|
||||
@@ -14,3 +16,12 @@ const (
|
||||
func (f MFAState) Valid() bool {
|
||||
return f >= 0 && f < stateCount
|
||||
}
|
||||
|
||||
type MultifactorConfigs struct {
|
||||
OTP OTPConfig
|
||||
}
|
||||
|
||||
type OTPConfig struct {
|
||||
Issuer string
|
||||
CryptoMFA crypto.EncryptionAlgorithm
|
||||
}
|
||||
|
@@ -1,9 +1,37 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"github.com/caos/zitadel/internal/api/authz"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const (
|
||||
IAMRolePrefix = "IAM"
|
||||
OrgRolePrefix = "ORG"
|
||||
ProjectRolePrefix = "PROJECT"
|
||||
ProjectGrantRolePrefix = "PROJECT_GRANT"
|
||||
RoleOrgOwner = "ORG_OWNER"
|
||||
RoleOrgProjectCreator = "ORG_PROJECT_CREATOR"
|
||||
RoleIAMOwner = "IAM_OWNER"
|
||||
RoleProjectOwner = "PROJECT_OWNER"
|
||||
RoleProjectOwnerGlobal = "PROJECT_OWNER_GLOBAL"
|
||||
)
|
||||
|
||||
func CheckForInvalidRoles(roles []string, rolePrefix string, validRoles []authz.RoleMapping) []string {
|
||||
invalidRoles := make([]string, 0)
|
||||
for _, role := range roles {
|
||||
if !containsRole(role, rolePrefix, validRoles) {
|
||||
invalidRoles = append(invalidRoles, role)
|
||||
}
|
||||
}
|
||||
return invalidRoles
|
||||
}
|
||||
|
||||
func containsRole(role, rolePrefix string, validRoles []authz.RoleMapping) bool {
|
||||
for _, validRole := range validRoles {
|
||||
if role == validRole.Role && strings.HasPrefix(role, rolePrefix) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
19
internal/domain/search_method.go
Normal file
19
internal/domain/search_method.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package domain
|
||||
|
||||
type SearchMethod int32
|
||||
|
||||
const (
|
||||
SearchMethodEquals SearchMethod = iota
|
||||
SearchMethodStartsWith
|
||||
SearchMethodContains
|
||||
SearchMethodEqualsIgnoreCase
|
||||
SearchMethodStartsWithIgnoreCase
|
||||
SearchMethodContainsIgnoreCase
|
||||
SearchMethodNotEquals
|
||||
SearchMethodGreaterThan
|
||||
SearchMethodLessThan
|
||||
SearchMethodIsOneOf
|
||||
SearchMethodListContains
|
||||
SearchMethodEndsWith
|
||||
SearchMethodEndsWithIgnoreCase
|
||||
)
|
Reference in New Issue
Block a user