fix: rename (t)otp to code in session checks (#6455)

* fix: rename (t)otp to code in session checks

* update integration tests

---------

Co-authored-by: Fabi <fabienne@zitadel.com>
This commit is contained in:
Livio Spring 2023-08-31 09:06:50 +02:00 committed by GitHub
parent e17b49e4ca
commit 3c8640fbfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -275,13 +275,13 @@ func (s *Server) checksToCommand(ctx context.Context, checks *session.Checks) ([
sessionChecks = append(sessionChecks, s.command.CheckWebAuthN(passkey.GetCredentialAssertionData()))
}
if totp := checks.GetTotp(); totp != nil {
sessionChecks = append(sessionChecks, command.CheckTOTP(totp.GetTotp()))
sessionChecks = append(sessionChecks, command.CheckTOTP(totp.GetCode()))
}
if otp := checks.GetOtpSms(); otp != nil {
sessionChecks = append(sessionChecks, command.CheckOTPSMS(otp.GetOtp()))
sessionChecks = append(sessionChecks, command.CheckOTPSMS(otp.GetCode()))
}
if otp := checks.GetOtpEmail(); otp != nil {
sessionChecks = append(sessionChecks, command.CheckOTPEmail(otp.GetOtp()))
sessionChecks = append(sessionChecks, command.CheckOTPEmail(otp.GetCode()))
}
return sessionChecks, nil
}

View File

@ -504,7 +504,7 @@ func TestServer_SetSession_flow(t *testing.T) {
SessionToken: sessionToken,
Checks: &session.Checks{
Totp: &session.CheckTOTP{
Totp: code,
Code: code,
},
},
})
@ -533,7 +533,7 @@ func TestServer_SetSession_flow(t *testing.T) {
SessionToken: sessionToken,
Checks: &session.Checks{
OtpSms: &session.CheckOTP{
Otp: otp,
Code: otp,
},
},
})
@ -564,7 +564,7 @@ func TestServer_SetSession_flow(t *testing.T) {
SessionToken: sessionToken,
Checks: &session.Checks{
OtpEmail: &session.CheckOTP{
Otp: otp,
Code: otp,
},
},
})

View File

@ -458,7 +458,7 @@ message CheckIDPIntent {
}
message CheckTOTP {
string totp = 1 [
string code = 1 [
(validate.rules).string = {min_len: 6, max_len: 6},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
min_length: 6;
@ -469,7 +469,7 @@ message CheckTOTP {
}
message CheckOTP {
string otp = 1 [
string code = 1 [
(validate.rules).string = {min_len: 1},
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = {
min_length: 1;