mirror of
https://github.com/andwati/zitadel.git
synced 2026-10-18 21:52:54 +00:00
# Which Problems Are Solved This PR marks the OIDC Back-Channel Logout as general available (GA). # How the Problems Are Solved - API: - deprecated the feature toggle (to prevent breaking changes) in v2beta and v2 API - removed all related event logic and updated the projection iteration - removed the toggle usage for back-channel logout - removed related translations - Management Console: - removed the feature toggle and its translations - Docs: - removed all beta labels and feature toggle notes # Additional Changes none # Additional Context - closes #11277 - requires backport to v4.x
127 lines
3.0 KiB
Go
127 lines
3.0 KiB
Go
package command
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/muhlemmer/gu"
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/zitadel/zitadel/internal/feature"
|
|
)
|
|
|
|
func Test_reduceInstanceFeature(t *testing.T) {
|
|
type args struct {
|
|
features *InstanceFeatures
|
|
key feature.Key
|
|
value any
|
|
}
|
|
tt := []struct {
|
|
name string
|
|
args args
|
|
expected *InstanceFeatures
|
|
}{
|
|
{
|
|
name: "key unspecified",
|
|
args: args{
|
|
features: &InstanceFeatures{},
|
|
key: feature.KeyUnspecified,
|
|
value: true,
|
|
},
|
|
expected: &InstanceFeatures{},
|
|
},
|
|
{
|
|
name: "login default org",
|
|
args: args{
|
|
features: &InstanceFeatures{},
|
|
key: feature.KeyLoginDefaultOrg,
|
|
value: true,
|
|
},
|
|
expected: &InstanceFeatures{LoginDefaultOrg: gu.Ptr(true)},
|
|
},
|
|
{
|
|
name: "user schema",
|
|
args: args{
|
|
features: &InstanceFeatures{},
|
|
key: feature.KeyUserSchema,
|
|
value: true,
|
|
},
|
|
expected: &InstanceFeatures{UserSchema: gu.Ptr(true)},
|
|
},
|
|
{
|
|
name: "improved performance",
|
|
args: args{
|
|
features: &InstanceFeatures{},
|
|
key: feature.KeyImprovedPerformance,
|
|
value: []feature.ImprovedPerformanceType{feature.ImprovedPerformanceTypeProject},
|
|
},
|
|
expected: &InstanceFeatures{ImprovedPerformance: []feature.ImprovedPerformanceType{feature.ImprovedPerformanceTypeProject}},
|
|
},
|
|
{
|
|
name: "debug OIDC parent error",
|
|
args: args{
|
|
features: &InstanceFeatures{},
|
|
key: feature.KeyDebugOIDCParentError,
|
|
value: true,
|
|
},
|
|
expected: &InstanceFeatures{DebugOIDCParentError: gu.Ptr(true)},
|
|
},
|
|
{
|
|
name: "OIDC single v1 session termination",
|
|
args: args{
|
|
features: &InstanceFeatures{},
|
|
key: feature.KeyOIDCSingleV1SessionTermination,
|
|
value: true,
|
|
},
|
|
expected: &InstanceFeatures{OIDCSingleV1SessionTermination: gu.Ptr(true)},
|
|
},
|
|
{
|
|
name: "login v2",
|
|
args: args{
|
|
features: &InstanceFeatures{},
|
|
key: feature.KeyLoginV2,
|
|
value: &feature.LoginV2{},
|
|
},
|
|
expected: &InstanceFeatures{LoginV2: &feature.LoginV2{}},
|
|
},
|
|
{
|
|
name: "permission check v2",
|
|
args: args{
|
|
features: &InstanceFeatures{},
|
|
key: feature.KeyPermissionCheckV2,
|
|
value: true,
|
|
},
|
|
expected: &InstanceFeatures{PermissionCheckV2: gu.Ptr(true)},
|
|
},
|
|
{
|
|
name: "management console uses v2 user api",
|
|
args: args{
|
|
features: &InstanceFeatures{},
|
|
key: feature.KeyManagementConsoleUseV2UserApi,
|
|
value: true,
|
|
},
|
|
expected: &InstanceFeatures{ManagementConsoleUseV2UserApi: gu.Ptr(true)},
|
|
},
|
|
{
|
|
name: "enable relational tables",
|
|
args: args{
|
|
features: &InstanceFeatures{},
|
|
key: feature.KeyEnableRelationalTables,
|
|
value: true,
|
|
},
|
|
expected: &InstanceFeatures{EnableRelationalTables: gu.Ptr(true)},
|
|
},
|
|
}
|
|
|
|
for _, tc := range tt {
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
// Test
|
|
reduceInstanceFeature(tc.args.features, tc.args.key, tc.args.value)
|
|
|
|
// Verify
|
|
assert.Equal(t, tc.expected, tc.args.features)
|
|
})
|
|
}
|
|
}
|