feat: Complete release 1.12 RBAC authorization foundations - #14215
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThis PR adds model-provider policy enforcement and discovery, canonical flow workspace handling, audit actor identity, targeted share-policy hooks, variable ownership metadata, and permission-aware global-variable UI behavior. It also adds migrations, regression tests, benchmarks, provider metadata, and starter-template updates. ChangesModel-provider policy and discovery
Canonical flow destinations and authorization
Audit actor identity
Targeted share authorization hooks
Variable access controls
Estimated code review effort: 5 (Critical) | ~120 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 8 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (8 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
18b17f0 to
23f5ea9
Compare
|
✅ Migration Validation Passed All migrations follow the Expand-Contract pattern correctly. |
✅ Test Coverage AdvisorNo source changes detected without accompanying tests. Thanks for keeping coverage up! 🎉
|
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/backend/base/langflow/services/database/models/folder/utils.py (1)
44-53: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winUse
.is_(None)in the UPDATE WHERE predicate.
Flow.folder_id is Noneis evaluated in Python on theInstrumentedAttributebeforeand_()builds the clause, so it becomesand_(False, ...)and the UPDATE matches no rows. Theworkspace_id=folder.workspace_idrepair therefore never takes effect, while the nearby SELECT already uses the correctFlow.folder_id.is_(None).🐛 Proposed fix
await session.exec( update(Flow) .where( and_( - Flow.folder_id is None, + Flow.folder_id.is_(None), Flow.user_id == user_id, ) ) .values(folder_id=folder.id, workspace_id=folder.workspace_id) )🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/backend/base/langflow/services/database/models/folder/utils.py` around lines 44 - 53, Update the UPDATE predicate in the folder reassignment flow to use Flow.folder_id.is_(None) instead of Python’s “is None” comparison, matching the nearby SELECT predicate. Preserve the existing Flow.user_id filter and values assignment so eligible flows receive the folder and workspace IDs.src/lfx/src/lfx/_assets/component_index.json (1)
23445-23525: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick winKeep the deployment policy gate fail-closed when the setting is missing.
getattr(..., True)permits guard-code execution if the settings object is present but lacksallow_custom_componentsdue to version skew or incomplete initialization. That contradicts the method’s fail-closed contract and can allow execution of client-editable Python code in a locked-down deployment.Use a false default or explicitly reject a missing setting, then regenerate this embedded asset and checksum.
Proposed fix
- return bool(getattr(settings_service.settings, "allow_custom_components", True)) + return bool(getattr(settings_service.settings, "allow_custom_components", False))🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/lfx/src/lfx/_assets/component_index.json` around lines 23445 - 23525, The deployment policy check in _code_execution_allowed must fail closed when the settings object lacks allow_custom_components. Change the getattr fallback from permissive to false (or explicitly reject the missing attribute), preserving fail-open only when the settings layer cannot be imported; then regenerate the embedded component_index.json asset and its checksum.
🧹 Nitpick comments (7)
src/backend/base/langflow/alembic/versions/b7d5f9a3c2e4_sync_flow_workspace_from_project.py (1)
43-56: 🚀 Performance & Scalability | 🔵 TrivialBulk UPDATE over the entire
flowtable may lock/scan large deployments.The single correlated
UPDATEis functionally correct and theEXISTSguard properly avoids nulling rows with a danglingfolder_id. On large installations, though, this rewrites every project-scoped flow row in one statement and can hold a broad lock / long scan during the MIGRATE phase. Consider batching (e.g., keyset overflow.id) or documenting expected downtime for large datasets.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/backend/base/langflow/alembic/versions/b7d5f9a3c2e4_sync_flow_workspace_from_project.py` around lines 43 - 56, The migration’s correlated UPDATE rewrites all project-scoped flow rows in one potentially long-running operation. Replace the single statement in the migration upgrade logic with bounded keyset batches over flow.id, preserving the existing folder_id and EXISTS conditions and continuing until no rows remain; keep workspace_id sourced from the matching folder.src/backend/tests/unit/api/v1/test_authz_audit_schemas.py (1)
101-220: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider a real-DB integration test instead of fake session/SQL-substring assertions.
_Session/_Resultfully fake the DB layer, and correctness is asserted via substrings of compiled SQL text (e.g."authz_audit_log.actor_type IS NULL" in count_sql) rather than actual query results. This is brittle to SQLAlchemy rendering changes and doesn't prove the filter semantics hold against a real engine. Consider seeding rows via a real async session (theauthz_async_sessionfixture pattern used intest_authz_models.py) and asserting onlist_audit_log's returneditems.Based on path instructions for
**/test_*.py: "Warn when backend pytest files rely on excessive mocks that obscure what is actually being tested, replace mocks with real objects or test doubles when mocks become excessive, and prefer integration tests when unit tests are overly mocked."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/backend/tests/unit/api/v1/test_authz_audit_schemas.py` around lines 101 - 220, Replace the fake _Session/_Result setup and SQL-substring assertions in test_audit_query_filters_and_returns_first_class_actor_fields and test_unknown_actor_filter_includes_legacy_null_and_explicit_unknown_rows with the real async database session fixture pattern used by test_authz_models.py. Seed the relevant audit rows through that session, invoke list_audit_log, and assert the returned items and ordering directly, preserving coverage for actor filters including legacy NULL and explicit "unknown" rows.Source: Path instructions
src/lfx/tests/unit/services/model_provider_policy/test_policy.py (1)
157-157: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRemove the redundant async marker.
asyncio_mode = "auto"is configured inpyproject.toml, so pytest-asyncio will run async tests without@pytest.mark.asyncio.Proposed fix
-@pytest.mark.asyncio async def test_standalone_model_component_denied_before_build_method(monkeypatch):🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/lfx/tests/unit/services/model_provider_policy/test_policy.py` at line 157, Remove the redundant `@pytest.mark.asyncio` decorator from the affected async test; rely on the existing asyncio_mode = "auto" configuration in pyproject.toml while leaving the test implementation unchanged.Source: Learnings
src/backend/tests/unit/agentic/helpers/test_validation.py (1)
335-335: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winRemove the redundant
pytest.mark.asynciodecorator.
pytest-asynciois configured for automatic async-test detection, so this marker is unnecessary and inconsistent with the repository convention.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/backend/tests/unit/agentic/helpers/test_validation.py` at line 335, Remove the redundant pytest.mark.asyncio decorator from the affected async test in the validation helpers test module. Leave the test function and its async behavior unchanged, following the repository’s automatic async-test detection convention.Source: Learnings
src/backend/tests/unit/api/v1/test_voice_mode_flow_authz.py (1)
39-39: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueRedundant
@pytest.mark.asynciodecorator.This repo runs pytest-asyncio in
asyncio_mode = "auto", so async tests are auto-detected; the rest of this file (e.g. the test at line 198) already omits the decorator. Drop it here for consistency.Based on a retrieved learning: "pytest-asyncio is configured with asyncio_mode = 'auto' in pyproject.toml... you do not need to decorate test functions or classes with pytest.mark.asyncio."
🧹 Proposed cleanup
-@pytest.mark.asyncio async def test_openai_voice_policy_denial_precedes_secret_lookup(monkeypatch):-@pytest.mark.asyncio async def test_openai_voice_policy_allows_secret_lookup(monkeypatch):Also applies to: 69-69
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/backend/tests/unit/api/v1/test_voice_mode_flow_authz.py` at line 39, Remove the redundant `@pytest.mark.asyncio` decorators from the affected async tests in this file, including the tests near lines 39 and 69; rely on the repository’s asyncio_mode = "auto" configuration and preserve the existing test implementations.Source: Learnings
src/backend/base/langflow/services/auth/service.py (1)
688-698: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winExtract a shared
is_superuserattributes-builder for model-provider policy calls. Four sites independently reconstruct the same{"is_superuser": ...}dict passed toresolve_model_provider_policy/require_model_provider, each with a different accessor style (bool(x.is_superuser),bool(getattr(x, "is_superuser", False)),bool(principal and principal.is_superuser)). Consolidating into one helper inlfx.services.model_provider_policyremoves the duplication and the risk of a future call site using the unguarded accessor on an object that doesn't guarantee the attribute.
src/backend/base/langflow/services/auth/service.py#L688-L698: replace the inline dicts inget_current_active_user/get_current_active_superuser(and the MCP variant at L1119-L1126) with a call to the shared helper.src/backend/base/langflow/api/v1/models.py#L51-L57: replace the inlinegetattr(...)dict in_resolve_policy(and the duplicate at L196-L201) with the shared helper.src/backend/base/langflow/api/v1/voice_mode.py#L113-L121: replace the inlinegetattr(...)dict inauthenticate_and_get_openai_keywith the shared helper.src/backend/base/langflow/services/variable/service.py#L40-L46: replace theprincipal and principal.is_superuserconstruction (and the DB lookup it requires) with the shared helper, which can accept an already-loaded principal object.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/backend/base/langflow/services/auth/service.py` around lines 688 - 698, Extract a shared is_superuser attributes-builder in lfx.services.model_provider_policy that safely accepts a principal object and returns the policy attributes, then reuse it for all model-provider policy calls. Update src/backend/base/langflow/services/auth/service.py:688-698 and its MCP variant at 1119-1126, src/backend/base/langflow/api/v1/models.py:51-57 and 196-201, src/backend/base/langflow/api/v1/voice_mode.py:113-121, and src/backend/base/langflow/services/variable/service.py:40-46; in the variable service, remove the redundant database lookup and pass the already-loaded principal to the helper.src/frontend/src/pages/SettingsPage/pages/GlobalVariablesPage/index.tsx (1)
66-77: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider page-level test coverage for the new permission-gating behavior.
variableAccess.ts's pure helpers are well covered byvariableAccess.test.ts, but the integration in this file (Access/Actions columns,isRowSelectable, keyboard/click gating, selection revalidation effect) has no accompanying test in this PR's file set. If this isn't already covered by an existing Playwright suite outside this batch, consider adding component/integration coverage for the new column rendering and selection-gating behavior.Based on coding guidelines: "For new frontend implementations or bug fixes, ensure corresponding test files are included ... verify the tests actually cover the new or changed behavior rather than acting as placeholders."
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/frontend/src/pages/SettingsPage/pages/GlobalVariablesPage/index.tsx` around lines 66 - 77, Expand test coverage for GlobalVariablesPageContent to verify permission-gated Access/Actions columns, isRowSelectable behavior, keyboard and click selection gating, and selection revalidation after permission changes. Add meaningful component or integration assertions for these behaviors, reusing existing test utilities or an established Playwright suite rather than placeholder tests.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/backend/base/langflow/api/v1/authz_shares.py`:
- Around line 176-224: Bound the plugin hook awaits in _refresh_policy_for_share
and _remove_policy_for_share with asyncio.wait_for using a named timeout
constant, while preserving the existing exception logging and fallback behavior.
Apply the timeout to authz.sync_share(share_id) and
authz.remove_share_rules(snapshot), ensuring these post-commit hooks cannot
delay the create_share, update_share, or delete_share flows indefinitely.
In `@src/backend/base/langflow/api/v1/endpoints.py`:
- Around line 1561-1565: Update the configuration lifecycle around the Component
instance in the endpoint handler to bind the authenticated user’s policy
attributes with set_current_model_provider_policy_context(...) before calling
require_model_provider_policy(ModelProviderPolicyPurpose.CONFIGURE), and always
reset the returned context token afterward via
reset_current_model_provider_policy_context(...). Add a regression test covering
a superuser to verify policy resolution receives is_superuser=True and permits
configuration.
In `@src/backend/base/langflow/api/v1/voice_mode.py`:
- Line 1261: Ensure the authenticate_and_get_openai_key call passes
client_websocket as its WebSocket argument rather than the client_send closure,
preserving the function’s ability to send authentication or policy failure
responses through the WebSocket.
In `@src/backend/base/langflow/initial_setup/starter_projects/Basic`
Prompting.json:
- Line 1044: Regenerate the serialized code_hash for the embedded
LanguageModelComponent metadata so it matches the updated source. Update the
Language Model node metadata in
src/backend/base/langflow/initial_setup/starter_projects/Basic
Prompting.json:1044-1044, Research Translation Loop.json:1115-1115, and Image
Sentiment Analysis.json:790-790, replacing the stale hash while leaving the
component source and other metadata unchanged.
In `@src/frontend/src/pages/SettingsPage/pages/GlobalVariablesPage/index.tsx`:
- Around line 385-397: Update the Space-key branch in the page’s onCellKeyDown
handler to call keyboardEvent.preventDefault() and
keyboardEvent.stopPropagation() before checking canMutateVariable. Keep the
permission check before changing selection so unauthorized Space presses remain
a no-op without triggering browser scrolling.
In `@src/lfx/src/lfx/base/models/provider_registry.py`:
- Around line 655-662: Update uses_standalone_model_provider_policy so only
explicit "delegate" and "none" model_provider_policy_mode values return False;
treat missing, "standalone", and any unknown or misspelled values as standalone
enforcement.
---
Outside diff comments:
In `@src/backend/base/langflow/services/database/models/folder/utils.py`:
- Around line 44-53: Update the UPDATE predicate in the folder reassignment flow
to use Flow.folder_id.is_(None) instead of Python’s “is None” comparison,
matching the nearby SELECT predicate. Preserve the existing Flow.user_id filter
and values assignment so eligible flows receive the folder and workspace IDs.
In `@src/lfx/src/lfx/_assets/component_index.json`:
- Around line 23445-23525: The deployment policy check in
_code_execution_allowed must fail closed when the settings object lacks
allow_custom_components. Change the getattr fallback from permissive to false
(or explicitly reject the missing attribute), preserving fail-open only when the
settings layer cannot be imported; then regenerate the embedded
component_index.json asset and its checksum.
---
Nitpick comments:
In
`@src/backend/base/langflow/alembic/versions/b7d5f9a3c2e4_sync_flow_workspace_from_project.py`:
- Around line 43-56: The migration’s correlated UPDATE rewrites all
project-scoped flow rows in one potentially long-running operation. Replace the
single statement in the migration upgrade logic with bounded keyset batches over
flow.id, preserving the existing folder_id and EXISTS conditions and continuing
until no rows remain; keep workspace_id sourced from the matching folder.
In `@src/backend/base/langflow/services/auth/service.py`:
- Around line 688-698: Extract a shared is_superuser attributes-builder in
lfx.services.model_provider_policy that safely accepts a principal object and
returns the policy attributes, then reuse it for all model-provider policy
calls. Update src/backend/base/langflow/services/auth/service.py:688-698 and its
MCP variant at 1119-1126, src/backend/base/langflow/api/v1/models.py:51-57 and
196-201, src/backend/base/langflow/api/v1/voice_mode.py:113-121, and
src/backend/base/langflow/services/variable/service.py:40-46; in the variable
service, remove the redundant database lookup and pass the already-loaded
principal to the helper.
In `@src/backend/tests/unit/agentic/helpers/test_validation.py`:
- Line 335: Remove the redundant pytest.mark.asyncio decorator from the affected
async test in the validation helpers test module. Leave the test function and
its async behavior unchanged, following the repository’s automatic async-test
detection convention.
In `@src/backend/tests/unit/api/v1/test_authz_audit_schemas.py`:
- Around line 101-220: Replace the fake _Session/_Result setup and SQL-substring
assertions in test_audit_query_filters_and_returns_first_class_actor_fields and
test_unknown_actor_filter_includes_legacy_null_and_explicit_unknown_rows with
the real async database session fixture pattern used by test_authz_models.py.
Seed the relevant audit rows through that session, invoke list_audit_log, and
assert the returned items and ordering directly, preserving coverage for actor
filters including legacy NULL and explicit "unknown" rows.
In `@src/backend/tests/unit/api/v1/test_voice_mode_flow_authz.py`:
- Line 39: Remove the redundant `@pytest.mark.asyncio` decorators from the
affected async tests in this file, including the tests near lines 39 and 69;
rely on the repository’s asyncio_mode = "auto" configuration and preserve the
existing test implementations.
In `@src/frontend/src/pages/SettingsPage/pages/GlobalVariablesPage/index.tsx`:
- Around line 66-77: Expand test coverage for GlobalVariablesPageContent to
verify permission-gated Access/Actions columns, isRowSelectable behavior,
keyboard and click selection gating, and selection revalidation after permission
changes. Add meaningful component or integration assertions for these behaviors,
reusing existing test utilities or an established Playwright suite rather than
placeholder tests.
In `@src/lfx/tests/unit/services/model_provider_policy/test_policy.py`:
- Line 157: Remove the redundant `@pytest.mark.asyncio` decorator from the
affected async test; rely on the existing asyncio_mode = "auto" configuration in
pyproject.toml while leaving the test implementation unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4623dd90-d54f-4d71-b477-e69fb7e498e1
📒 Files selected for processing (73)
.secrets.baselinesrc/backend/base/langflow/agentic/helpers/validation.pysrc/backend/base/langflow/alembic/versions/a6c4e2f8b1d3_add_authz_audit_actor_identity.pysrc/backend/base/langflow/alembic/versions/b7d5f9a3c2e4_sync_flow_workspace_from_project.pysrc/backend/base/langflow/api/v1/authz_audit.pysrc/backend/base/langflow/api/v1/authz_route_dependencies.pysrc/backend/base/langflow/api/v1/authz_shares.pysrc/backend/base/langflow/api/v1/endpoints.pysrc/backend/base/langflow/api/v1/flows.pysrc/backend/base/langflow/api/v1/flows_helpers.pysrc/backend/base/langflow/api/v1/models.pysrc/backend/base/langflow/api/v1/projects.pysrc/backend/base/langflow/api/v1/projects_files.pysrc/backend/base/langflow/api/v1/schemas/authz_roles.pysrc/backend/base/langflow/api/v1/variable.pysrc/backend/base/langflow/api/v1/voice_mode.pysrc/backend/base/langflow/initial_setup/starter_projects/Basic Prompting.jsonsrc/backend/base/langflow/initial_setup/starter_projects/Image Sentiment Analysis.jsonsrc/backend/base/langflow/initial_setup/starter_projects/Research Translation Loop.jsonsrc/backend/base/langflow/services/auth/service.pysrc/backend/base/langflow/services/authorization/audit.pysrc/backend/base/langflow/services/authorization/fetch.pysrc/backend/base/langflow/services/authorization/listing.pysrc/backend/base/langflow/services/database/models/auth/authz.pysrc/backend/base/langflow/services/database/models/folder/utils.pysrc/backend/base/langflow/services/database/models/variable/model.pysrc/backend/base/langflow/services/variable/service.pysrc/backend/tests/performance/test_flow_authz_prefilter_benchmark.pysrc/backend/tests/unit/agentic/helpers/test_validation.pysrc/backend/tests/unit/alembic/test_authz_audit_actor_migration.pysrc/backend/tests/unit/alembic/test_flow_workspace_sync_migration.pysrc/backend/tests/unit/api/v1/test_authz_admin_routes.pysrc/backend/tests/unit/api/v1/test_authz_audit_schemas.pysrc/backend/tests/unit/api/v1/test_authz_share_routes.pysrc/backend/tests/unit/api/v1/test_flow_folder_integrity.pysrc/backend/tests/unit/api/v1/test_models_provider_policy.pysrc/backend/tests/unit/api/v1/test_variable.pysrc/backend/tests/unit/api/v1/test_voice_mode_flow_authz.pysrc/backend/tests/unit/services/authorization/test_audit.pysrc/backend/tests/unit/services/authorization/test_capability_flag.pysrc/backend/tests/unit/services/authorization/test_fetch.pysrc/backend/tests/unit/services/authorization/test_flow_route_guards.pysrc/backend/tests/unit/services/authorization/test_listing_null_owner_prefilter.pysrc/backend/tests/unit/services/variable/test_service.pysrc/backend/tests/unit/test_authz_models.pysrc/backend/tests/unit/test_endpoints.pysrc/bundles/ibm/src/lfx_ibm/components/ibm/watsonx.pysrc/bundles/ibm/src/lfx_ibm/components/ibm/watsonx_embeddings.pysrc/bundles/lfx-bundles/src/lfx_bundles/azure/azure_openai.pysrc/bundles/lfx-bundles/src/lfx_bundles/azure/azure_openai_embeddings.pysrc/frontend/src/customization/components/custom-variable-share-action.tsxsrc/frontend/src/pages/SettingsPage/pages/GlobalVariablesPage/__tests__/variableAccess.test.tssrc/frontend/src/pages/SettingsPage/pages/GlobalVariablesPage/index.tsxsrc/frontend/src/pages/SettingsPage/pages/GlobalVariablesPage/variableAccess.tssrc/frontend/src/types/global_variables/index.tssrc/lfx/src/lfx/_assets/component_index.jsonsrc/lfx/src/lfx/base/embeddings/model.pysrc/lfx/src/lfx/base/models/model.pysrc/lfx/src/lfx/base/models/provider_registry.pysrc/lfx/src/lfx/components/langchain_utilities/fake_embeddings.pysrc/lfx/src/lfx/components/models_and_agents/embedding_model.pysrc/lfx/src/lfx/components/models_and_agents/language_model.pysrc/lfx/src/lfx/components/models_and_agents/policies_component.pysrc/lfx/src/lfx/custom/custom_component/component.pysrc/lfx/src/lfx/custom/utils.pysrc/lfx/src/lfx/services/authorization/__init__.pysrc/lfx/src/lfx/services/authorization/base.pysrc/lfx/src/lfx/services/model_provider_policy/__init__.pysrc/lfx/src/lfx/services/model_provider_policy/context.pysrc/lfx/src/lfx/services/model_provider_policy/utils.pysrc/lfx/tests/unit/base/models/test_provider_registry.pysrc/lfx/tests/unit/custom/test_utils_metadata.pysrc/lfx/tests/unit/services/model_provider_policy/test_policy.py
|
Addressed the two outside-diff findings in commit e917b02:\n\n- Fixed orphan-flow reassignment to use Flow.folder_id.is_(None), with a real DB regression covering folder/workspace adoption.\n- Made PoliciesComponent fail closed when allow_custom_components is missing, then regenerated the component index and integrity checksum.\n\nAlso applied the low-risk review nits (redundant async markers and focused Global Variables keyboard coverage). I left the migration-batching, shared-helper extraction, and audit-test-harness rewrites out: those are non-functional, substantially broader refactors that are safer as separate follow-ups.\n\nValidation: focused backend suite 64 passed; final share-hook suite 43 passed; isolated LFX suite 69 passed (including both clean-flow upgrade regressions); frontend suite 17 passed; Ruff, Biome, pre-commit, starter-template validation, bundle release plan, and generated hash/checksum checks passed. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## release-1.12.0 #14215 +/- ##
==================================================
- Coverage 61.47% 61.47% -0.01%
==================================================
Files 2339 2342 +3
Lines 237145 237682 +537
Branches 35410 33330 -2080
==================================================
+ Hits 145787 146113 +326
- Misses 89561 89766 +205
- Partials 1797 1803 +6
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Summary
This is the OSS half of the release 1.12 RBAC deliverables work. It supplies the shared authorization, data-model, API, provider-policy, migration, and frontend seams consumed by the companion Enterprise change.
Addresses deliverables 2.4, 2.10, 2.11, 3.4, 4.2, 4.6, 4.9, and 4.11. Deliverable 0.10 is intentionally out of scope.
What changed
Impact
The Enterprise companion PR consumes these contracts for custom-role hierarchy, scoped Casbin policy, admin UI, audit export, resource sharing, and provider-policy administration. Existing behavior remains unchanged when authorization/provider policy is disabled.
Validation
lfx-ibm0.1.4 andlfx-bundles1.1.3 are metadata-consistent)b83ab35911bb6a3eba021812844ac91c7c4ef942: passedEnterprise implementation: WatsonOrchestrate/Langflow-Enterprise#113 (merged). Final pin follow-up: WatsonOrchestrate/Langflow-Enterprise#114, advancing
oss-versionto this PR headb83ab35911bb6a3eba021812844ac91c7c4ef942.Summary by CodeRabbit