Skip to content

Releases: FalkorDB/falkordb-py-orm

v1.2.2: Typing and CI compatibility fixes

Choose a tag to compare

@shahar-biron shahar-biron released this 16 Mar 05:35
b9d90f6

Highlights

  • Fix static constructor inference for @node entities in Pylance/Pyright via dataclass_transform
  • Add regression test coverage for decorator typing metadata
  • Document static type-checking behavior for decorators
  • Stabilize CI by pinning Poetry in the Python 3.9 test job

See CHANGELOG.md for full details.

v1.2.1: Bug Fixes and Python 3.9 Compatibility

Choose a tag to compare

@shahar-biron shahar-biron released this 30 Nov 19:23

🐛 Bug Fixes and Compatibility

This patch release fixes CI/CD issues and ensures full Python 3.9 compatibility.

Fixed

  • Python 3.9 Compatibility: Replaced int | None union syntax with Optional[int] for Python 3.9 support
  • Code Formatting: Formatted all security module files with Black
  • Linting: Removed unused imports and variables from security module
  • Test Collection: Renamed TestPerson to Person to avoid pytest collection warning

CI/CD

  • ✅ All lint checks now passing (Black, Ruff)
  • ✅ All tests passing on Python 3.9, 3.10, 3.11, 3.12

Installation

pip install --upgrade falkordb-orm

Full Changelog

Commits since v1.2.0:

  • e78f290 - Python 3.9 compatibility and Black formatting
  • 33d1da4 - Ruff lint error fixes
  • 132a3a6 - Release v1.2.1

Full Changelog: v1.2.0...v1.2.1

v1.2.0: Enterprise Security (RBAC)

Choose a tag to compare

@shahar-biron shahar-biron released this 29 Nov 13:48

🔒 Enterprise Security - Complete RBAC Implementation

This major release adds comprehensive Role-Based Access Control (RBAC) to FalkorDB Python ORM, providing enterprise-grade security features with fine-grained access control, property-level security, audit logging, and a complete admin management API.

🎯 Key Features

Security Models & Decorators

  • Role, User, Privilege, AuditLog entities
  • @secured() decorator for entity-level security
  • @row_level_security() for row-level filtering
  • Built-in roles: PUBLIC, reader, editor, publisher, admin
  • Role hierarchy with inheritance

Enforcement & Session Management

  • SecureSession with automatic security context
  • SecureRepository with access control enforcement
  • SecurityContext with privilege caching
  • Property-level filtering on READ operations
  • Impersonation support for testing

Admin Management API

  • RBACManager with comprehensive admin-only operations
  • User management (create, update, delete, list)
  • Role management with hierarchy support
  • User-role assignment (assign/revoke)
  • Privilege management (grant, deny, revoke)
  • Audit log queries with flexible filtering

Audit & Compliance

  • Complete audit trail for all security operations
  • AuditLogger with query capabilities
  • Automatic event logging
  • Username, action, date range filtering

📊 Implementation Stats

  • 13 new security modules (~3,400 lines)
  • 18 comprehensive tests (all passing ✅)
  • 2 working examples (~375 lines)
  • Complete documentation (~1,900 lines)
  • Total: ~6,035 lines of production-ready code

✨ Highlights

  • Fine-Grained Control: Entity and property-level access control
  • DENY Precedence: DENY always takes precedence over GRANT
  • Graph-Native: RBAC metadata stored in FalkorDB
  • Performance: <10ms overhead with privilege caching
  • Optional: Completely backward compatible
  • Admin Bypass: Admin role skips all security checks

📚 Documentation

🚀 Quick Start

from falkordb_orm import node, generated_id
from falkordb_orm.security import secured, SecureSession, RBACManager

# Define secured entity
@node("Person")
@secured(
    read=["reader", "admin"],
    write=["editor", "admin"],
    deny_read_properties={"ssn": ["*"]}
)
class Person:
    id: int | None = generated_id()
    name: str
    ssn: str

# Use secure session
session = SecureSession(graph, user)
person_repo = session.get_repository(Person)
person = person_repo.find_by_id(1)  # Property filtering automatic

🔧 Admin API Example

from falkordb_orm.security import RBACManager

# Create admin session
rbac = RBACManager(graph, admin_session.security_context)

# User management
alice = rbac.create_user("alice", "alice@example.com", roles=["reader"])
rbac.update_user("alice", email="alice.smith@example.com")

# Role management
analyst = rbac.create_role("analyst", "Data analyst", parent_roles=["reader"])
rbac.assign_role("alice", "analyst")

# Privilege management
rbac.grant_privilege("analyst", "READ", "NODE", "Document")
rbac.deny_privilege("analyst", "DELETE", "NODE", "Document")

# Audit logs
logs = rbac.query_audit_logs(username="alice", limit=10)

📦 Installation

pip install --upgrade falkordb-orm

⚡ Performance

Operation Time Notes
SecurityContext creation 1-5ms With privilege loading
Permission check (cached) <1ms Cache hit
Property filtering <1ms Per entity
Admin bypass 0ms Skips all checks

🔄 Migration

No breaking changes! Security is completely optional:

  1. No changes required to existing code
  2. Add @secured decorators to critical entities
  3. Use SecureSession for authenticated users
  4. Use RBACManager for runtime administration

🙏 Acknowledgments

