Skip to main content

rest-api-simple-auth-manager

Simple REST API authentication and authorization manager, designed to operate with token-based security. This package is intended to act as a middleware, providing a secure method for verifying user credentials before granting access to the requested resource.

The current implementation relies on a Redis instance to store and manage credentials. However, we are working on integrating other database options to offer more flexibility and customization.

Install

pip install rest_api_auth_manager

Initializing the auth manager

from rest_api_auth_manager import AuthManager, Config

class CustomConfig(Config):
    credentials_database_host = "127.0.0.1"
    environment = "dev"
    token_length = 16

auth_manager = AuthManager(CustomConfig)

Add new user

user = {
    "alias": "ASH_KETCHUM",
    "name": "Ash Ketchum",
    "email": "ash@test.com",
    "roles": ["pokemons:get"],
}

token = auth_manager.add_user(user)

Granting usage on a specific resource

auth_manager.add_role_to_user("ASH_KETCHUM", "pokemons:post")

Verifying requests authentication and authorization

token = "SUPER_SECRET"
auth_manager.verify_auth(token, "api/pokemon", "GET")

Metadata

Release files for rest-api-auth-manager 1.0.4

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

Source distribution (sdist)

Source distribution for rest-api-auth-manager 1.0.4
File Size Uploaded Provenance Actions
rest_api_auth_manager-1.0.4.tar.gz 4.9 kB Without provenance Details for rest_api_auth_manager-1.0.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rest-api-auth-manager 1.0.4
File Interpreter ABI Platform Actions
rest_api_auth_manager-1.0.4-py3-none-any.whl Python 3 none any Details for rest_api_auth_manager-1.0.4-py3-none-any.whl

Total release size: 10.4 kB

Release files / rest_api_auth_manager-1.0.4.tar.gz

Download URL rest_api_auth_manager-1.0.4.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4a5ea73f220723c7ba16d223d93792bb4a566b12d6e18e61f8e376a5b93371c0
BLAKE2b-256 checksum
How to use checksums
3b7d7f54803588f515c2bb1d92ac6a038e179b023685150823963f6f69479303
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Release files / rest_api_auth_manager-1.0.4-py3-none-any.whl

Download URL rest_api_auth_manager-1.0.4-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1dbf4c9930a960835a6fb08a6e50b489d10407c929009f1d440f291a7f7e8f1b
BLAKE2b-256 checksum
How to use checksums
512d35060db8cca9167aa6bbde8111ca451b7b7634f4711ee2851a7ce51ec675
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.16

Security for rest-api-auth-manager 1.0.4

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