chore(oidc): remove legacy storage methods (#10061)

# Which Problems Are Solved

Stabilize the optimized introspection code and cleanup unused code.

# How the Problems Are Solved

- `oidc_legacy_introspection` feature flag is removed and reserved.
- `OPStorage` which are no longer needed have their bodies removed.
- The method definitions need to remain in place so the interface
remains implemented.
  - A panic is thrown in case any such method is still called

# Additional Changes

- A number of `OPStorage` methods related to token creation were already
unused. These are also cleaned up.

# Additional Context

- Closes #10027 
- #7822

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
Tim Möhlmann
2025-06-26 11:08:37 +03:00
committed by GitHub
parent 27f88a6390
commit 1ebbe275b9
71 changed files with 143 additions and 1884 deletions

View File

@@ -9,22 +9,22 @@ import (
type Key int
const (
KeyUnspecified Key = iota
KeyLoginDefaultOrg
KeyTriggerIntrospectionProjections
KeyLegacyIntrospection
KeyUserSchema
KeyTokenExchange
KeyActionsDeprecated
KeyImprovedPerformance
KeyWebKey
KeyDebugOIDCParentError
KeyOIDCSingleV1SessionTermination
KeyDisableUserTokenEvent
KeyEnableBackChannelLogout
KeyLoginV2
KeyPermissionCheckV2
KeyConsoleUseV2UserApi
// Reserved: 3, 6
KeyUnspecified Key = 0
KeyLoginDefaultOrg Key = 1
KeyTriggerIntrospectionProjections Key = 2
KeyUserSchema Key = 4
KeyTokenExchange Key = 5
KeyImprovedPerformance Key = 7
KeyWebKey Key = 8
KeyDebugOIDCParentError Key = 9
KeyOIDCSingleV1SessionTermination Key = 10
KeyDisableUserTokenEvent Key = 11
KeyEnableBackChannelLogout Key = 12
KeyLoginV2 Key = 13
KeyPermissionCheckV2 Key = 14
KeyConsoleUseV2UserApi Key = 15
)
//go:generate enumer -type Level -transform snake -trimprefix Level
@@ -43,7 +43,6 @@ const (
type Features struct {
LoginDefaultOrg bool `json:"login_default_org,omitempty"`
TriggerIntrospectionProjections bool `json:"trigger_introspection_projections,omitempty"`
LegacyIntrospection bool `json:"legacy_introspection,omitempty"`
UserSchema bool `json:"user_schema,omitempty"`
TokenExchange bool `json:"token_exchange,omitempty"`
ImprovedPerformance []ImprovedPerformanceType `json:"improved_performance,omitempty"`

View File

@@ -12,7 +12,6 @@ func TestKey(t *testing.T) {
"unspecified",
"login_default_org",
"trigger_introspection_projections",
"legacy_introspection",
}
for _, want := range tests {
t.Run(want, func(t *testing.T) {

View File

@@ -7,17 +7,34 @@ import (
"strings"
)
const _KeyName = "unspecifiedlogin_default_orgtrigger_introspection_projectionslegacy_introspectionuser_schematoken_exchangeactions_deprecatedimproved_performanceweb_keydebug_oidc_parent_erroroidc_single_v1_session_terminationdisable_user_token_eventenable_back_channel_logoutlogin_v2permission_check_v2console_use_v2_user_api"
const (
_KeyName_0 = "unspecifiedlogin_default_orgtrigger_introspection_projections"
_KeyLowerName_0 = "unspecifiedlogin_default_orgtrigger_introspection_projections"
_KeyName_1 = "user_schematoken_exchange"
_KeyLowerName_1 = "user_schematoken_exchange"
_KeyName_2 = "improved_performanceweb_keydebug_oidc_parent_erroroidc_single_v1_session_terminationdisable_user_token_eventenable_back_channel_logoutlogin_v2permission_check_v2console_use_v2_user_api"
_KeyLowerName_2 = "improved_performanceweb_keydebug_oidc_parent_erroroidc_single_v1_session_terminationdisable_user_token_eventenable_back_channel_logoutlogin_v2permission_check_v2console_use_v2_user_api"
)
var _KeyIndex = [...]uint16{0, 11, 28, 61, 81, 92, 106, 124, 144, 151, 174, 208, 232, 258, 266, 285, 308}
const _KeyLowerName = "unspecifiedlogin_default_orgtrigger_introspection_projectionslegacy_introspectionuser_schematoken_exchangeactions_deprecatedimproved_performanceweb_keydebug_oidc_parent_erroroidc_single_v1_session_terminationdisable_user_token_eventenable_back_channel_logoutlogin_v2permission_check_v2console_use_v2_user_api"
var (
_KeyIndex_0 = [...]uint8{0, 11, 28, 61}
_KeyIndex_1 = [...]uint8{0, 11, 25}
_KeyIndex_2 = [...]uint8{0, 20, 27, 50, 84, 108, 134, 142, 161, 184}
)
func (i Key) String() string {
if i < 0 || i >= Key(len(_KeyIndex)-1) {
switch {
case 0 <= i && i <= 2:
return _KeyName_0[_KeyIndex_0[i]:_KeyIndex_0[i+1]]
case 4 <= i && i <= 5:
i -= 4
return _KeyName_1[_KeyIndex_1[i]:_KeyIndex_1[i+1]]
case 7 <= i && i <= 15:
i -= 7
return _KeyName_2[_KeyIndex_2[i]:_KeyIndex_2[i+1]]
default:
return fmt.Sprintf("Key(%d)", i)
}
return _KeyName[_KeyIndex[i]:_KeyIndex[i+1]]
}
// An "invalid array index" compiler error signifies that the constant values have changed.
@@ -27,10 +44,8 @@ func _KeyNoOp() {
_ = x[KeyUnspecified-(0)]
_ = x[KeyLoginDefaultOrg-(1)]
_ = x[KeyTriggerIntrospectionProjections-(2)]
_ = x[KeyLegacyIntrospection-(3)]
_ = x[KeyUserSchema-(4)]
_ = x[KeyTokenExchange-(5)]
_ = x[KeyActionsDeprecated-(6)]
_ = x[KeyImprovedPerformance-(7)]
_ = x[KeyWebKey-(8)]
_ = x[KeyDebugOIDCParentError-(9)]
@@ -42,60 +57,54 @@ func _KeyNoOp() {
_ = x[KeyConsoleUseV2UserApi-(15)]
}
var _KeyValues = []Key{KeyUnspecified, KeyLoginDefaultOrg, KeyTriggerIntrospectionProjections, KeyLegacyIntrospection, KeyUserSchema, KeyTokenExchange, KeyActionsDeprecated, KeyImprovedPerformance, KeyWebKey, KeyDebugOIDCParentError, KeyOIDCSingleV1SessionTermination, KeyDisableUserTokenEvent, KeyEnableBackChannelLogout, KeyLoginV2, KeyPermissionCheckV2, KeyConsoleUseV2UserApi}
var _KeyValues = []Key{KeyUnspecified, KeyLoginDefaultOrg, KeyTriggerIntrospectionProjections, KeyUserSchema, KeyTokenExchange, KeyImprovedPerformance, KeyWebKey, KeyDebugOIDCParentError, KeyOIDCSingleV1SessionTermination, KeyDisableUserTokenEvent, KeyEnableBackChannelLogout, KeyLoginV2, KeyPermissionCheckV2, KeyConsoleUseV2UserApi}
var _KeyNameToValueMap = map[string]Key{
_KeyName[0:11]: KeyUnspecified,
_KeyLowerName[0:11]: KeyUnspecified,
_KeyName[11:28]: KeyLoginDefaultOrg,
_KeyLowerName[11:28]: KeyLoginDefaultOrg,
_KeyName[28:61]: KeyTriggerIntrospectionProjections,
_KeyLowerName[28:61]: KeyTriggerIntrospectionProjections,
_KeyName[61:81]: KeyLegacyIntrospection,
_KeyLowerName[61:81]: KeyLegacyIntrospection,
_KeyName[81:92]: KeyUserSchema,
_KeyLowerName[81:92]: KeyUserSchema,
_KeyName[92:106]: KeyTokenExchange,
_KeyLowerName[92:106]: KeyTokenExchange,
_KeyName[106:124]: KeyActionsDeprecated,
_KeyLowerName[106:124]: KeyActionsDeprecated,
_KeyName[124:144]: KeyImprovedPerformance,
_KeyLowerName[124:144]: KeyImprovedPerformance,
_KeyName[144:151]: KeyWebKey,
_KeyLowerName[144:151]: KeyWebKey,
_KeyName[151:174]: KeyDebugOIDCParentError,
_KeyLowerName[151:174]: KeyDebugOIDCParentError,
_KeyName[174:208]: KeyOIDCSingleV1SessionTermination,
_KeyLowerName[174:208]: KeyOIDCSingleV1SessionTermination,
_KeyName[208:232]: KeyDisableUserTokenEvent,
_KeyLowerName[208:232]: KeyDisableUserTokenEvent,
_KeyName[232:258]: KeyEnableBackChannelLogout,
_KeyLowerName[232:258]: KeyEnableBackChannelLogout,
_KeyName[258:266]: KeyLoginV2,
_KeyLowerName[258:266]: KeyLoginV2,
_KeyName[266:285]: KeyPermissionCheckV2,
_KeyLowerName[266:285]: KeyPermissionCheckV2,
_KeyName[285:308]: KeyConsoleUseV2UserApi,
_KeyLowerName[285:308]: KeyConsoleUseV2UserApi,
_KeyName_0[0:11]: KeyUnspecified,
_KeyLowerName_0[0:11]: KeyUnspecified,
_KeyName_0[11:28]: KeyLoginDefaultOrg,
_KeyLowerName_0[11:28]: KeyLoginDefaultOrg,
_KeyName_0[28:61]: KeyTriggerIntrospectionProjections,
_KeyLowerName_0[28:61]: KeyTriggerIntrospectionProjections,
_KeyName_1[0:11]: KeyUserSchema,
_KeyLowerName_1[0:11]: KeyUserSchema,
_KeyName_1[11:25]: KeyTokenExchange,
_KeyLowerName_1[11:25]: KeyTokenExchange,
_KeyName_2[0:20]: KeyImprovedPerformance,
_KeyLowerName_2[0:20]: KeyImprovedPerformance,
_KeyName_2[20:27]: KeyWebKey,
_KeyLowerName_2[20:27]: KeyWebKey,
_KeyName_2[27:50]: KeyDebugOIDCParentError,
_KeyLowerName_2[27:50]: KeyDebugOIDCParentError,
_KeyName_2[50:84]: KeyOIDCSingleV1SessionTermination,
_KeyLowerName_2[50:84]: KeyOIDCSingleV1SessionTermination,
_KeyName_2[84:108]: KeyDisableUserTokenEvent,
_KeyLowerName_2[84:108]: KeyDisableUserTokenEvent,
_KeyName_2[108:134]: KeyEnableBackChannelLogout,
_KeyLowerName_2[108:134]: KeyEnableBackChannelLogout,
_KeyName_2[134:142]: KeyLoginV2,
_KeyLowerName_2[134:142]: KeyLoginV2,
_KeyName_2[142:161]: KeyPermissionCheckV2,
_KeyLowerName_2[142:161]: KeyPermissionCheckV2,
_KeyName_2[161:184]: KeyConsoleUseV2UserApi,
_KeyLowerName_2[161:184]: KeyConsoleUseV2UserApi,
}
var _KeyNames = []string{
_KeyName[0:11],
_KeyName[11:28],
_KeyName[28:61],
_KeyName[61:81],
_KeyName[81:92],
_KeyName[92:106],
_KeyName[106:124],
_KeyName[124:144],
_KeyName[144:151],
_KeyName[151:174],
_KeyName[174:208],
_KeyName[208:232],
_KeyName[232:258],
_KeyName[258:266],
_KeyName[266:285],
_KeyName[285:308],
_KeyName_0[0:11],
_KeyName_0[11:28],
_KeyName_0[28:61],
_KeyName_1[0:11],
_KeyName_1[11:25],
_KeyName_2[0:20],
_KeyName_2[20:27],
_KeyName_2[27:50],
_KeyName_2[50:84],
_KeyName_2[84:108],
_KeyName_2[108:134],
_KeyName_2[134:142],
_KeyName_2[142:161],
_KeyName_2[161:184],
}
// KeyString retrieves an enum value from the enum constants string name.