Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
2aaf01e
Check in RBAC MVP PRD, architecture specification for the Langbuilder…
Oct 31, 2025
3ebd65a
Implementation Plan Complete
roadnick Nov 8, 2025
2963ee1
Initial Task 1.1 Implementation
roadnick Nov 8, 2025
381f6cc
Task 1.1 post-audit fix (1 test failing)
roadnick Nov 8, 2025
4b25739
Task 1.1 Post-audit with Text fixed and additional linting
roadnick Nov 8, 2025
3a8ee53
Task 1.2 initial implementation
roadnick Nov 8, 2025
0d978d4
Task 1.2 post audit and fixes
roadnick Nov 8, 2025
bb93159
Task 1.3 Initial implementation
roadnick Nov 8, 2025
335c263
Task 1.4 Final implementation
roadnick Nov 8, 2025
4cf72c2
Task 1.5 Initial implementation
roadnick Nov 8, 2025
5833136
Task 1.5 Final implementation
roadnick Nov 8, 2025
bf650dc
Task 1.6 Initial implementation
roadnick Nov 9, 2025
4a9aab2
Task 1.6 Final implementation
roadnick Nov 9, 2025
ae9682d
Fixes to solve migration issues so LangBuilder runs.
roadnick Nov 9, 2025
4365355
Task 2.1 Initial Implementation
roadnick Nov 9, 2025
43040ad
Task 2.1 Final Implementation
roadnick Nov 9, 2025
1182661
Implement Task 2.2: Enforce Read Permission on List Flows Endpoint
roadnick Nov 9, 2025
758c245
Fix database migration issues blocking test execution
roadnick Nov 9, 2025
f75ec57
Fix database isolation issue in Task 2.2 RBAC tests
roadnick Nov 9, 2025
9e3f2c6
Fix Task 2.2 RBAC test failures - All 8 tests now passing
roadnick Nov 9, 2025
dd7d36e
Task 2.3 Initial Implementation
roadnick Nov 9, 2025
36772c7
Task 2.3 Final implementation
roadnick Nov 10, 2025
795183f
Task 2.4 Initial Implementation
roadnick Nov 10, 2025
1088d02
Task 2.4 Final Implementation
roadnick Nov 10, 2025
dab74bf
Task 2.5 Initial Implementation
roadnick Nov 10, 2025
2649458
Task 2.5 Final Implementation
roadnick Nov 10, 2025
7b1aa63
Task 2.6 initial implementation
roadnick Nov 10, 2025
fe4d30b
Task 2.6 final implementation
roadnick Nov 10, 2025
8f1380b
Task 2.7 initial implementation
roadnick Nov 10, 2025
ef6422b
Task 2.7 Final implementation
roadnick Nov 10, 2025
a782689
Task 3.1 initial implementation
roadnick Nov 10, 2025
4d18d31
Task 3.1 final implementation
roadnick Nov 10, 2025
a13ff14
Task 3.2 initial implementation
roadnick Nov 10, 2025
f8f2ec1
Task 3.3 initial implementation
roadnick Nov 10, 2025
b3dd348
Task 3.4 initial implementation
roadnick Nov 10, 2025
e97cda9
Task 3.2 documentation improvements
roadnick Nov 10, 2025
233fdad
Task 3.5 initial implementation
roadnick Nov 10, 2025
8557a24
Task 3.3 Final Implementation
roadnick Nov 10, 2025
0483959
Task 3.4 Final Implementation
roadnick Nov 11, 2025
d9e17ef
Task 3.5 final Implementation
roadnick Nov 11, 2025
33f85f1
Task 4.1 Initial Implementation
roadnick Nov 11, 2025
ab77e60
Task 4.1 final Implementation
roadnick Nov 11, 2025
4a2b6b0
Task 4.2 final Implementation
roadnick Nov 12, 2025
817574b
Task 4.3 Initial Implementation
roadnick Nov 12, 2025
6968c7c
Task 4.3 Final Implementation
roadnick Nov 12, 2025
9f6f168
Task 4.4 Final Implementation
roadnick Nov 12, 2025
2e4fab3
Task 4.5 initial Implementation
roadnick Nov 12, 2025
a4dd7b9
Final commit for Task 4.5
roadnick Nov 12, 2025
492bfd8
Phase 4 export fix
roadnick Nov 12, 2025
806f982
Task 5.1 initial implementation
roadnick Nov 12, 2025
283f228
Task 5.1 final implementation
roadnick Nov 12, 2025
4346c00
Task 5.2: Integration tests for RBAC API endpoints
roadnick Nov 21, 2025
1ccb8b9
Task 5.3: Performance testing and optimization
roadnick Nov 21, 2025
291bd9e
Task 5.3 final implementation
roadnick Nov 24, 2025
0c3b5c0
Task 5.4 initial implementation
roadnick Nov 24, 2025
e66c644
final Task 5.4 implmentation
roadnick Nov 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
188,873 changes: 188,873 additions & 0 deletions .alucify/appgraph.json

