Skip to main content

This library contains common elements related to authentication & authorization...

Project description

core-auth

This project/library contains common elements related to authentication & authorization…


Python Versions License Pipeline Status Docs Status Security

Installation

Install from PyPI using pip:

pip install core-auth
uv pip install core-auth  # Or using UV...

Features

  • JWT Token Wrapper - Simplified interface for JSON Web Token operations

  • Multiple Cryptographic Algorithms - Support for HMAC (HS256, HS384, HS512), RSA (RS256, RS384, RS512, PS256, PS384, PS512), ECDSA (ES256, ES256K, ES384, ES512), and EdDSA algorithms

  • Token Encoding - Create JWT tokens with customizable claims, headers, and expiration times

  • Token Decoding & Validation - Decode and verify JWT tokens with comprehensive validation options (signature, expiration, audience, issuer, etc.)

  • Authorization Header Parsing - Extract Bearer tokens from HTTP Authorization headers

  • Public/Private Key Support - Compatible with RSA, Elliptic Curve (EC), Ed25519, and Ed448 key pairs

  • Custom Claims - Add standardized or custom claims to JWT payloads

  • Type-Safe - Full type hints support for better IDE integration and code safety

Quick Start

Installation

Install the package:

pip install core-auth
uv pip install core-auth  # Or using UV...
pip install -e ".[dev]"    # For development...

Setting Up Environment

  1. Install required libraries:

pip install --upgrade pip
pip install virtualenv
  1. Create Python virtual environment:

virtualenv --python=python3.12 .venv
  1. Activate the virtual environment:

source .venv/bin/activate

Install packages

pip install .
pip install -e ".[dev]"

Check tests and coverage

python manager.py run-tests
python manager.py run-coverage

Contributing

Contributions are welcome! Please:

  1. Fork the repository

  2. Create a feature branch

  3. Write tests for new functionality

  4. Ensure all tests pass: pytest -n auto

  5. Run linting: pylint core_auth

  6. Run security checks: bandit -r core_auth

  7. Submit a pull request

License

This project is licensed under the MIT License. See the LICENSE file for details.

Support

For questions or support, please open an issue on GitLab or contact the maintainers.

Authors

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

core_auth-1.2.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

core_auth-1.2.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file core_auth-1.2.0.tar.gz.

File metadata

  • Download URL: core_auth-1.2.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for core_auth-1.2.0.tar.gz
Algorithm Hash digest
SHA256 c1ac14d82fee2f9891ea980c1aae5b9f5afbbcd74a51935375b5d69fad4c4a7f
MD5 47ba9dad4479d52b5976175328102c5a
BLAKE2b-256 9611275c45bc91b116d9633c113ccba8f1abaf4cc693f215ddb05f6cd265777b

See more details on using hashes here.

File details

Details for the file core_auth-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: core_auth-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for core_auth-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f837ec2a99c42cbd60c7abe99667994695d7f6ddd000bc98ef31cf71e759eab
MD5 fd17f3ea37d95efa8da78bc05bdd0999
BLAKE2b-256 feeafe6c44a4216a65dd55ff77bddc1c4e955e3907002292e5e6840979aadb62

See more details on using hashes here.

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