mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 15:49:35 +00:00
fix(features): remove the improved performance enumer (#9819)
# Which Problems Are Solved Instance that had improved performance flags set, got event errors when getting instance features. This is because the improved performance flags were marshalled using the enumerated integers, but now needed to be unmashalled using the added UnmarshallText method. # How the Problems Are Solved - Remove emnumer generation # Additional Changes - none # Additional Context - reported on QA - Backport to next-rc / v3
This commit is contained in:
@@ -1102,12 +1102,13 @@ DefaultInstance:
|
|||||||
# LegacyIntrospection: false # ZITADEL_DEFAULTINSTANCE_FEATURES_LEGACYINTROSPECTION
|
# LegacyIntrospection: false # ZITADEL_DEFAULTINSTANCE_FEATURES_LEGACYINTROSPECTION
|
||||||
# UserSchema: false # ZITADEL_DEFAULTINSTANCE_FEATURES_USERSCHEMA
|
# UserSchema: false # ZITADEL_DEFAULTINSTANCE_FEATURES_USERSCHEMA
|
||||||
# TokenExchange: false # ZITADEL_DEFAULTINSTANCE_FEATURES_TOKENEXCHANGE
|
# TokenExchange: false # ZITADEL_DEFAULTINSTANCE_FEATURES_TOKENEXCHANGE
|
||||||
# ImprovedPerformance: # ZITADEL_DEFAULTINSTANCE_FEATURES_IMPROVEDPERFORMANCE
|
ImprovedPerformance: # ZITADEL_DEFAULTINSTANCE_FEATURES_IMPROVEDPERFORMANCE
|
||||||
# - OrgByID
|
# https://github.com/zitadel/zitadel/blob/main/internal/feature/feature.go#L64-L68
|
||||||
# - ProjectGrant
|
# - 1 # OrgByID
|
||||||
# - Project
|
# - 2 # ProjectGrant
|
||||||
# - UserGrant
|
# - 3 # Project
|
||||||
# - OrgDomainVerified
|
# - 4 # UserGrant
|
||||||
|
# - 5 # OrgDomainVerified
|
||||||
# WebKey: false # ZITADEL_DEFAULTINSTANCE_FEATURES_WEBKEY
|
# WebKey: false # ZITADEL_DEFAULTINSTANCE_FEATURES_WEBKEY
|
||||||
# DebugOIDCParentError: false # ZITADEL_DEFAULTINSTANCE_FEATURES_DEBUGOIDCPARENTERROR
|
# DebugOIDCParentError: false # ZITADEL_DEFAULTINSTANCE_FEATURES_DEBUGOIDCPARENTERROR
|
||||||
# OIDCSingleV1SessionTermination: false # ZITADEL_DEFAULTINSTANCE_FEATURES_OIDCSINGLEV1SESSIONTERMINATION
|
# OIDCSingleV1SessionTermination: false # ZITADEL_DEFAULTINSTANCE_FEATURES_OIDCSINGLEV1SESSIONTERMINATION
|
||||||
|
@@ -57,7 +57,8 @@ type Features struct {
|
|||||||
ConsoleUseV2UserApi bool `json:"console_use_v2_user_api,omitempty"`
|
ConsoleUseV2UserApi bool `json:"console_use_v2_user_api,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
//go:generate enumer -type ImprovedPerformanceType -trimprefix ImprovedPerformanceType -text
|
/* Note: do not generate the stringer or enumer for this type, is it breaks existing events */
|
||||||
|
|
||||||
type ImprovedPerformanceType int32
|
type ImprovedPerformanceType int32
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@@ -1,106 +0,0 @@
|
|||||||
// Code generated by "enumer -type ImprovedPerformanceType -trimprefix ImprovedPerformanceType -text"; DO NOT EDIT.
|
|
||||||
|
|
||||||
package feature
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"strings"
|
|
||||||
)
|
|
||||||
|
|
||||||
const _ImprovedPerformanceTypeName = "UnspecifiedOrgByIDProjectGrantProjectUserGrantOrgDomainVerified"
|
|
||||||
|
|
||||||
var _ImprovedPerformanceTypeIndex = [...]uint8{0, 11, 18, 30, 37, 46, 63}
|
|
||||||
|
|
||||||
const _ImprovedPerformanceTypeLowerName = "unspecifiedorgbyidprojectgrantprojectusergrantorgdomainverified"
|
|
||||||
|
|
||||||
func (i ImprovedPerformanceType) String() string {
|
|
||||||
if i < 0 || i >= ImprovedPerformanceType(len(_ImprovedPerformanceTypeIndex)-1) {
|
|
||||||
return fmt.Sprintf("ImprovedPerformanceType(%d)", i)
|
|
||||||
}
|
|
||||||
return _ImprovedPerformanceTypeName[_ImprovedPerformanceTypeIndex[i]:_ImprovedPerformanceTypeIndex[i+1]]
|
|
||||||
}
|
|
||||||
|
|
||||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
|
||||||
// Re-run the stringer command to generate them again.
|
|
||||||
func _ImprovedPerformanceTypeNoOp() {
|
|
||||||
var x [1]struct{}
|
|
||||||
_ = x[ImprovedPerformanceTypeUnspecified-(0)]
|
|
||||||
_ = x[ImprovedPerformanceTypeOrgByID-(1)]
|
|
||||||
_ = x[ImprovedPerformanceTypeProjectGrant-(2)]
|
|
||||||
_ = x[ImprovedPerformanceTypeProject-(3)]
|
|
||||||
_ = x[ImprovedPerformanceTypeUserGrant-(4)]
|
|
||||||
_ = x[ImprovedPerformanceTypeOrgDomainVerified-(5)]
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ImprovedPerformanceTypeValues = []ImprovedPerformanceType{ImprovedPerformanceTypeUnspecified, ImprovedPerformanceTypeOrgByID, ImprovedPerformanceTypeProjectGrant, ImprovedPerformanceTypeProject, ImprovedPerformanceTypeUserGrant, ImprovedPerformanceTypeOrgDomainVerified}
|
|
||||||
|
|
||||||
var _ImprovedPerformanceTypeNameToValueMap = map[string]ImprovedPerformanceType{
|
|
||||||
_ImprovedPerformanceTypeName[0:11]: ImprovedPerformanceTypeUnspecified,
|
|
||||||
_ImprovedPerformanceTypeLowerName[0:11]: ImprovedPerformanceTypeUnspecified,
|
|
||||||
_ImprovedPerformanceTypeName[11:18]: ImprovedPerformanceTypeOrgByID,
|
|
||||||
_ImprovedPerformanceTypeLowerName[11:18]: ImprovedPerformanceTypeOrgByID,
|
|
||||||
_ImprovedPerformanceTypeName[18:30]: ImprovedPerformanceTypeProjectGrant,
|
|
||||||
_ImprovedPerformanceTypeLowerName[18:30]: ImprovedPerformanceTypeProjectGrant,
|
|
||||||
_ImprovedPerformanceTypeName[30:37]: ImprovedPerformanceTypeProject,
|
|
||||||
_ImprovedPerformanceTypeLowerName[30:37]: ImprovedPerformanceTypeProject,
|
|
||||||
_ImprovedPerformanceTypeName[37:46]: ImprovedPerformanceTypeUserGrant,
|
|
||||||
_ImprovedPerformanceTypeLowerName[37:46]: ImprovedPerformanceTypeUserGrant,
|
|
||||||
_ImprovedPerformanceTypeName[46:63]: ImprovedPerformanceTypeOrgDomainVerified,
|
|
||||||
_ImprovedPerformanceTypeLowerName[46:63]: ImprovedPerformanceTypeOrgDomainVerified,
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ImprovedPerformanceTypeNames = []string{
|
|
||||||
_ImprovedPerformanceTypeName[0:11],
|
|
||||||
_ImprovedPerformanceTypeName[11:18],
|
|
||||||
_ImprovedPerformanceTypeName[18:30],
|
|
||||||
_ImprovedPerformanceTypeName[30:37],
|
|
||||||
_ImprovedPerformanceTypeName[37:46],
|
|
||||||
_ImprovedPerformanceTypeName[46:63],
|
|
||||||
}
|
|
||||||
|
|
||||||
// ImprovedPerformanceTypeString retrieves an enum value from the enum constants string name.
|
|
||||||
// Throws an error if the param is not part of the enum.
|
|
||||||
func ImprovedPerformanceTypeString(s string) (ImprovedPerformanceType, error) {
|
|
||||||
if val, ok := _ImprovedPerformanceTypeNameToValueMap[s]; ok {
|
|
||||||
return val, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
if val, ok := _ImprovedPerformanceTypeNameToValueMap[strings.ToLower(s)]; ok {
|
|
||||||
return val, nil
|
|
||||||
}
|
|
||||||
return 0, fmt.Errorf("%s does not belong to ImprovedPerformanceType values", s)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ImprovedPerformanceTypeValues returns all values of the enum
|
|
||||||
func ImprovedPerformanceTypeValues() []ImprovedPerformanceType {
|
|
||||||
return _ImprovedPerformanceTypeValues
|
|
||||||
}
|
|
||||||
|
|
||||||
// ImprovedPerformanceTypeStrings returns a slice of all String values of the enum
|
|
||||||
func ImprovedPerformanceTypeStrings() []string {
|
|
||||||
strs := make([]string, len(_ImprovedPerformanceTypeNames))
|
|
||||||
copy(strs, _ImprovedPerformanceTypeNames)
|
|
||||||
return strs
|
|
||||||
}
|
|
||||||
|
|
||||||
// IsAImprovedPerformanceType returns "true" if the value is listed in the enum definition. "false" otherwise
|
|
||||||
func (i ImprovedPerformanceType) IsAImprovedPerformanceType() bool {
|
|
||||||
for _, v := range _ImprovedPerformanceTypeValues {
|
|
||||||
if i == v {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// MarshalText implements the encoding.TextMarshaler interface for ImprovedPerformanceType
|
|
||||||
func (i ImprovedPerformanceType) MarshalText() ([]byte, error) {
|
|
||||||
return []byte(i.String()), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// UnmarshalText implements the encoding.TextUnmarshaler interface for ImprovedPerformanceType
|
|
||||||
func (i *ImprovedPerformanceType) UnmarshalText(text []byte) error {
|
|
||||||
var err error
|
|
||||||
*i, err = ImprovedPerformanceTypeString(string(text))
|
|
||||||
return err
|
|
||||||
}
|
|
Reference in New Issue
Block a user