Large diffs are not rendered by default.

3,152 changes: 3,152 additions & 0 deletions .alucify/architecture.md

Large diffs are not rendered by default.

869 changes: 869 additions & 0 deletions .alucify/implementation-plans/rbac-implementation-plan-audit.md

Large diffs are not rendered by default.

1,185 changes: 1,185 additions & 0 deletions .alucify/implementation-plans/rbac-implementation-plan-v1.0-audit.md

Large diffs are not rendered by default.

3,329 changes: 3,329 additions & 0 deletions .alucify/implementation-plans/rbac-implementation-plan-v1.0.md

Large diffs are not rendered by default.

3,803 changes: 3,803 additions & 0 deletions .alucify/implementation-plans/rbac-implementation-plan-v1.1.md

Large diffs are not rendered by default.

3,329 changes: 3,329 additions & 0 deletions .alucify/implementation-plans/rbac-implementation-plan.md

Large diffs are not rendered by default.

99 changes: 99 additions & 0 deletions .alucify/prd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
# **Product Requirements Document (PRD)**

## **Project: MVP Feature Set: Role-Based Access Control (RBAC) for LangBuilder**

## **1\. Introduction and Goals**

### **1.1. Problem Statement**

LangBuilder currently lacks a **customizable, fine-grained access control** mechanism, which is critical for enforcing security policies and managing enterprise teams. This gap exposes customer data and prevents organizations from structuring access appropriately across their work.

### **1.2. Project Goal (The "Why")**

The primary goal is to introduce a customizable, fine-grained **Role-Based Access Control (RBAC)** system. This system must enforce secure, contextual permissions across all major elements of LangBuilder, ensuring:

* Secure, fine-grained permission enforcement.
* Customizable roles to suit different team structures (via predefined defaults).
* Management available exclusively through a Web-based administrative UI by the **Admin** role.

---

## **2\. Scope and Dependencies**

### **2.1. In-Scope for MVP (High-Level Summary)**

The MVP will establish the core RBAC data model, assignment logic, and enforcement engine using four predefined default roles and standard CRUD permissions across **Flow** and **Project** entities. All assignment management is centralized under the **Admin** role in a dedicated UI.

### **2.2. Out-of-Scope (Non-Goals)**

The following items are explicitly **out-of-scope** for the MVP:

* Custom Roles or permissions beyond CRUD (e.g., `Can_export_flow`, `Can_deploy_environment`).
* Extended Permission Scopes (Component, Environment, Workspace, API/Token).
* SSO (Single Sign-On), User Groups, Service Accounts, SCIM, API/IaC based access management.
* User-triggered sharing of flows.

### **2.3. Dependencies & Constraints**

The RBAC implementation **must** integrate with and rely on the following existing systems:

* Existing authentication system
* A persistent metadata store for role and permission configuration

---

## **3\. Detailed Requirements (Epics & Stories in Gherkin Format)**

### **Epic 1: Core RBAC Data Model and Default Assignment**

**Goal:** Establish the persistent data model for roles, permissions, scopes, and assignments, including all initial assignment rules and immutability logic.

