Skip to main content

Source code:https://github.com/coderxuz/securely

Securely

Securely is a Python package that helps with authentication and authorization in FastAPI applications.

Installation

You can install the package via pip:

pip install securely

Quick start

from securely import Auth
from fastapi import FastAPI


from datetime import timedelta

app = FastAPI()

auth = Auth(
    secret_key="bla bla",
    access_token_expires=timedelta(days=1),
    refresh_token_expires=timedelta(days=7),
)

just_db = [{"username": "john", "password": "gdfdfgdgdrgdr"}]


@app.post("/login")
async def login(data: dict):
    new_user = {"username": data.get("username")}

    new_user["password"] = auth.hash_password(password=data.get("password"))

    just_db.append(new_user)

    tokens = auth.create_tokens(subject=new_user.get("username"))

    return tokens

Metadata

Release files for securely 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for securely 0.2.0
File Size Uploaded Provenance Actions
securely-0.2.0.tar.gz 2.7 kB Without provenance Details for securely-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for securely 0.2.0
File Interpreter ABI Platform Actions
securely-0.2.0-py3-none-any.whl Python 3 none any Details for securely-0.2.0-py3-none-any.whl

Total release size: 5.6 kB

Release files / securely-0.2.0.tar.gz

Download URL securely-0.2.0.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d13df10a7734fee6cb9858f81e66b827707940da2c3e62d918b8847a6bef8f15
BLAKE2b-256 checksum
How to use checksums
089855ff804761dba66e36eafe87701b79ff4ba6e467e58ab792b0e882b7bbb1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release files / securely-0.2.0-py3-none-any.whl

Download URL securely-0.2.0-py3-none-any.whl
Size 2.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cbe33e286654e0e05caca7daa66dcb9c07bb05eca4eff2e137e240ca984cfe49
BLAKE2b-256 checksum
How to use checksums
1a5c5ded031b22ea15126234b73a4e58d1a9b472dbf54b2063301d5004dcac85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Security for securely 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page