6 kyu
Implement brute force protection
331int3_0xcc
Loading description...
Logic
Security
Fundamentals
Singleton
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
JS: Node v14 should be used along with its appropiate assertion tools (Mocha + Chai). Refer to this and this
Nice kata.
Inexplicably very satisfying Kata. Thanks :)
I see solutions that don't reset the count when called with a successful login. Is this tested for? Should this be tested for?
The kata is now testing for it and there's information about this requirement.
Good, simple kata. A couple of notes:
break-in
should bebreak in
.sourceIP
andsuccessful
could be simple arguments to the function. I don't think there's much reason for them to be nested in an object, and it just makes the code more verbose.Thanks for the input.
I fixed the typo.
I think it's important for people to solve Katas using objects, even such simple ones like this one. I think this website suffers a lot from not encouraging object use and I personally think that less parameters in a function is always better. Also, I will probably make a harder version also utilizing the request class which will have a little bit more data and some methods. For now I will leave the parameters as they are.
It doesn't necessarily make the code that much more verbose.
Take a look at my solution and at Destructuring assignment.
Then again, the difference between passing an object and just passing multiple arguments is two curly braces and your having to conform to the naming inside the object (but you can ignore arguments you don't want, and you can reshuffle them freely!). Might as well pass multiple arguments really, freedom to name variables feels like in some instances just too much to give up.
Marked as solved.