| Story \# | Short Description | Gherkin Acceptance Criteria |
| :---- | :---- | :---- |
| **1.1** | **Define & Persist Core Permissions (CRUD) and Scopes** | **Scenario: Defining the Core RBAC Entities** **Given** the persistence layer is available **When** the system is initialized **Then** the four base permissions (**Create, Read, Update, Delete**) should be defined in the metadata store **And** the two entity scopes (**Flow, Project**) should be defined in the metadata store **And** the data model should establish the relationship between permissions and scopes |
| **1.2** | **Define & Persist Default Roles and Mappings** | **Scenario: Mapping Default Roles and Extended Permissions** **Given** the four base permissions are defined **When** the default roles are persisted **Then** the **Owner** role should have full **CRUD** access to its scope entity **And** the **Admin** role should have full **CRUD** access across all scopes/entities **And** the **Editor** role should have **Create, Read, Update** access (but **not Delete**) **And** the **Viewer** role should have only **Read/View** access **And** the **Read/View** permission should enable Flow **execution, saving, exporting, and downloading** **And** the **Update/Edit** permission should enable Flow/Project **import** |
| **1.3** | **Implement Core Role Assignment Logic** | **Scenario: Admin Assigns or Modifies a Role Assignment** **Given** the internal assignment API (`assignRole` / `removeRole`) is exposed **When** an **Admin** calls the API to **create a new role assignment** (User, Role, Scope) **Then** the assignment should be successfully persisted **When** an **Admin** calls the API to **modify or delete** an existing assignment **Then** the Admin should be authorized to perform the action **And** the updated assignment should be successfully persisted or removed **But** the Admin should be **prevented** from modifying the Starter Project Owner assignment (as per 1.4) |
| **1.4** | **Default Project Owner Immutability Check** | **Scenario: Preventing changes to the Starter Project Owner Role** **Given** a user has the **Owner** role assigned to their default/Starter Project (which is pre-existing) **When** an **Admin** attempts to modify, delete, or transfer this specific Owner role assignment **Then** the attempt should be blocked at the application logic layer **And** the user should maintain the **Owner** role on their Starter Project |
| **1.5** | **Global Project Creation & New Entity Owner Mutability** | **Scenario: Project Creation and New Entity Owner Assignment** **Given** any authenticated user is logged in **When** the user attempts to create a new Project **Then** the user should have access to the **Create Project** function **When** a user successfully creates a new Project or Flow **Then** the creating user should be automatically assigned the **Owner** role for that new entity **And** an **Admin** should be able to modify this new entity's Owner role assignment |
| **1.6** | **Define Project to Flow Role Extension Rule** | **Scenario: Establishing Project Role Inheritance Logic** **Given** a user has a specific(or default) role assigned to a Project **When** the user attempts to access a Flow contained within that Project **Then** the user should automatically inherit the permissions of the assigned Project role for that Flow But if an explicit, different role is assigned to the user for that specific Flow scope, the Flow-specific role should override the inherited role (per 2.1 logic) |

###

### **Epic 2: RBAC Enforcement Engine & Runtime Checks**

**Goal:** Implement the core application logic to validate user permissions against the RBAC data model at every critical user action.

| Story \# | Short Description | Gherkin Acceptance Criteria |
| :---- | :---- | :---- |
| **2.1** | **Core `CanAccess` Authorization Service** | **Scenario: Evaluating User Access** **Given** the `CanAccess` method is called with a user, permission, and scope **When** the `user_id` has the **Admin** role **Then** the method should immediately return **true** **When** the user is non-Admin accessing a Flow **Then** the service should first check for a direct **Flow-specific** role **And** if no Flow-specific role exists, the service should check the inherited role from the containing **Project** **When** the user is non-Admin accessing a Project **Then** the service should check the **Project-specific** role |
| **2.2** | **Enforce Read/View Permission & List Visibility** | **Scenario: UI Filtering and Read Access Enforcement** **Given** a user loads the Project or Flow list view **When** the user lacks the **Read/View** permission for an entity **Then** that entity should **not** be displayed in the list view **When** a user attempts to **view the editor, execute, save/export, or download** a Flow/Project **Then** the `AuthService` should confirm **Read/View** permission **And** the action should be blocked if permission is denied |
| **2.3** | **Enforce Create Permission on Projects & Flows** | **Scenario: Blocking Unauthorized Flow Creation** **Given** a non-Admin user is logged in **When** the user views the Project interface **Then** the UI elements (e.g., buttons, options) for **creating a new Flow** must be hidden or disabled if the user lacks the **Create** permission on that Project scope **And** if the user attempts to bypass the UI (e.g., API call), the `AuthService` should block the creation |
| **2.4** | **Enforce Update/Edit Permission for Projects & Flows** | **Scenario: Preventing Edits for Unauthorized Users** **Given** a user loads the editor for a Project or Flow **When** the user lacks the **Update/Edit** permission **Then** the editor should load in a **read-only state** **And** the user should be prevented from making any changes/edits **And** the check must also occur before allowing **import** functionality |
| **2.5** | **Enforce Delete Permission for Projects & Flows** | **Scenario: Blocking Unauthorized Deletion** **Given** a user views the interface for a Project or Flow **When** the user does not have the **Delete** permission **Then** the UI elements (e.g., buttons, options) for **deleting** the entity must be hidden or disabled **And** if the user attempts to bypass the UI, the `AuthService` should block the action **And** the action should only be permitted if the user is an **Admin** or has the **Owner** role for the scope entity |

