Skip to main content

rbac2fast-core

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

📖 Conventions reference: this package follows the 2fast-handbook for ecosystem conventions (structure, versioning, README, commits, release).

[!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

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.1.tar.gz (8.1 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.1-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for rbac2fast_core-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0c3ab4af724ab8bc2980d83d982ef3c7d44102b8ef6954b8ddf4d9a80b43ff7c
MD5 0df8fa77e39c9332d7f511d1a9088e9c
BLAKE2b-256 37c36a121ab50cc9b8cfc65738851c58f57627a636bafcff0020716867900c4f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for rbac2fast_core-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b9b7df25dba980e2c96309c6f5e3ef13ce7050b18d0f7fc92d1aa370a455a3c2
MD5 ff8958ef16643fb21aa658cbbd95f920
BLAKE2b-256 8649fb81d1a504688dfc0d7101182b58dbe81d7cdc10cf2ca8d040bb3a302c65

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

2 files

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