From 9309666f5049424954e55f162c29b0c11b512133 Mon Sep 17 00:00:00 2001 From: Manoj M J Date: Fri, 29 Jan 2021 14:45:47 +0530 Subject: Remove session duration information from output of 2fa_verify command This change removes session duration information from output of 2fa_verify command --- internal/command/twofactorverify/twofactorverify.go | 2 +- internal/command/twofactorverify/twofactorverify_test.go | 2 +- spec/gitlab_shell_two_factor_verify_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/command/twofactorverify/twofactorverify.go b/internal/command/twofactorverify/twofactorverify.go index afd8e47..b1c5508 100644 --- a/internal/command/twofactorverify/twofactorverify.go +++ b/internal/command/twofactorverify/twofactorverify.go @@ -46,7 +46,7 @@ func (c *Command) verifyOTP(ctx context.Context, otp string) error { err = client.VerifyOTP(ctx, c.Args, otp) if err == nil { - fmt.Fprint(c.ReadWriter.Out, "\nOTP validation successful. Git operations are allowed for the next 15 minutes.\n") + fmt.Fprint(c.ReadWriter.Out, "\nOTP validation successful. Git operations are now allowed.\n") } else { fmt.Fprintf(c.ReadWriter.Out, "\nOTP validation failed.\n%v\n", err) } diff --git a/internal/command/twofactorverify/twofactorverify_test.go b/internal/command/twofactorverify/twofactorverify_test.go index 08eb380..9d5f54d 100644 --- a/internal/command/twofactorverify/twofactorverify_test.go +++ b/internal/command/twofactorverify/twofactorverify_test.go @@ -74,7 +74,7 @@ func TestExecute(t *testing.T) { arguments: &commandargs.Shell{GitlabKeyId: "1"}, answer: "123456\n", expectedOutput: question + - "OTP validation successful. Git operations are allowed for the next 15 minutes.\n", + "OTP validation successful. Git operations are now allowed.\n", }, { desc: "With bad response", diff --git a/spec/gitlab_shell_two_factor_verify_spec.rb b/spec/gitlab_shell_two_factor_verify_spec.rb index a9ce40d..25d8869 100644 --- a/spec/gitlab_shell_two_factor_verify_spec.rb +++ b/spec/gitlab_shell_two_factor_verify_spec.rb @@ -75,7 +75,7 @@ describe 'bin/gitlab-shell 2fa_verify' do stdin.puts('123456') - expect(stdout.flush.read).to eq("\nOTP validation successful. Git operations are allowed for the next 15 minutes.\n") + expect(stdout.flush.read).to eq("\nOTP validation successful. Git operations are now allowed.\n") end end end -- cgit v1.2.1