Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature(authentication): allow user to retry input password #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

khangnkn
Copy link
Contributor

  • allow user to retry authentication.
  • add time delay when password verification failed to avoid brute-force
    password.

+ allow user to retry authentication.
+ add time delay when password verification failed to avoid brute-force
password.
Copy link
Collaborator

@ltpquang ltpquang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nkhang please take a look

@@ -14,7 +15,9 @@ import (
)

var (
ppidStr = fmt.Sprintf("%d", os.Getppid())
ppidStr = fmt.Sprintf("%d", os.Getppid())
loginMaxRetries = 3
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nkhang I think this can be clearer. Is number 3 Retries? You mean maxLogin?

ppidStr = fmt.Sprintf("%d", os.Getppid())
ppidStr = fmt.Sprintf("%d", os.Getppid())
loginMaxRetries = 3
failedLogInWaitTime = time.Second
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nkhang I think we need to be consistent on Login vs LogIn, also Time is quite unclear

err = s.doLogin()
if err != nil {
var isLoggedIn = false
for i := 0; i < loginMaxRetries; i++ {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nkhang should we extract login and retrying login logics to another method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants