AlfredoFilho / Password-Strength-Checker

A FastAPI with GraphQL (Strawberry) to check strength of passwords

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Password Strength Checker

A FastAPI with GraphQL (Strawberry) to check strength of passwords

Example

Query input
query {
    verify(password: "TestStrengthPassword!123&", rules: [
        {rule: "minSize", value: 10},
        {rule: "minUppercase", value: 5},
        {rule: "minLowercase", value: 3},
        {rule: "minDigit", value: 2},
        {rule: "minSpecialChars", value: 2},
        {rule: "noRepeted", value: 0},
    ]) {
        verify
        noMatch
    }
}
Output
{
  "data": {
    "verify": {
      "verify": false,
      "noMatch": [
        "minUppercase",
        "minDigit",
        "noRepeted"
      ]
    }
  }
}

Dependencies

  • Python 3

How to use:

Install requirements
pip install -r requirements.txt
Run API
uvicorn main:app --reload --port 8000
Run Tests
python -m unittest test_rules_password.py

or

In the example_use.py file there is an example of a POST request in python
python example_use.py

About

A FastAPI with GraphQL (Strawberry) to check strength of passwords


Languages

Language:Python 100.0%