{"id":22736981,"url":"https://github.com/emadb/password_validator_kata","last_synced_at":"2025-03-30T03:15:08.543Z","repository":{"id":206639228,"uuid":"717358861","full_name":"emadb/password_validator_kata","owner":"emadb","description":"The Password Validation Kata in Elixir","archived":false,"fork":false,"pushed_at":"2023-11-11T08:26:22.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-05T05:29:38.573Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/emadb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-11-11T08:22:37.000Z","updated_at":"2023-11-11T08:22:56.000Z","dependencies_parsed_at":"2023-11-11T09:36:09.984Z","dependency_job_id":null,"html_url":"https://github.com/emadb/password_validator_kata","commit_stats":null,"previous_names":["emadb/password_validator_kata"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emadb%2Fpassword_validator_kata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emadb%2Fpassword_validator_kata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emadb%2Fpassword_validator_kata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emadb%2Fpassword_validator_kata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emadb","download_url":"https://codeload.github.com/emadb/password_validator_kata/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246269933,"owners_count":20750321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-10T22:08:46.523Z","updated_at":"2025-03-30T03:15:08.521Z","avatar_url":"https://github.com/emadb.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Password Validation Kata\nTaken from [Codurance](https://www.codurance.com/katas/password-validation)\n\n_Resolved in [Elixir](https://elixir-lang.org) using recursion (no loops!) an a functional approach. Each validator is a pure function._\n\n## Iteration 1 - Basic password validation\n\n### Goal\n\nDesign and implement a software that validates a password applying TDD.\n\nThe password will be introduced by the user (as an argument of the method) and should return if the password is valid or not.\n\nA valid password should meet the following requirements:\n\n* Have more than 8 characters\n* Contains a capital letter\n* Contains a lowercase\n* Contains a number\n* Contains an underscore\n\n⠀\n## Technical requirements:\n\n* We want a method that answers if the password is valid or not.\n* We don't want to know the reason when the password is invalid (the return value is a boolean)\n\n⠀\n## Iteration 2 - Rules abstraction\n\n### Goal\n\nDesign and implement software that can adapt to different password validation rules TDD and focus on the OOP principles.\n\nLet's pretend that now we want to create another type of password validations because on our app we need different type of passwords, such as:\n\nValidation 2:\n\n* Have more than 6 characters\n* Contains a capital letter\n* Contains a lowercase\n* Contains a number\n\n⠀\nValidation 3:\n\n* Have more than 16 characters\n* Contains a capital letter\n* Contains a lowercase\n* Contains an underscore\n\n⠀\n### Things to practice\n\nIn this iteration, we should try to identify a good abstraction and try to work on OOP principles as well as on design patterns like Builder and Factory\n\n### Interesting restrictions\n\nUse object calisthenics.\n\n## Iteration 3 - Multiple errors\n\n### Goal\n\nNow we can know if a password is valid or not, but we cannot understand why, in this iteration, we should be able to return a list of errors for each invalid password, so we could know why the password it's not valid.\n\n### Things to practice\n\nIdentify how maintainable it's the code that you've built so far, and how it adapts to change, this iteration could change depending on the programming language that you use.\n\n## Iteration 4 - Validation strategy\n\n### Goal\n\nUp untill this point we've been able to create a list of validation rules and validate the password passes all the validation rules, but now we want a new password with the same rules but allowing to fail only one of them.\n\nValidation 4\n\n* Have more than 8 characters\n* Contains a capital letter\n* Contains a number\n* Contains an underscore\n\n⠀\nExamples:\n\n* Have more than 8 characters ✅\n* Contains a capital letter ✅\n* Contains a number ✅\n* Contains an underscore ❌\n\n⠀\nThis password it's a valid password\n\n### Things to practice\n\nThis will help to enforce encapsulation for the lists of rules and have a better design for validation strategies [preventing us from using inheritance], this also could help us work on the Strategy pattern.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femadb%2Fpassword_validator_kata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femadb%2Fpassword_validator_kata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femadb%2Fpassword_validator_kata/lists"}