@fleetbase/solid-engine 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/composer.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbase/solid-api",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Solid Protocol Extension to Store and Share Data with Fleetbase",
5
5
  "keywords": [
6
6
  "fleetbase-extension",
package/extension.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "Solid",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Solid Protocol Extension to Store and Share Data with Fleetbase",
5
5
  "repository": "https://github.com/fleetbase/solid",
6
6
  "license": "AGPL-3.0-or-later",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fleetbase/solid-engine",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "Solid Protocol Extension to Store and Share Data with Fleetbase",
5
5
  "fleetbase": {
6
6
  "route": "solid-protocol"
package/ACL_SOLUTION.md DELETED
@@ -1,72 +0,0 @@
1
- # THE REAL ROOT CAUSE - ACL Permissions
2
-
3
- ## Summary
4
-
5
- The 401 errors are NOT due to authentication or token issues. **The root ACL of each pod does not grant write permissions.**
6
-
7
- ## Key Facts
8
-
9
- 1. **CSS default root ACL grants only `acl:Read`** to the authenticated user
10
- 2. **Without `acl:Write` or `acl:Append` in the root ACL**, all write operations fail
11
- 3. **WAC-Allow header shows `user="read"`** - confirming no write permissions
12
- 4. **CSS has no built-in UI** for managing ACLs across pods
13
- 5. **Must update ACL programmatically** before first write operation
14
-
15
- ## The Solution
16
-
17
- Before creating any folders or resources, **update the pod's root ACL** to grant write permissions.
18
-
19
- ### Workflow
20
-
21
- 1. User logs in via OIDC (get access token + DPoP key)
22
- 2. Determine pod root URL (e.g., `http://solid:3000/test/`)
23
- 3. **Check if ACL grants write access** by inspecting WAC-Allow header
24
- 4. **If no write access, update the root ACL** at `<podRoot>/.acl`
25
- 5. After ACL update, create containers/resources
26
-
27
- ### ACL Document Format
28
-
29
- ```turtle
30
- @prefix acl: <http://www.w3.org/ns/auth/acl#>.
31
-
32
- # Full rights for the pod owner (required)
33
- <#owner>
34
- a acl:Authorization;
35
- acl:agent <https://solid.example/user#me>;
36
- acl:accessTo <https://solid.example/userpod/>;
37
- acl:default <https://solid.example/userpod/>;
38
- acl:mode acl:Read, acl:Write, acl:Control.
39
-
40
- # Append and read rights for the Fleetbase integration
41
- <#fleetbase>
42
- a acl:Authorization;
43
- acl:agent <https://fleetbase.com/agent#me>;
44
- acl:accessTo <https://solid.example/userpod/>;
45
- acl:default <https://solid.example/userpod/>;
46
- acl:mode acl:Append, acl:Read.
47
- ```
48
-
49
- ### Implementation Steps
50
-
51
- 1. **GET** `<podRoot>` to check WAC-Allow header
52
- 2. If lacks `append`/`write`, prepare ACL Turtle document
53
- 3. **PUT** `<podRoot>/.acl` with DPoP authentication
54
- 4. After successful ACL update, proceed with folder creation
55
-
56
- ## Why This Matters
57
-
58
- - **acl:agent** identifies who gets the permissions (use WebID)
59
- - **acl:accessTo** applies to the pod root
60
- - **acl:default** inherits to all descendants
61
- - **acl:Append** allows creating resources
62
- - **acl:Write** allows updating existing ones
63
-
64
- ## For Fleetbase Integration
65
-
66
- The integration should:
67
- 1. Check ACL permissions on first access
68
- 2. Prompt user or automatically update ACL
69
- 3. Use `acl:Append` mode (safer than full Write)
70
- 4. Store ACL update status to avoid repeated checks
71
-
72
- This is **not a bug in our code** - it's the expected CSS behavior. Every pod needs explicit ACL configuration for write access.
@@ -1,140 +0,0 @@
1
- # CSS Scope Issue - Root Cause Analysis
2
-
3
- ## The Problem
4
-
5
- Access tokens have `"scope": ""` (empty) even though:
6
- - ✅ Client is registered with `"scope":"openid webid offline_access"`
7
- - ✅ CSS server supports `["openid", "profile", "offline_access", "webid"]`
8
- - ✅ Our code requests `['openid', 'webid', 'offline_access']`
9
-
10
- ## Investigation Findings
11
-
12
- ### 1. Client Registration (CORRECT)
13
-
14
- File: `/data/.internal/idp/adapter/Client/jwRIERi9-RW7LU_42zM3f$.json`
15
-
16
- ```json
17
- {
18
- "client_id": "jwRIERi9-RW7LU_42zM3f",
19
- "client_name": "Fleetbase-v2",
20
- "scope": "openid webid offline_access", ← Registered correctly
21
- "dpop_bound_access_tokens": false ← Should this be true?
22
- }
23
- ```
24
-
25
- ### 2. CSS Server Configuration (CORRECT)
26
-
27
- File: `/config/config/identity/handler/base/provider-factory.json`
28
-
29
- ```json
30
- {
31
- "scopes": ["openid", "profile", "offline_access", "webid"], ← Server supports these
32
- "features": {
33
- "dPoP": { "enabled": true }
34
- }
35
- }
36
- ```
37
-
38
- ### 3. Grant Storage (ISSUE FOUND!)
39
-
40
- File: `/data/.internal/idp/adapter/Grant/-HGiJLKCUJ7CZcU0ePOWQdw84p_WSNKWp3ajB3Q_mf3$.json`
41
-
42
- ```json
43
- {
44
- "accountId": "http://solid:3000/test/profile/card#me",
45
- "clientId": "jwRIERi9-RW7LU_42zM3f",
46
- "openid": {
47
- "scope": "openid webid" ← Only these two! Missing offline_access!
48
- }
49
- }
50
- ```
51
-
52
- **Problem:** The grant only includes `"openid webid"`, not `"offline_access"`.
53
-
54
- ### 4. Access Token (RESULT)
55
-
56
- From logs:
57
- ```json
58
- {
59
- "webid": "http://solid:3000/test/profile/card#me",
60
- "scope": "", ← Empty!
61
- "client_id": "jwRIERi9-RW7LU_42zM3f"
62
- }
63
- ```
64
-
65
- ## Root Cause
66
-
67
- The scope is stored in the Grant under the `"openid"` key:
68
- ```json
69
- "openid": {"scope": "openid webid"}
70
- ```
71
-
72
- But CSS might not be extracting it correctly when issuing access tokens, resulting in empty scope.
73
-
74
- ## Possible Solutions
75
-
76
- ### Option 1: Fix Grant Scope Storage
77
-
78
- CSS might be storing scopes incorrectly. This could be:
79
- - A CSS bug
80
- - A configuration issue
81
- - Expected behavior for certain grant types
82
-
83
- ### Option 2: Use Different Grant Type
84
-
85
- The current grant type might not support scopes properly. Try:
86
- - Client credentials grant (already tried, same issue)
87
- - Refresh token flow
88
- - Different authorization parameters
89
-
90
- ### Option 3: Manual Scope Injection
91
-
92
- Modify CSS code or configuration to ensure scopes are included in access tokens.
93
-
94
- ### Option 4: Workaround - Use ACL Without Scope
95
-
96
- Since the ACL is already correct and grants full permissions, the issue is that CSS requires `webid` scope to authenticate as the WebID.
97
-
98
- **Workaround:** Use a different authentication method that doesn't require scope:
99
- - CSS credential tokens (tried, same scope issue)
100
- - Direct WebID authentication
101
- - Bearer tokens without scope validation
102
-
103
- ## Next Steps
104
-
105
- 1. **Check if `dpop_bound_access_tokens` should be true**
106
- - Current: `false`
107
- - Might affect scope handling
108
-
109
- 2. **Verify authorization request includes scope parameter**
110
- - Check if scope is being sent during auth code exchange
111
- - Verify it's not being filtered out
112
-
113
- 3. **Test with explicit scope in token request**
114
- - Add scope parameter to token exchange request
115
- - See if CSS honors it
116
-
117
- 4. **Check CSS logs for scope-related warnings**
118
- - CSS might be logging why scopes are being dropped
119
-
120
- ## CSS Configuration Files Analyzed
121
-
122
- - `/config/config/oidc.json` - Main OIDC config
123
- - `/config/config/identity/oidc/default.json` - OIDC handler
124
- - `/config/config/identity/handler/base/provider-factory.json` - Scope definitions
125
- - `/config/config/ldp/metadata-writer/writers/www-auth.json` - WWW-Authenticate header
126
- - `/data/.internal/idp/adapter/Client/*` - Client registrations
127
- - `/data/.internal/idp/adapter/Grant/*` - Authorization grants
128
-
129
- ## Conclusion
130
-
131
- The issue is NOT with:
132
- - ❌ Client registration (correct)
133
- - ❌ Server configuration (correct)
134
- - ❌ Our code (correct)
135
-
136
- The issue IS with:
137
- - ✅ Grant scope storage (only `"openid webid"`, missing `"offline_access"`)
138
- - ✅ Access token scope extraction (returns empty instead of grant scopes)
139
-
140
- This appears to be a CSS behavior or bug where scopes are not properly propagated from grants to access tokens.
@@ -1,100 +0,0 @@
1
- # Hotfix: PodService.php Syntax Error
2
-
3
- ## Issue
4
- After the refactoring, a critical syntax error was introduced in `PodService.php` that broke **all** endpoints, including logout.
5
-
6
- ## Root Cause
7
- When adding the new methods `getPodUrlFromWebId()`, `createFolder()`, and `deleteResource()` to PodService.php, they were accidentally placed **outside** the class definition.
8
-
9
- **Before Fix (BROKEN):**
10
- ```php
11
- class PodService
12
- {
13
- // ... existing methods ...
14
-
15
- private function generateTurtleMetadata(string $name, ?string $description = null): string
16
- {
17
- // ...
18
- return $turtle;
19
- }
20
- } // ← Class closed here at line 743
21
-
22
- // ❌ Methods added OUTSIDE the class - SYNTAX ERROR!
23
- public function getPodUrlFromWebId(string $webId): string
24
- {
25
- // ...
26
- }
27
-
28
- public function createFolder(SolidIdentity $identity, string $folderUrl): bool
29
- {
30
- // ...
31
- }
32
-
33
- public function deleteResource(SolidIdentity $identity, string $resourceUrl): bool
34
- {
35
- // ...
36
- }
37
- }
38
- ```
39
-
40
- ## Error Message
41
- ```
42
- ParseError: syntax error, unexpected token "public", expecting end of file
43
- at /fleetbase/packages/solid/server/src/Services/PodService.php:751
44
- ```
45
-
46
- ## Fix Applied
47
- Moved the three methods **inside** the class before the closing brace.
48
-
49
- **After Fix (WORKING):**
50
- ```php
51
- class PodService
52
- {
53
- // ... existing methods ...
54
-
55
- private function generateTurtleMetadata(string $name, ?string $description = null): string
56
- {
57
- // ...
58
- return $turtle;
59
- }
60
-
61
- // ✅ Methods now INSIDE the class
62
- public function getPodUrlFromWebId(string $webId): string
63
- {
64
- // ...
65
- }
66
-
67
- public function createFolder(SolidIdentity $identity, string $folderUrl): bool
68
- {
69
- // ...
70
- }
71
-
72
- public function deleteResource(SolidIdentity $identity, string $resourceUrl): bool
73
- {
74
- // ...
75
- }
76
- } // ← Class properly closed at line 852
77
- ```
78
-
79
- ## Impact
80
- - **Before:** ALL endpoints returned 500 errors due to class loading failure
81
- - **After:** All endpoints working normally
82
-
83
- ## Files Modified
84
- - `server/src/Services/PodService.php` - Fixed class structure
85
-
86
- ## Testing
87
- After this fix:
88
- 1. ✅ Application loads without errors
89
- 2. ✅ Logout endpoint works
90
- 3. ✅ Authentication status endpoint works
91
- 4. ✅ All other endpoints functional
92
-
93
- ## Prevention
94
- - Always verify class structure when adding new methods
95
- - Use IDE with PHP syntax checking
96
- - Test basic endpoints after structural changes
97
- - Run `php -l` to check syntax before committing (if PHP CLI available)
98
-
99
- ## Apology
100
- This was a careless error on my part during the refactoring. I should have verified the class structure after adding the methods via the `append` action. The methods should have been inserted before the closing brace, not after.
@@ -1,135 +0,0 @@
1
- # Manual ACL Setup Guide
2
-
3
- ## The Problem
4
-
5
- CSS is not granting the `webid` scope even when requested during client registration and authentication. This means:
6
- - Access tokens have `"scope": ""` (empty)
7
- - Cannot programmatically update ACLs (requires `webid` scope)
8
- - Must manually set up root ACL with proper permissions
9
-
10
- ## The Solution
11
-
12
- Manually create the root ACL file for each pod using one of these methods:
13
-
14
- ### Method 1: Using curl (Recommended)
15
-
16
- ```bash
17
- # 1. Create ACL file
18
- cat > /tmp/root.acl << 'EOF'
19
- @prefix acl: <http://www.w3.org/ns/auth/acl#>.
20
-
21
- <#owner>
22
- a acl:Authorization;
23
- acl:agent <http://solid:3000/test/profile/card#me>;
24
- acl:accessTo <http://solid:3000/test/>;
25
- acl:default <http://solid:3000/test/>;
26
- acl:mode acl:Read, acl:Write, acl:Control.
27
- EOF
28
-
29
- # 2. Upload to CSS (requires admin access or direct file system access)
30
- curl -X PUT \
31
- -H "Content-Type: text/turtle" \
32
- --data-binary @/tmp/root.acl \
33
- http://solid:3000/test/.acl
34
- ```
35
-
36
- ### Method 2: Direct File System Access
37
-
38
- If you have access to the CSS server file system:
39
-
40
- ```bash
41
- # Navigate to the pod directory
42
- cd /path/to/css/data/test/
43
-
44
- # Create .acl file
45
- cat > .acl << 'EOF'
46
- @prefix acl: <http://www.w3.org/ns/auth/acl#>.
47
-
48
- <#owner>
49
- a acl:Authorization;
50
- acl:agent <http://solid:3000/test/profile/card#me>;
51
- acl:accessTo <http://solid:3000/test/>;
52
- acl:default <http://solid:3000/test/>;
53
- acl:mode acl:Read, acl:Write, acl:Control.
54
- EOF
55
-
56
- # Set proper permissions
57
- chmod 644 .acl
58
- ```
59
-
60
- ### Method 3: CSS Admin API (if available)
61
-
62
- If your CSS instance has an admin API:
63
-
64
- ```bash
65
- # Use admin credentials to create ACL
66
- curl -X PUT \
67
- -H "Authorization: Bearer <admin_token>" \
68
- -H "Content-Type: text/turtle" \
69
- --data-binary @root.acl \
70
- http://solid:3000/admin/pods/test/.acl
71
- ```
72
-
73
- ## ACL Template
74
-
75
- Replace `<WEBID>` and `<POD_URL>` with actual values:
76
-
77
- ```turtle
78
- @prefix acl: <http://www.w3.org/ns/auth/acl#>.
79
-
80
- # Full control for the pod owner
81
- <#owner>
82
- a acl:Authorization;
83
- acl:agent <WEBID>;
84
- acl:accessTo <POD_URL>;
85
- acl:default <POD_URL>;
86
- acl:mode acl:Read, acl:Write, acl:Control.
87
- ```
88
-
89
- **Example for test pod:**
90
- - WebID: `http://solid:3000/test/profile/card#me`
91
- - Pod URL: `http://solid:3000/test/`
92
-
93
- ## Verification
94
-
95
- After setting up the ACL, verify it works:
96
-
97
- ```bash
98
- # Check WAC-Allow header (should now include "write")
99
- curl -I http://solid:3000/test/
100
-
101
- # Expected response:
102
- # WAC-Allow: user="read write append control",public="read"
103
- ```
104
-
105
- ## For Fleetbase Integration
106
-
107
- Once the root ACL is set up:
108
-
109
- 1. ✅ User can create folders
110
- 2. ✅ User can import resources
111
- 3. ✅ All descendants inherit permissions (via `acl:default`)
112
- 4. ✅ No need for programmatic ACL updates
113
-
114
- ## Why This Is Necessary
115
-
116
- CSS does not grant `webid` scope by default, which means:
117
- - Cannot use OIDC tokens to update ACLs programmatically
118
- - Root ACL must be created manually during pod provisioning
119
- - This is expected behavior for CSS security model
120
-
121
- ## Long-Term Solution
122
-
123
- For production:
124
- 1. Configure CSS to grant `webid` scope (server configuration)
125
- 2. Or create root ACL during pod creation (provisioning hook)
126
- 3. Or use CSS admin API to set up ACLs automatically
127
-
128
- ## Current Status
129
-
130
- - ✅ Authentication works (DPoP + OIDC)
131
- - ✅ Read operations work
132
- - ❌ Write operations fail (no ACL permissions)
133
- - ❌ Cannot update ACL (no `webid` scope)
134
-
135
- **Action Required:** Manually create root ACL for each pod using one of the methods above.
@@ -1,330 +0,0 @@
1
- # Solid Extension Refactoring Summary
2
-
3
- ## Overview
4
- Refactored the Fleetbase Solid Protocol extension from a multi-pod architecture to a single-pod architecture with user-friendly terminology.
5
-
6
- ## Key Changes
7
-
8
- ### Terminology Updates
9
- - **"Pods" → "Data"**: More intuitive for users to understand they're managing their data
10
- - **"Container" → "Folder"**: Familiar file system metaphor instead of technical Solid terminology
11
-
12
- ### Architecture Shift
13
- **Before (Multi-Pod):**
14
- - Users could create multiple pods
15
- - Complex pod listing and management UI
16
- - Cross-pod authentication issues
17
- - Routes: `pods`, `pods.index`, `pods.explorer`, `pods.index.pod`
18
-
19
- **After (Single-Pod):**
20
- - Users have ONE primary pod from OIDC authentication
21
- - Data organized in folders within the pod (vehicles/, drivers/, contacts/, orders/)
22
- - Simplified permissions model
23
- - Routes: `data`, `data.content`
24
-
25
- ---
26
-
27
- ## Frontend Changes
28
-
29
- ### Routes Refactored
30
- **File:** `addon/routes.js`
31
-
32
- **Old Structure:**
33
- ```javascript
34
- this.route('pods', function () {
35
- this.route('explorer', { path: '/explorer/:id' }, function () {
36
- this.route('content', { path: '/~/:slug' });
37
- });
38
- this.route('index', { path: '/' }, function () {
39
- this.route('pod', { path: '/pod/:slug' });
40
- });
41
- });
42
- ```
43
-
44
- **New Structure:**
45
- ```javascript
46
- this.route('data', { path: '/data' }, function () {
47
- this.route('content', { path: '/:slug' });
48
- });
49
- ```
50
-
51
- ### Files Created
52
- 1. **`addon/routes/data/index.js`** - Main data browser route
53
- 2. **`addon/routes/data/content.js`** - Folder navigation route
54
- 3. **`addon/controllers/data/index.js`** - Data browser controller with folder operations
55
- 4. **`addon/controllers/data/content.js`** - Folder content controller
56
- 5. **`addon/templates/data/index.hbs`** - Data browser template
57
- 6. **`addon/templates/data/content.hbs`** - Folder content viewer template
58
-
59
- ### Files Removed
60
- - `addon/routes/pods/` (entire directory)
61
- - `addon/controllers/pods/` (entire directory)
62
- - `addon/templates/pods/` (entire directory)
63
-
64
- ### Files Updated
65
- 1. **`addon/templates/application.hbs`**
66
- - Updated sidebar navigation: `console.solid-protocol.pods` → `console.solid-protocol.data`
67
-
68
- 2. **`addon/templates/home.hbs`**
69
- - "Browse Pods" → "Browse Data"
70
- - "Explore and manage your Solid pods" → "Explore and manage your Fleetops data in Solid"
71
- - Updated all pod references to use "storage" terminology
72
-
73
- 3. **`addon/controllers/home.js`**
74
- - `navigateToPods()` now routes to `console.solid-protocol.data`
75
-
76
- ---
77
-
78
- ## Backend Changes
79
-
80
- ### New Controller
81
- **File:** `server/src/Http/Controllers/DataController.php`
82
-
83
- **Methods:**
84
- - `index()` - Get root level contents of user's pod
85
- - `showFolder($slug)` - Get contents of a specific folder
86
- - `createFolder()` - Create a new folder in the pod
87
- - `deleteItem($type, $slug)` - Delete a file or folder
88
- - `importResources()` - Import Fleetops resources into folders
89
-
90
- ### Routes Updated
91
- **File:** `server/src/routes.php`
92
-
93
- **Old Routes:**
94
- ```php
95
- $router->get('pods', 'PodController@index');
96
- $router->post('pods', 'PodController@create');
97
- $router->get('pods/{podId}', 'PodController@show');
98
- $router->delete('pods/{podId}', 'PodController@destroy');
99
- $router->post('import-resources', 'PodController@importResources');
100
-
101
- $router->get('containers', 'ContainerController@index');
102
- $router->post('containers', 'ContainerController@create');
103
- $router->delete('containers/{containerName}', 'ContainerController@destroy');
104
- ```
105
-
106
- **New Routes:**
107
- ```php
108
- $router->get('data', 'DataController@index');
109
- $router->get('data/folder/{slug}', 'DataController@showFolder');
110
- $router->post('data/folder', 'DataController@createFolder');
111
- $router->delete('data/{type}/{slug}', 'DataController@deleteItem');
112
- $router->post('data/import', 'DataController@importResources');
113
- ```
114
-
115
- ### Service Methods Added
116
- **File:** `server/src/Services/PodService.php`
117
-
118
- **New Methods:**
119
- - `createFolder(SolidIdentity $identity, string $folderUrl): bool`
120
- - Creates a folder (LDP BasicContainer) in the pod
121
- - Uses PUT request with proper Content-Type and Link headers
122
-
123
- - `deleteResource(SolidIdentity $identity, string $resourceUrl): bool`
124
- - Deletes a file or folder from the pod
125
- - Uses DELETE request
126
-
127
- **Existing Method Used:**
128
- - `getPodUrlFromWebId(string $webId): string`
129
- - Extracts the pod URL from the user's WebID
130
- - Example: `http://solid:3000/test/profile/card#me` → `http://solid:3000/test/`
131
-
132
- ---
133
-
134
- ## API Endpoint Mapping
135
-
136
- ### Frontend → Backend
137
- | Frontend Route | API Endpoint | Controller Method |
138
- |----------------|--------------|-------------------|
139
- | `data.index` | `GET /data` | `DataController@index` |
140
- | `data.content/:slug` | `GET /data/folder/:slug` | `DataController@showFolder` |
141
- | Create folder action | `POST /data/folder` | `DataController@createFolder` |
142
- | Delete item action | `DELETE /data/:type/:slug` | `DataController@deleteItem` |
143
- | Import resources | `POST /data/import` | `DataController@importResources` |
144
-
145
- ---
146
-
147
- ## User Experience Improvements
148
-
149
- ### Navigation
150
- - **Sidebar:** "Data" instead of "Pods"
151
- - **Home Page:** "Browse Data" quick action
152
- - **Breadcrumbs:** Will show folder hierarchy instead of pod names
153
-
154
- ### Data Browser Features
155
- 1. **Folder Management**
156
- - Create new folders with "New Folder" button
157
- - Browse folders like a file explorer
158
- - Delete folders and files
159
-
160
- 2. **Resource Import**
161
- - "Import Resources" button in data browser
162
- - Select resource types: Vehicles, Drivers, Contacts, Orders
163
- - Resources imported into respective folders in the pod
164
-
165
- 3. **File Operations**
166
- - View file information in overlay
167
- - Open files in new tab
168
- - Delete files with confirmation
169
-
170
- ---
171
-
172
- ## Technical Benefits
173
-
174
- ### Simplified Architecture
175
- 1. **No Multi-Pod Management**
176
- - Removed pod listing complexity
177
- - Removed pod creation/deletion UI
178
- - Removed pod selection logic
179
-
180
- 2. **Single Authentication Flow**
181
- - One DPoP-bound access token for the user's pod
182
- - No cross-pod permission issues
183
- - Cleaner token management
184
-
185
- 3. **Standard Solid Patterns**
186
- - Follows Solid specification for single-pod-per-user
187
- - Uses LDP containers (folders) for organization
188
- - Proper RDF/Turtle format for resources
189
-
190
- ### Code Cleanliness
191
- 1. **Removed Unused Code**
192
- - Deleted 12 files related to multi-pod management
193
- - Removed unused routes and controllers
194
- - Cleaner route structure (2 routes vs 4)
195
-
196
- 2. **Clear Naming**
197
- - `DataController` vs `PodController` - clearer intent
198
- - `data/folder` routes - self-documenting
199
- - User-facing terms match technical implementation
200
-
201
- ---
202
-
203
- ## Data Organization
204
-
205
- ### Pod Structure
206
- ```
207
- http://solid:3000/user/
208
- ├── vehicles/
209
- │ ├── vehicle-uuid-1.ttl
210
- │ ├── vehicle-uuid-2.ttl
211
- │ └── ...
212
- ├── drivers/
213
- │ ├── driver-uuid-1.ttl
214
- │ └── ...
215
- ├── contacts/
216
- │ ├── contact-uuid-1.ttl
217
- │ └── ...
218
- └── orders/
219
- ├── order-uuid-1.ttl
220
- └── ...
221
- ```
222
-
223
- ### Resource Format
224
- Each resource is stored as an RDF/Turtle file with semantic metadata following Solid conventions.
225
-
226
- ---
227
-
228
- ## Next Steps
229
-
230
- ### Testing Required
231
- 1. **Authentication Flow**
232
- - Verify OIDC authentication still works
233
- - Check DPoP token binding
234
- - Confirm pod URL extraction from WebID
235
-
236
- 2. **Data Browser**
237
- - Test folder creation
238
- - Test folder navigation
239
- - Test file deletion
240
- - Test search functionality
241
-
242
- 3. **Resource Import**
243
- - Test importing vehicles
244
- - Test importing drivers
245
- - Test importing contacts
246
- - Test importing orders
247
- - Verify RDF/Turtle format
248
- - Check folder creation for each resource type
249
-
250
- 4. **Error Handling**
251
- - Test 401 unauthorized scenarios
252
- - Test invalid folder names
253
- - Test deleting non-existent resources
254
-
255
- ### Future Enhancements
256
- 1. **Incremental Sync**
257
- - Only sync changed resources
258
- - Track last sync timestamp
259
- - Show sync status per resource type
260
-
261
- 2. **Resource Filtering**
262
- - Filter by date range
263
- - Filter by status
264
- - Search within resources
265
-
266
- 3. **Sync History**
267
- - Track sync operations
268
- - Show sync logs
269
- - Rollback capability
270
-
271
- 4. **Real-time Sync**
272
- - Webhook integration with Fleetops
273
- - Automatic sync on data changes
274
- - Conflict resolution
275
-
276
- ---
277
-
278
- ## Migration Notes
279
-
280
- ### For Developers
281
- - Update any references to `pods` routes to use `data` routes
282
- - Replace `PodController` usage with `DataController`
283
- - Update API calls from `import-resources` to `data/import`
284
- - Remove any pod selection logic from components
285
-
286
- ### For Users
287
- - Existing data: Users will need to re-import resources into their primary pod
288
- - No action required for authentication - existing OIDC flow remains the same
289
- - UI will automatically reflect new "Data" terminology
290
-
291
- ---
292
-
293
- ## Files Modified Summary
294
-
295
- ### Created (7 files)
296
- - `addon/routes/data/index.js`
297
- - `addon/routes/data/content.js`
298
- - `addon/controllers/data/index.js`
299
- - `addon/controllers/data/content.js`
300
- - `addon/templates/data/index.hbs`
301
- - `addon/templates/data/content.hbs`
302
- - `server/src/Http/Controllers/DataController.php`
303
-
304
- ### Modified (6 files)
305
- - `addon/routes.js`
306
- - `addon/templates/application.hbs`
307
- - `addon/templates/home.hbs`
308
- - `addon/controllers/home.js`
309
- - `server/src/routes.php`
310
- - `server/src/Services/PodService.php`
311
-
312
- ### Deleted (12 files)
313
- - `addon/routes/pods/explorer.js`
314
- - `addon/routes/pods/explorer/content.js`
315
- - `addon/routes/pods/index.js`
316
- - `addon/routes/pods/index/pod.js`
317
- - `addon/controllers/pods/explorer.js`
318
- - `addon/controllers/pods/explorer/content.js`
319
- - `addon/controllers/pods/index.js`
320
- - `addon/controllers/pods/index/pod.js`
321
- - `addon/templates/pods/explorer.hbs`
322
- - `addon/templates/pods/explorer/content.hbs`
323
- - `addon/templates/pods/index.hbs`
324
- - `addon/templates/pods/index/pod.hbs`
325
-
326
- ---
327
-
328
- ## Conclusion
329
-
330
- This refactoring significantly simplifies the Solid extension architecture while improving user experience through familiar terminology. The single-pod approach aligns with Solid best practices and eliminates cross-pod authentication complexity. The codebase is now cleaner, more maintainable, and easier for developers to understand.
@@ -1,82 +0,0 @@
1
- # Refactoring Verification Checklist
2
-
3
- ## Code Cleanup ✓
4
- - [x] Removed old `addon/routes/pods/` directory
5
- - [x] Removed old `addon/controllers/pods/` directory
6
- - [x] Removed old `addon/templates/pods/` directory
7
- - [x] Removed `server/src/Http/Controllers/PodController.php`
8
- - [x] Removed `server/src/Http/Controllers/ContainerController.php`
9
- - [x] Removed commented code from `addon/templates/application.hbs`
10
- - [x] Removed commented routes from `server/src/routes.php`
11
-
12
- ## New Files Created ✓
13
- - [x] `addon/routes/data/index.js`
14
- - [x] `addon/routes/data/content.js`
15
- - [x] `addon/controllers/data/index.js`
16
- - [x] `addon/controllers/data/content.js`
17
- - [x] `addon/templates/data/index.hbs`
18
- - [x] `addon/templates/data/content.hbs`
19
- - [x] `server/src/Http/Controllers/DataController.php`
20
-
21
- ## Routes Updated ✓
22
- - [x] `addon/routes.js` - Simplified to data routes
23
- - [x] `server/src/routes.php` - Updated API endpoints
24
-
25
- ## Templates Updated ✓
26
- - [x] `addon/templates/application.hbs` - Sidebar navigation
27
- - [x] `addon/templates/home.hbs` - Quick actions and terminology
28
-
29
- ## Controllers Updated ✓
30
- - [x] `addon/controllers/home.js` - Navigation method
31
-
32
- ## Services Updated ✓
33
- - [x] `server/src/Services/PodService.php` - Added createFolder() and deleteResource()
34
-
35
- ## Terminology Changes ✓
36
- - [x] "Pods" → "Data" throughout UI
37
- - [x] "Container" → "Folder" in code comments and user-facing text
38
- - [x] Updated all user-facing messages
39
-
40
- ## Testing Required
41
- - [ ] OIDC authentication flow
42
- - [ ] Pod URL extraction from WebID
43
- - [ ] Data browser loads correctly
44
- - [ ] Folder creation works
45
- - [ ] Folder navigation works
46
- - [ ] File/folder deletion works
47
- - [ ] Resource import (vehicles, drivers, contacts, orders)
48
- - [ ] Search functionality
49
- - [ ] Error handling (401, invalid inputs)
50
-
51
- ## API Endpoints to Test
52
-
53
- ### GET /solid/int/v1/data
54
- Expected: Returns root contents of user's pod
55
-
56
- ### GET /solid/int/v1/data/folder/{slug}
57
- Expected: Returns contents of specified folder
58
-
59
- ### POST /solid/int/v1/data/folder
60
- Payload: `{ "name": "test-folder", "path": "" }`
61
- Expected: Creates new folder
62
-
63
- ### DELETE /solid/int/v1/data/{type}/{slug}
64
- Example: `DELETE /solid/int/v1/data/folder/vehicles`
65
- Expected: Deletes specified folder or file
66
-
67
- ### POST /solid/int/v1/data/import
68
- Payload: `{ "resource_types": ["vehicles", "drivers"] }`
69
- Expected: Imports selected resources into folders
70
-
71
- ## Files Count Summary
72
- - **Created:** 7 files
73
- - **Modified:** 6 files
74
- - **Deleted:** 14 files (12 frontend + 2 backend)
75
- - **Net change:** -1 files (cleaner codebase!)
76
-
77
- ## Code Quality Checks
78
- - [x] No references to old `pods.explorer` or `pods.index` routes
79
- - [x] No references to `PodController` or `ContainerController`
80
- - [x] All imports and dependencies updated
81
- - [x] Consistent naming conventions (data/folder)
82
- - [x] Clean, readable code structure