Skip to main content

Core design package for RBAC: protocols and pydantic schemas

Project description

rbac2fast-core

🚀 Core abstract package for Role-Based Access Control (RBAC) in Python/FastAPI. Contains Protocols and Pydantic schemas without database logic.

[!WARNING] Internal Use Notice

This package is designed and maintained by the Solautyc Team for internal use. While it is publicly available, it may not work as expected in all environments or use cases outside of our specific infrastructure. We do not provide support or guarantees for external usage, and we are not responsible for any issues that may arise from using this package in other contexts.

Use at your own risk. Contributions and feedback are welcome, but compatibility with external environments is not guaranteed.

Features

  • 🧩 Abstract Interfaces: Defines standard Protocols for RBAC models and services.
  • 📦 Pydantic Schemas: Pre-defined base models for validation and serialization of Roles, Permissions, Routes, and Assignments.
  • 🪶 Lightweight: Zero database dependencies; relies solely on standard Python abstractions and pydantic.
  • 🔌 Pluggable Architecture: Allows multiple concrete implementations (e.g., standard global RBAC or multi-tenant RBAC) to share a standardized API contract.

Installation

pip install rbac2fast-core

Structure

This package exposes abstract definitions that concrete implementations (like permissions2fast-fastapi) will fulfill.

Protocols (rbac2fast_core.protocols)

Defines minimal structural requirements that underlying models must fulfill:

  • RoleProtocol, PermissionProtocol, RouteProtocol ...

Schemas (rbac2fast_core.schemas)

Provides validation schemas:

  • RoleBase, RoleCreate, RoleRead
  • PermissionBase, PermissionCreate ...

Usage

This package is not meant to be used standalone to handle permissions, but rather to be imported as a dependency by actual implementation packages or application layers that need to adhere to the standard RBAC design.

Example of implementing a protocol in your ORM model:

from sqlmodel import SQLModel, Field
from rbac2fast_core.protocols.models import RoleProtocol

class Role(SQLModel, table=True):
    # This class structurally fulfills RoleProtocol
    id: int | None = Field(default=None, primary_key=True)
    name: str = Field(unique=True, index=True)
    description: str | None = None
    is_active: bool = True

License

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

Copyright (c) 2026 Angel Daniel Sanchez Castillo

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

rbac2fast_core-0.1.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

rbac2fast_core-0.1.0-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rbac2fast_core-0.1.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for rbac2fast_core-0.1.0.tar.gz
Algorithm Hash digest
SHA256 92f49d6c344c47d4036bf0f29f63977f8957079fdd93b798f2bf32db013f8444
MD5 8fc4c238fa6cfa0db87a97c8f5004567
BLAKE2b-256 601cffb61e6c25419cda2969715efd6ed764460fde378b54815eea9a9707a542

See more details on using hashes here.

File details

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

File metadata

  • Download URL: rbac2fast_core-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for rbac2fast_core-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00b2e6491d342d5707ffa42aa5677b6d569737916d5025b6be66f8e126b66ea1
MD5 fe2d2cb90ad7c456fde5457131b9a825
BLAKE2b-256 1989c7738ed75cbc1dfcfe952bbb444b7a55d3fefb8282061331a99611ad8b21

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