fix(api): deprecate settings v2beta endpoints (#10909)

# Which Problems Are Solved

As part of our efforts to simplify the structure and versions of our
APIs, were moving all existing v2beta endpoints to v2 and deprecate
them. They will be removed in Zitadel V5.

# How the Problems Are Solved

- This PR deprecates all settings v2beta service and endpoints.
- The comments and have been improved and, where not already done, moved
from swagger annotations to proto.
- `LoginSettings`:
- `AllowUsernamePassword` has been deprecated and a corresponding
`AllowLocalAuthentication` has been introduced
- `SECOND_FACTOR_TYPE_OTP` has been deprecated and a
`SECOND_FACTOR_TYPE_TOTP` has been introduced as enum alias

# Additional Changes

- cleanups of some unused structs

# Additional Context

- part of https://github.com/zitadel/zitadel/issues/10772
- requires backport to v4.x
This commit is contained in:
Livio Spring
2025-10-17 09:02:26 +00:00
committed by GitHub
parent 0281670030
commit dbf877e028
13 changed files with 419 additions and 251 deletions
-2
View File
@@ -25,8 +25,6 @@ type Server struct {
assetsAPIDomain func(context.Context) string
}
type Config struct{}
func CreateServer(
command *command.Commands,
query *query.Queries,
@@ -25,6 +25,7 @@ func loginSettingsToPb(current *query.LoginPolicy) *settings.LoginSettings {
return &settings.LoginSettings{
AllowUsernamePassword: current.AllowUsernamePassword,
AllowLocalAuthentication: current.AllowUsernamePassword,
AllowRegister: current.AllowRegister,
AllowExternalIdp: current.AllowExternalIDPs,
ForceMfa: current.ForceMFA,
@@ -68,7 +69,7 @@ func passkeysTypeToPb(passwordlessType domain.PasswordlessType) settings.Passkey
func secondFactorTypeToPb(secondFactorType domain.SecondFactorType) settings.SecondFactorType {
switch secondFactorType {
case domain.SecondFactorTypeTOTP:
return settings.SecondFactorType_SECOND_FACTOR_TYPE_OTP
return settings.SecondFactorType_SECOND_FACTOR_TYPE_TOTP
case domain.SecondFactorTypeU2F:
return settings.SecondFactorType_SECOND_FACTOR_TYPE_U2F
case domain.SecondFactorTypeOTPEmail:
@@ -55,6 +55,7 @@ func Test_loginSettingsToPb(t *testing.T) {
want := &settings.LoginSettings{
AllowUsernamePassword: true,
AllowLocalAuthentication: true,
AllowRegister: true,
AllowExternalIdp: true,
ForceMfa: true,
@@ -153,8 +154,13 @@ func Test_secondFactorTypeToPb(t *testing.T) {
want settings.SecondFactorType
}{
{
// making sure it doesn't break existing mappings
args: args{domain.SecondFactorTypeTOTP},
want: settings.SecondFactorType_SECOND_FACTOR_TYPE_OTP,
want: settings.SecondFactorType_SECOND_FACTOR_TYPE_OTP, //nolint:staticcheck
},
{
args: args{domain.SecondFactorTypeTOTP},
want: settings.SecondFactorType_SECOND_FACTOR_TYPE_TOTP,
},
{
args: args{domain.SecondFactorTypeU2F},