Skip to main content

fastapi-authz-lite: plug-and-play authentication for FastAPI (JWT, password hashing, dependencies).

Project description

fastapi-auth-kit

fastapi-auth-kit provides plug-and-play authentication for FastAPI.

Features (v0.1.0)

  • JWT access token creation + verification
  • Password hashing (bcrypt)
  • FastAPI dependency: require_user()

Refresh tokens + OAuth planned for v0.2+.

Install

pip install fastapi-auth-kit

Quick example

from fastapi import FastAPI, Depends
from fastapi_auth_kit import AuthKit, AuthConfig

app = FastAPI()

auth = AuthKit(AuthConfig(secret_key="supersecret"))

@app.post("/login")
def login(username: str):
    token = auth.create_access_token({"sub": username})
    return {"access_token": token}

@app.get("/me")
def me(user=Depends(auth.require_user())):
    return user

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_authz_lite-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_authz_lite-0.1.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_authz_lite-0.1.0.tar.gz.

File metadata

  • Download URL: fastapi_authz_lite-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fastapi_authz_lite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ae993cffcfefea720a86107d0ef0cd337d71f523b27779d9052c1d082be47942
MD5 c41245f25f63d2d11fc3337f722dac81
BLAKE2b-256 9a531169ca35d2d3a62a02f12cfdc952eaddc99ea59290f91692231eedee667b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_authz_lite-0.1.0.tar.gz:

Publisher: publish.yml on Kubenew/fastapi-auth-kit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fastapi_authz_lite-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fastapi_authz_lite-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a86b746b811866c1ed39a30017be1f0354e4101071b167b16e7ba85345618071
MD5 2b59490ded8be01b931cb8a6404f00f1
BLAKE2b-256 3041738ff6e6934c1ebac601654b4f9da4880705a2cb0ba9f598875cb312888f

See more details on using hashes here.

Provenance

The following attestation bundles were made for fastapi_authz_lite-0.1.0-py3-none-any.whl:

Publisher: publish.yml on Kubenew/fastapi-auth-kit

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page