###

### **Epic 3: Web-based Admin Management Interface**

**Goal:** Deliver a **centralized, secure, web-based administrative UI** to enable the **Admin** role to efficiently manage all role assignments.

| Story \# | Short Description | Gherkin Acceptance Criteria |
| :---- | :---- | :---- |
| **3.1** | **RBAC Management Section in the Admin Page** | **Scenario: Centralized RBAC Management Section** **Given** a Admin Page exists which contains the User Management section today, a new RBAC Management section gets added to the Admin Page, and Admin Page has two two tabs now with the User Management Section(default one to open when user accesses the Admin Page) and the RBAC Management section and a deep link exists for the RBAC management section within the Admin Page **When** an **Admin** user accesses the Admin Page **Then** she should be able to access the **RBAC Management section** **When** a non-Admin user accesses the Admin Page **Then** she should NOT be able to access the **RBAC Management section When** a Admin user tries to access the deeplink for the RBAC management section **Then** she should be able to access the **RBAC Management section** **When** a non-Admin user tries to access the deeplink for the RBAC management section **Then** the system should display an **Access Denied** message |
| **3.2** | **Assignment Creation Workflow (New Roles)** | **Scenario: Assigning a New Role to a User** **Given** an **Admin** is in the RBAC management section **When** the Admin initiates the new assignment workflow **Then** the workflow should guide the Admin through sequential steps: **Select User** → **Select Scope** → **Select Role** → **Confirm** **And** the only assignable role options should be the four default roles or the global Admin role **When** the Admin confirms the assignment **Then** the Core Role Assignment Logic (Epic 1.3) should be successfully called |
| **3.3** | **Assignment List View and Filtering** | **Scenario: Viewing and Filtering All Assignments** **Given** an **Admin** is in the RBAC management section **When** the master assignment list view is displayed **Then** the list should show all active `User: Scope: Role` assignments **And** the list should be filterable by **User**, **Role**, and **Scope Entity** **And** a clear mechanism should be available to **directly delete** any assignment from the list view |
| **3.4** | **Assignment Editing and Removal** | **Scenario: Modifying an Existing Role** **Given** an **Admin** selects an assignment from the master list to edit **When** the Admin changes the Role for that specific scope **Then** the system should call the Core Role Assignment Logic (Epic 1.3) to update the assignment |
| **3.5** | **Flow Role Inheritance Display Rule** | **Scenario: Displaying Flow Role Information** **Given** a user has an inherited role from a Project **When** the Admin views the assignment list **Then** the list **should not** display a specific assignment entry for the inherited Flow role **When** the Admin views the assignment interface **Then** a clear message should be displayed: *"Project-level assignments are inherited by contained Flows and can be overridden by explicit Flow-specific roles."* |

###

### **Epic 5: Non-Functional Requirements**

**Goal:** Define measurable criteria for performance, reliability, and responsiveness, and ensure the system supports required data access rights for compliance purposes (GDPR/CCPA).

| Story \# | Short Description | Gherkin Acceptance Criteria |
| :---- | :---- | :---- |
| **5.1** | **Role Assignment and Enforcement Latency** | **Scenario:** Latency for CanAccess Check **Given** the authorization service (AuthService) is running at 50% average load **When** the AuthService.CanAccess method is called for any user/permission/scope combination **Then** the check must return a response in **less than 50 milliseconds (p95)**. **Scenario:** Latency for Assignment Creation **Given** an **Admin** executes an assignment update/create via the API **When** the Core Role Assignment Logic (Epic 1.3) is executed **Then** the API response time should be **less than 200 milliseconds (p95)**. |
| **5.2** | **System Uptime and Availability** | **Scenario:** System Availability Requirement **Given** all core services (Auth, RBAC Data Store, AuthService) are monitored **When** measuring system availability over a calendar month **Then** the overall platform uptime must meet **99.9% availability** (excluding scheduled maintenance). |
| **5.3** | **Readiness Time (Initial Load)** | **Scenario:** Editor Load Time with RBAC Check **Given** a user loads the Project/Flow editor page **When** the page requires the initial bulk permission check (e.g., hiding create/delete buttons) **Then** the entire page load, including the RBAC checks, must be completed in **less than 2.5 seconds (p95)**. |

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ lib-cov

# Coverage directory used by tools like istanbul
coverage
coverage-*/
*.lcov

# nyc test coverage
Expand Down
Loading