Inspired by Neo4j Enterprise Security and graph-based RBAC research.

📝 Full Changelog

See CHANGELOG.md for complete details.

v1.1.1 - Critical Bug Fixes

Choose a tag to compare

@shahar-biron shahar-biron released this 29 Nov 10:49

v1.1.1 - Critical Bug Fixes

This is a patch release that fixes critical issues with relationship loading discovered in v1.1.0.

🐛 Bug Fixes

Relationship Loading Issues

  • Fixed generated ID detection in query builder

    • Changed from is not None check to hasattr() to properly detect generated ID properties
    • Ensures correct WHERE clause generation for entities with auto-generated IDs
  • Fixed entity ID mapping in mapper

    • Properly sets entity IDs from internal node IDs after creation
    • Ensures IDs are correctly populated on newly created entities
  • Fixed forward reference resolution

    • Self-referential relationships now resolve correctly
    • Entity registry properly handles forward references

Code Quality

  • Fixed Black formatting issues in mapper.py and query_builder.py
  • All linting checks passing

📦 Files Changed

  • falkordb_orm/query_builder.py - Fixed ID detection logic
  • falkordb_orm/mapper.py - Fixed entity ID mapping
  • CHANGELOG.md - Updated with v1.1.1 changes
  • pyproject.toml - Version bump to 1.1.1

✅ Testing

  • All 214 tests passing
  • CI checks passing on Python 3.9, 3.10, 3.11, 3.12

🔄 Upgrade Recommendation

Highly recommended - This release fixes critical issues that affect relationship loading. All users of v1.1.0 should upgrade to v1.1.1.

📥 Installation

pip install --upgrade falkordb-orm
# or
pip install falkordb-orm==1.1.1

Full Changelog: v1.1.0...v1.1.1

v1.1.0 - Transaction Support, Index Management, and Pagination

Choose a tag to compare

@shahar-biron shahar-biron released this 29 Nov 10:26

v1.1.0 - Major Feature Release

This release adds three major feature phases to FalkorDB Python ORM, bringing it to ~90% completion of the planned functionality.

🚀 Major New Features

Phase 7: Transaction Support

  • Session class with identity map and change tracking
  • AsyncSession for async operations
  • Unit of work pattern with commit/rollback support
  • Automatic dirty tracking and flush operations
  • Change tracking with state capture and restoration

Phase 8: Index Management

  • @indexed and @unique decorators for property indexing
  • IndexManager for programmatic index operations (create, drop, list)
  • SchemaManager for schema validation and synchronization
  • Support for RANGE, FULLTEXT, and VECTOR index types
  • Schema introspection and automated index creation

Phase 9: Pagination

  • Pageable class for pagination parameters
  • Page[T] generic class with navigation helpers
  • Repository integration with find_all_paginated()
  • Efficient offset-based pagination with total counts

✨ Additional Features

  • Automatic relationship edge deletion on updates
  • Entity registry for forward reference resolution
  • Enhanced eager loading with proper class resolution
  • Comprehensive test coverage (214 passing tests)

🐛 Bug Fixes

  • Fixed Python 3.9 compatibility issues
  • Fixed eager loading target class resolution
  • Fixed pagination navigation edge cases
  • Fixed schema validation return types
  • Fixed session test mocking issues
  • Fixed all CI linting and formatting issues

📦 Package Information

  • Python versions: 3.9, 3.10, 3.11, 3.12
  • All CI checks passing ✅
  • 100+ test cases with full coverage
  • 15+ working examples included

📊 Statistics

  • 11,000+ insertions across 37 files
  • ~8,000 lines of new code (5,000 production, 1,500 tests, 1,500 docs)
  • 214 passing tests
  • 15+ working examples

📚 Documentation

  • Complete API documentation for all new features
  • PHASE7_COMPLETE.md - Transaction support guide
  • PHASE8_COMPLETE.md - Index management guide
  • PHASE9_COMPLETE.md - Pagination guide
  • RELEASE_v1.1.0.md - Detailed release notes with migration guide

🔄 Breaking Changes

None - this release is fully backward compatible with v1.0.x

🙏 Acknowledgments

Thank you to all contributors and users who provided feedback on this release!


Full Changelog: v1.0.1...v1.1.0

v1.0.1 - Query Result Mapping Fixes

Choose a tag to compare

@shahar-biron shahar-biron released this 29 Nov 08:15

Fixed

  • Enhanced query result record mapping to support both list-based and dict-based formats
  • Added header-based column resolution for accurate variable name mapping in query results
  • Improved backward compatibility with fallback to first column when header unavailable
  • Fixed potential column mismatch issues in map_from_record() and map_with_relationships()

Changes

This is a bug fix release that improves the robustness of query result handling when working with FalkorDB.

Full Changelog: v1.0.0...v1.0.1

v1.0.0 - Initial Release

Choose a tag to compare

@shahar-biron shahar-biron released this 23 Nov 16:44

Initial Release 🎉

First production-ready release of FalkorDB Python ORM.

Installation

pip install falkordb-orm

Core Features

  • Entity Mapping with @node decorator
  • Repository Pattern with Repository[T]
  • Query Derivation from method names
  • Relationships with lazy/eager loading
  • Custom Queries with @query decorator
  • Full Async Support
  • Python 3.9+ compatible

Documentation