{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/9"},{"label":"Security","url":"https://skillfed.io/packages/category/security/2"}],"enrichment":{"capability":"Converts Cerbos authorization query plans into SQLAlchemy Select queries, enabling attribute-based access control enforcement directly in database queries.","skillfed_tags":["authorization","access-control","cerbos"],"use_cases":["Enforce department-level access control on leave requests by converting Cerbos policies into WHERE clauses that filter authorized rows.","Implement role-based filtering on multi-tenant data by translating principal attributes and resource policies into database queries.","Optimize authorization checks on large datasets by pushing policy evaluation to the database query layer instead of loading in memory.","Support complex attribute-based rules (e.g., geography, team, priority) by mapping Cerbos CEL expressions to portable SQL predicates.","Override default SQL operators for database-specific idioms, such as using PostgreSQL's `= ANY` for collection membership instead of `IN`."],"what_it_does":"cerbos-sqlalchemy bridges Cerbos, an open-source authorization engine, and SQLAlchemy by translating Cerbos query plans (from its PlanResources API) into native SQLAlchemy Select queries. Instead of fetching all records and filtering in application code, this adapter pushes authorization logic down to the database layer, where the SQL WHERE clause enforces attribute-based access control rules.\n\nThe adapter handles logical operators, comparisons, field-to-field checks, string operations, timestamps, and hierarchy comparisons. It is tested against Cerbos PDP 0.54.0 with 112 reference conformance actions and supports both ORM entities and raw Table instances. Users can override default SQL operators for database-specific optimizations (e.g., PostgreSQL's `= ANY` instead of `IN`), and must ensure mapped columns use case-sensitive collation to prevent silent over-granting of access.","worth_installing":"Yes. This is a well-maintained, low-friction adapter (pure Python, two dependencies, no vulnerabilities) that solves a real problem: pushing authorization enforcement into database queries rather than application code. It is actively developed, permissively licensed, and tested against a reference conformance suite. Install it if you use Cerbos and SQLAlchemy together and want to avoid loading unauthorized records into memory."},"id":"cerbos-sqlalchemy","links":{"html":"https://skillfed.io/packages/cerbos-sqlalchemy","md":"https://skillfed.io/packages/cerbos-sqlalchemy.md","pypi":"https://pypi.org/project/cerbos-sqlalchemy/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-08-03","license_spdx":null,"license_treatment":"permissive","name":"cerbos-sqlalchemy","python_support":"supports_current","summary":"SQLAlchemy adapter for generating queries with Cerbos: an open core, language-agnostic, scalable authorization solution"},"popularity":{"monthly_downloads":128627,"position":11701,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.4.0"}
