Skip to content

Latest commit

 

History

History
89 lines (63 loc) · 3.54 KB

README.md

File metadata and controls

89 lines (63 loc) · 3.54 KB

Password Verifiers

This project was born to solve the problem of passwords security level checking and it's based on the business rule.

A valid password must pass in these criterias:

  • Nine or more characters
  • At least 1 digit
  • At least 1 lower character
  • At least 1 upper character
  • At least 1 special character which must to be !@#$%^&*()-+
  • It can't contains repeated characters
  • It can't contains empty spaces

Click here to see more details about the specifications.

Design

This project was designed to follow the principles of DDD which is responsible to advocates modeling based on the reality of business as relevant to your use cases. In the context of building applications, DDD talks about problems as domains.

VerifiersDesign

Design Patterns

In this project we needed to use the pattern Chain Of Responsibility to make sure that passwords are valid and respecting the business rules. You could check here the use of the pattern. Also it was divided into value objects containing the password assert rules, which are:

How to run and test it

  • Clone:

      git clone [email protected]:anzileiro/verifiers.git
    
  • Run:

      dotnet run --project Verifiers.Web/Verifiers.Web.csproj
    

    In case of a valid password:

     curl -X GET "https://localhost:5001/v1/Verifiers/passwords/abcdefghkl1@P"
    
    { 
      "id":"17fe1a6c-9a82-4c09-aaeb-a9d376273dc7",
      "valid":true,
      "message":"The password matches all verifiers and it is valid."
     }

    In case of an invalid password:

     curl -X GET "https://localhost:5001/v1/Verifiers/passwords/abcdefghkl1@"
    
    { 
      "id":"ce37d6d7-fb16-45f3-901d-70e25762ce58",
      "valid":false,
      "message":"The password must contains 1 or more upper characters."
     }

    Also you could access and test from web:

    https://localhost:5001/swagger/index.html

  • Test:

      dotnet test