Skip to content

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

Notifications You must be signed in to change notification settings

AlfredoFilho/Password-Strength-Checker

Repository files navigation

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages