@fleetbase/solid-engine 0.0.2
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/.php-cs-fixer.php +29 -0
- package/LICENSE.md +21 -0
- package/README.md +222 -0
- package/addon/components/admin/solid-server-config.hbs +19 -0
- package/addon/components/admin/solid-server-config.js +52 -0
- package/addon/components/solid-brand-icon.hbs +9 -0
- package/addon/components/solid-brand-icon.js +13 -0
- package/addon/controllers/application.js +27 -0
- package/addon/engine.js +40 -0
- package/addon/routes/application.js +14 -0
- package/addon/routes.js +3 -0
- package/addon/styles/solid-engine.css +29 -0
- package/addon/templates/application.hbs +15 -0
- package/app/components/admin/solid-server-config.js +1 -0
- package/app/components/solid-brand-icon.js +1 -0
- package/app/controllers/application.js +1 -0
- package/app/routes/application.js +1 -0
- package/composer.json +96 -0
- package/config/environment.js +11 -0
- package/extension.json +8 -0
- package/index.js +26 -0
- package/package.json +134 -0
- package/phpstan.neon.dist +8 -0
- package/phpunit.xml.dist +16 -0
- package/server/config/solid.php +21 -0
- package/server/migrations/2024_04_09_064616_create_solid_identities_table.php +33 -0
- package/server/src/Client/OpenIDConnectClient.php +217 -0
- package/server/src/Client/SolidClient.php +186 -0
- package/server/src/Http/Controllers/OIDCController.php +32 -0
- package/server/src/Http/Controllers/SolidController.php +117 -0
- package/server/src/LegacyClient/Identity/IdentityProvider.php +174 -0
- package/server/src/LegacyClient/Identity/Profile.php +18 -0
- package/server/src/LegacyClient/OIDCClient.php +350 -0
- package/server/src/LegacyClient/Profile/WebID.php +26 -0
- package/server/src/LegacyClient/SolidClient.php +270 -0
- package/server/src/Models/SolidIdentity.php +131 -0
- package/server/src/Providers/SolidServiceProvider.php +62 -0
- package/server/src/Support/Utils.php +9 -0
- package/server/src/routes.php +47 -0
- package/server/tests/Feature.php +5 -0
- package/translations/en-us.yaml +2 -0
- package/tsconfig.declarations.json +10 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<?php
|
|
2
|
+
|
|
3
|
+
$finder = PhpCsFixer\Finder::create()
|
|
4
|
+
->in(__DIR__ . DIRECTORY_SEPARATOR . 'server' . DIRECTORY_SEPARATOR . 'tests')
|
|
5
|
+
->in(__DIR__ . DIRECTORY_SEPARATOR . 'server' . DIRECTORY_SEPARATOR . 'src')
|
|
6
|
+
->append(['.php-cs-fixer.php']);
|
|
7
|
+
|
|
8
|
+
$rules = [
|
|
9
|
+
'@Symfony' => true,
|
|
10
|
+
'phpdoc_no_empty_return' => false,
|
|
11
|
+
'array_syntax' => ['syntax' => 'short'],
|
|
12
|
+
'yoda_style' => false,
|
|
13
|
+
'binary_operator_spaces' => [
|
|
14
|
+
'operators' => [
|
|
15
|
+
'=>' => 'align',
|
|
16
|
+
'=' => 'align',
|
|
17
|
+
],
|
|
18
|
+
],
|
|
19
|
+
'concat_space' => ['spacing' => 'one'],
|
|
20
|
+
'not_operator_with_space' => false,
|
|
21
|
+
'increment_style' => ['style' => 'post'],
|
|
22
|
+
'indentation_type' => true,
|
|
23
|
+
'single_quote' => true,
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
return (new PhpCsFixer\Config())
|
|
27
|
+
->setUsingCache(true)
|
|
28
|
+
->setRules($rules)
|
|
29
|
+
->setFinder($finder);
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Fleetbase
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<p align="center">
|
|
3
|
+
<img src="https://github.com/fleetbase/solid/assets/816371/aeff9036-6807-4e0a-a859-1dd5bee49c02" width="280" height="280" />
|
|
4
|
+
</p>
|
|
5
|
+
<p align="center">
|
|
6
|
+
Solid Protocol Extension to Store and Share Data with Fleetbase
|
|
7
|
+
</p>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
# Introduction:
|
|
11
|
+
|
|
12
|
+
Solid, an innovative technology developed by Sir Tim Berners-Lee, offers a groundbreaking approach to managing data by enabling decentralized data ownership and interoperability through Linked Data principles. In the realm of logistics, Solid presents a promising solution for revolutionizing supply chain management by facilitating seamless data sharing among stakeholders. This document outlines Solid's capabilities and requirements for implementing a logistics solution, along with a user needs assessment highlighting UI/UX changes necessary for optimal user experience.
|
|
13
|
+
|
|
14
|
+
## Solid's Capabilities for Logistics:
|
|
15
|
+
|
|
16
|
+
- **Decentralized Data Ownership:** Solid allows individual entities, such as companies and suppliers, to maintain ownership of their data while granting controlled access to authorized parties. This feature ensures data security and privacy, crucial aspects in logistics operations.
|
|
17
|
+
|
|
18
|
+
- **Linked Data Sharing:** Solid's ability to establish a knowledge graph facilitates interconnectedness among disparate data sources. This is particularly beneficial for supply chain management, as it enables holistic insights and transparency across the entire supply chain network.
|
|
19
|
+
|
|
20
|
+
- **Interoperability:** Solid promotes interoperability by standardizing data formats and protocols, enabling seamless communication and integration between different systems and platforms. This facilitates smooth data exchange between logistics partners and enhances operational efficiency.
|
|
21
|
+
|
|
22
|
+
- **Collaborative Workflows:** With Solid, logistics stakeholders can collaborate in real-time, share updates, and coordinate activities effectively. This fosters greater synergy and coordination within the supply chain ecosystem, leading to improved decision-making and responsiveness.
|
|
23
|
+
|
|
24
|
+
## Requirements for Logistics Solution on Solid:
|
|
25
|
+
|
|
26
|
+
- **Solid Compatibility:** Fleetbase must be compatible with Solid's architecture, ensuring seamless integration and data exchange within the Solid ecosystem.
|
|
27
|
+
|
|
28
|
+
- **Data Security and Privacy:** Robust mechanisms for data security and privacy protection must be implemented to safeguard sensitive logistics information shared through Solid.
|
|
29
|
+
|
|
30
|
+
- **Linked Data Integration:** Fleetbase should leverage Solid's linked data capabilities to establish a comprehensive knowledge graph that connects relevant supply chain data points, enabling advanced analytics and insights generation.
|
|
31
|
+
|
|
32
|
+
- **Interoperability Standards:** Adherence to interoperability standards and protocols endorsed by Solid is essential to ensure compatibility and smooth interoperability with other logistics systems and platforms.
|
|
33
|
+
|
|
34
|
+
- **User-Friendly Interface:** The solution should feature an intuitive user interface (UI) that simplifies data interaction and facilitates seamless navigation for logistics professionals across different roles and responsibilities.
|
|
35
|
+
|
|
36
|
+
## Project Milestones:
|
|
37
|
+
|
|
38
|
+
1. **Research and planning - Milestone 1**
|
|
39
|
+
|
|
40
|
+
2. **Back End Development - Solid Server, Solid Auth, Create Pods - Milestone 2**
|
|
41
|
+
|
|
42
|
+
3. **Back End Development - Pod for instance or Pod for Organization - Milestone 3**
|
|
43
|
+
|
|
44
|
+
4. **User Interface (UI) Enhancement - Manage Pod In Admin - Milestone 4**
|
|
45
|
+
|
|
46
|
+
5. **Further User Interface (UI) Enhancement - Milestone 5**
|
|
47
|
+
|
|
48
|
+
## User Needs Assessment: UI/UX Changes:
|
|
49
|
+
|
|
50
|
+
### Prerequisites:
|
|
51
|
+
|
|
52
|
+
- **Create Pod on Solid:** Begin by registering on Solid via [solidcommunity.net](https://solidcommunity.net).
|
|
53
|
+
- **Retrieve Web ID:** Obtain your Web ID from example: [shivthakker.solidcommunity.net](https://shivthakker.solidcommunity.net).
|
|
54
|
+
- **Ability to create pod using Fleetbase directly.**
|
|
55
|
+
|
|
56
|
+
### Installation and Setup:
|
|
57
|
+
|
|
58
|
+
- Install the ‘Solid Extension’ from Fleetbase Extensions Marketplace, accessible at the Instance Level.
|
|
59
|
+
- Add ‘Install Solid’ functionality within Fleetbase Extensions Tab.
|
|
60
|
+
- Create pod & server
|
|
61
|
+
- Input their server
|
|
62
|
+
- Input their solid ID on the server
|
|
63
|
+
- Once installed, users signing up or added to the company within this instance can utilize Solid for data management.
|
|
64
|
+
|
|
65
|
+
### User Authentication and Account Creation:
|
|
66
|
+
|
|
67
|
+
- Choose data storage preference: Browser Storage or Solid.
|
|
68
|
+
- Log in or sign up with your Solid Web ID.
|
|
69
|
+
- Authorize fleetbase.io to access your Pod.
|
|
70
|
+
- Solid allows precise control over data access permissions. Note: The current UI version (node-solid-server V5.1) supports toggling global access permissions only. If you prefer granular control, uncheck all boxes and authorize. Then, manage permissions explicitly.
|
|
71
|
+
|
|
72
|
+
### Features:
|
|
73
|
+
|
|
74
|
+
- Ability to link Fleetbase account with Solid Web ID later via user settings.
|
|
75
|
+
- View and manage data stored on Solid Pod:
|
|
76
|
+
- Orders
|
|
77
|
+
- Payload
|
|
78
|
+
- Entity
|
|
79
|
+
- Service Quote
|
|
80
|
+
- Purchase Rate
|
|
81
|
+
- Retrieve list of Solid Pods approved to receive data.
|
|
82
|
+
- Ability to add approved pods to send order data too (Verification Process)
|
|
83
|
+
- View order details
|
|
84
|
+
- Send order details
|
|
85
|
+
- Select Pod to send order details too
|
|
86
|
+
- Send order details to Solid partners:
|
|
87
|
+
- View Order
|
|
88
|
+
- Send Order
|
|
89
|
+
- Select from Dropdown of Solid Partners
|
|
90
|
+
- Confirmation popup for sending data
|
|
91
|
+
- Review and confirm data to be sent
|
|
92
|
+
- Access a separate table to view all data shared with you or shared with other Solid users.
|
|
93
|
+
|
|
94
|
+
# Funding
|
|
95
|
+
|
|
96
|
+
This project is funded through [NGI0 Entrust](https://nlnet.nl/entrust), a fund established by [NLnet](https://nlnet.nl) with financial support from the European Commission's [Next Generation Internet](https://ngi.eu) program. Learn more at the [NLnet project page]( https://nlnet.nl/project/Fleetbase-Solid).
|
|
97
|
+
|
|
98
|
+
[<img src="https://nlnet.nl/logo/banner.png" alt="NLnet foundation logo" width="20%" />](https://nlnet.nl)
|
|
99
|
+
|
|
100
|
+
# Conclusion:
|
|
101
|
+
|
|
102
|
+
Solid offers a robust foundation for developing innovative logistics solutions that prioritize data ownership, interoperability, and collaboration. By leveraging Solid's capabilities and addressing specific user needs through UI/UX enhancements, logistics stakeholders can unlock new levels of efficiency, transparency, and value creation in supply chain management.
|
|
103
|
+
|
|
104
|
+
This document serves as a roadmap for designing and implementing Solid on Fleetbase, guiding stakeholders towards harnessing the full potential of decentralized, linked data sharing in the logistics domain.
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Overview
|
|
110
|
+
|
|
111
|
+
This monorepo contains both the frontend and backend components of the Solid Protocol integration extension for Fleetbase. The frontend is built using Ember.js and the backend is implemented in PHP.
|
|
112
|
+
|
|
113
|
+
### Requirements
|
|
114
|
+
|
|
115
|
+
* PHP 7.3.0 or above
|
|
116
|
+
* Ember.js v4.8 or above
|
|
117
|
+
* Ember CLI v4.8 or above
|
|
118
|
+
* Node.js v18 or above
|
|
119
|
+
|
|
120
|
+
## Structure
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
├── addon
|
|
124
|
+
├── app
|
|
125
|
+
├── assets
|
|
126
|
+
├── translations
|
|
127
|
+
├── config
|
|
128
|
+
├── node_modules
|
|
129
|
+
├── server
|
|
130
|
+
│ ├── config
|
|
131
|
+
│ ├── data
|
|
132
|
+
│ ├── migrations
|
|
133
|
+
│ ├── resources
|
|
134
|
+
│ ├── src
|
|
135
|
+
│ ├── tests
|
|
136
|
+
│ └── vendor
|
|
137
|
+
├── tests
|
|
138
|
+
├── testem.js
|
|
139
|
+
├── index.js
|
|
140
|
+
├── package.json
|
|
141
|
+
├── phpstan.neon.dist
|
|
142
|
+
├── phpunit.xml.dist
|
|
143
|
+
├── pnpm-lock.yaml
|
|
144
|
+
├── ember-cli-build.js
|
|
145
|
+
├── composer.json
|
|
146
|
+
├── CONTRIBUTING.md
|
|
147
|
+
├── LICENSE.md
|
|
148
|
+
├── README.md
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Installation
|
|
152
|
+
|
|
153
|
+
### Backend
|
|
154
|
+
|
|
155
|
+
Install the PHP packages using Composer:
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
composer require fleetbase/core-api
|
|
159
|
+
composer require fleetbase/fleetops
|
|
160
|
+
composer require fleetbase/solid-api
|
|
161
|
+
```
|
|
162
|
+
### Frontend
|
|
163
|
+
|
|
164
|
+
Install the Ember.js Engine/Addon:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
pnpm install @fleetbase/solid-engine
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Usage
|
|
171
|
+
|
|
172
|
+
### Backend
|
|
173
|
+
|
|
174
|
+
🧹 Keep a modern codebase with **PHP CS Fixer**:
|
|
175
|
+
```bash
|
|
176
|
+
composer lint
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
⚗️ Run static analysis using **PHPStan**:
|
|
180
|
+
```bash
|
|
181
|
+
composer test:types
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
✅ Run unit tests using **PEST**
|
|
185
|
+
```bash
|
|
186
|
+
composer test:unit
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
🚀 Run the entire test suite:
|
|
190
|
+
```bash
|
|
191
|
+
composer test
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Frontend
|
|
195
|
+
|
|
196
|
+
🧹 Keep a modern codebase with **ESLint**:
|
|
197
|
+
```bash
|
|
198
|
+
pnpm lint
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
✅ Run unit tests using **Ember/QUnit**
|
|
202
|
+
```bash
|
|
203
|
+
pnpm test
|
|
204
|
+
pnpm test:ember
|
|
205
|
+
pnpm test:ember-compatibility
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
🚀 Start the Ember Addon/Engine
|
|
209
|
+
```bash
|
|
210
|
+
pnpm start
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
🔨 Build the Ember Addon/Engine
|
|
214
|
+
```bash
|
|
215
|
+
pnpm build
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Contributing
|
|
219
|
+
See the Contributing Guide for details on how to contribute to this project.
|
|
220
|
+
|
|
221
|
+
## License
|
|
222
|
+
This project is licensed under the MIT License.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{{#if this.configLoaded}}
|
|
2
|
+
<ContentPanel @title="Solid Server Config" @open={{true}} @pad={{true}} @panelBodyClass="bg-white dark:bg-gray-800 mb-4">
|
|
3
|
+
<InputGroup @name="Server Host" @value={{this.host}} @placeholder="solid.myserver.com" />
|
|
4
|
+
<InputGroup @name="Server Port" @value={{this.port}} @placeholder="3000" />
|
|
5
|
+
<InputGroup>
|
|
6
|
+
<Toggle @isToggled={{this.secure}} @onToggle={{fn (mut this.secure)}}>
|
|
7
|
+
<span class="dark:text-gray-100 text-sm ml-2">Secure Server</span>
|
|
8
|
+
</Toggle>
|
|
9
|
+
</InputGroup>
|
|
10
|
+
</ContentPanel>
|
|
11
|
+
|
|
12
|
+
<div class="mt-3 flex items-center justify-end">
|
|
13
|
+
<Button @type="primary" @size="lg" @icon="save" @text={{t "common.save-changes"}} @onClick={{perform this.saveServerConfig}} @disabled={{not this.saveServerConfig.isIdle}} @isLoading={{not this.saveServerConfig.isIdle}} />
|
|
14
|
+
</div>
|
|
15
|
+
{{else}}
|
|
16
|
+
<div class="flex items-center justify-center">
|
|
17
|
+
<Spinner @loadingMessage="Loading server config..." />
|
|
18
|
+
</div>
|
|
19
|
+
{{/if}}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
import { inject as service } from '@ember/service';
|
|
4
|
+
import { task } from 'ember-concurrency';
|
|
5
|
+
|
|
6
|
+
export default class AdminSolidServerConfigComponent extends Component {
|
|
7
|
+
@service fetch;
|
|
8
|
+
@service notifications;
|
|
9
|
+
@tracked configLoaded = false;
|
|
10
|
+
@tracked host;
|
|
11
|
+
@tracked port;
|
|
12
|
+
@tracked secure;
|
|
13
|
+
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.loadServerConfig.perform();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
getConfig() {
|
|
20
|
+
return {
|
|
21
|
+
host: this.host,
|
|
22
|
+
port: this.port,
|
|
23
|
+
secure: this.secure,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
setConfig(config) {
|
|
28
|
+
this.host = config.host;
|
|
29
|
+
this.port = config.port;
|
|
30
|
+
this.secure = config.secure;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@task *loadServerConfig() {
|
|
34
|
+
const config = yield this.fetch.get('server-config', {}, { namespace: 'solid/int/v1' });
|
|
35
|
+
if (config) {
|
|
36
|
+
this.setConfig(config);
|
|
37
|
+
this.configLoaded = true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@task *saveServerConfig() {
|
|
42
|
+
try {
|
|
43
|
+
const config = yield this.fetch.post('server-config', { server: this.getConfig() }, { namespace: 'solid/int/v1' });
|
|
44
|
+
if (config) {
|
|
45
|
+
this.setConfig(config);
|
|
46
|
+
this.notifications.success('Solid server config udpated successfully.');
|
|
47
|
+
}
|
|
48
|
+
} catch (error) {
|
|
49
|
+
this.notifications.serverError(error);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg width={{this.width}} height={{this.height}} viewBox="0 0 352 322" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<g fill-rule="nonzero" fill="none">
|
|
3
|
+
<path d="M87.97296 282.3527L27.24133 177.02207c-5.62041-9.75765-5.62041-21.77908 0-31.53674L87.97296 40.2328c5.64643-9.78367 16.08061-15.79439 27.32143-15.79439h121.3852c11.26684 0 21.72704 6.01072 27.32143 15.7944l60.75765 105.30458c5.62041 9.75766 5.62041 21.77909 0 31.53674l-60.73163 105.33061c-5.64643 9.78367-16.08061 15.79439-27.32143 15.79439H115.37245c-11.31888-.05204-21.72704-6.08878-27.3995-15.84643z" fill="#111827" />
|
|
4
|
+
<path d="M93.15102 275.19708l-57.1148-99.0597c-5.30816-9.1852-5.30816-20.50408 0-29.66326l57.1148-99.08572c5.33418-9.21122 15.14388-14.85765 25.73418-14.85765h114.2296c10.5903 0 20.42602 5.64643 25.73418 14.85765l57.16684 99.03368c5.30816 9.1852 5.30816 20.50408 0 29.66326L258.875 275.2231c-5.33418 9.21122-15.14388 14.85765-25.73418 14.85765H118.93724c-10.64234 0-20.45204-5.67245-25.78622-14.88367z" fill="#7C4DFF" />
|
|
5
|
+
<path d="M118.46888 142.2328h117.53418c1.48316 0 2.65408-1.19695 2.65408-2.65409v-22.03928c0-14.6495-11.89132-26.54085-26.54081-26.54085h-70.56735c-20.5301-.026-37.15722 16.60105-37.15722 37.13115-.02594 7.83214 6.271 14.10306 14.07712 14.10306zM129.99592 239.60116H200.225c21.20663 0 38.43214-17.22551 38.43214-38.43214 0-7.07755-5.72449-12.82806-12.82806-12.82806H106.94184c-1.45715 0-2.55005 1.17091-2.55005 2.55v23.05408c-.02597 14.18112 11.47505 25.65612 25.60413 25.65612z" fill="#F7F7F7" />
|
|
6
|
+
<path d="M109.59592 139.3185l87.66275 87.66276c5.80255 5.80255 15.19592 5.80255 20.99847 0l15.19592-15.19592c5.80255-5.80255 5.80255-15.19591 0-20.99847l-87.63673-87.66275c-5.80255-5.80255-15.19592-5.80255-20.99847 0l-15.19592 15.19592c-5.8546 5.80255-5.8546 15.22194-.02602 20.99847z" fill="#F7F7F7" />
|
|
7
|
+
<path fill="#444" opacity=".3" d="M198.6898 228.46443l-51.4944-40.12347h11.39695zM144.35918 101.66698l40.56582 40.56581h13.7648z" />
|
|
8
|
+
</g>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Component from '@glimmer/component';
|
|
2
|
+
import { tracked } from '@glimmer/tracking';
|
|
3
|
+
|
|
4
|
+
export default class SolidBrandIconComponent extends Component {
|
|
5
|
+
@tracked width = 19;
|
|
6
|
+
@tracked height = 19;
|
|
7
|
+
constructor(owner, { options }) {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
const { width = 19, height = 19 } = options || {};
|
|
10
|
+
this.width = width;
|
|
11
|
+
this.height = height;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Controller from '@ember/controller';
|
|
2
|
+
import { inject as service } from '@ember/service';
|
|
3
|
+
import { task } from 'ember-concurrency';
|
|
4
|
+
|
|
5
|
+
export default class ApplicationController extends Controller {
|
|
6
|
+
@service universe;
|
|
7
|
+
@service fetch;
|
|
8
|
+
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.universe.on('sidebarContext.available', (sidebarContext) => {
|
|
12
|
+
sidebarContext.hideNow();
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@task *authenticate() {
|
|
17
|
+
const { authenticationUrl, identifier } = yield this.fetch.get('request-authentication', {}, { namespace: 'solid/int/v1' });
|
|
18
|
+
if (authenticationUrl) {
|
|
19
|
+
window.location.href = `${authenticationUrl}/${identifier}`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@task *getAccountIndex() {
|
|
24
|
+
const response = yield this.fetch.get('account', {}, { namespace: 'solid/int/v1' });
|
|
25
|
+
console.log('[response]', response);
|
|
26
|
+
}
|
|
27
|
+
}
|
package/addon/engine.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import Engine from '@ember/engine';
|
|
2
|
+
import loadInitializers from 'ember-load-initializers';
|
|
3
|
+
import Resolver from 'ember-resolver';
|
|
4
|
+
import config from './config/environment';
|
|
5
|
+
import services from '@fleetbase/ember-core/exports/services';
|
|
6
|
+
import AdminSolidServerConfigComponent from './components/admin/solid-server-config';
|
|
7
|
+
import SolidBrandIconComponent from './components/solid-brand-icon';
|
|
8
|
+
|
|
9
|
+
const { modulePrefix } = config;
|
|
10
|
+
const externalRoutes = ['console', 'extensions'];
|
|
11
|
+
|
|
12
|
+
export default class SolidEngine extends Engine {
|
|
13
|
+
modulePrefix = modulePrefix;
|
|
14
|
+
Resolver = Resolver;
|
|
15
|
+
dependencies = {
|
|
16
|
+
services,
|
|
17
|
+
externalRoutes,
|
|
18
|
+
};
|
|
19
|
+
setupExtension = function (app, engine, universe) {
|
|
20
|
+
// register menu item in header
|
|
21
|
+
universe.registerHeaderMenuItem('Solid', 'console.solid-protocol', { iconComponent: SolidBrandIconComponent, iconComponentOptions: { width: 19, height: 19 }, priority: 5 });
|
|
22
|
+
|
|
23
|
+
// register admin settings -- create a solid server menu panel with it's own setting options
|
|
24
|
+
universe.registerAdminMenuPanel(
|
|
25
|
+
'Solid Protocol',
|
|
26
|
+
[
|
|
27
|
+
{
|
|
28
|
+
title: 'Solid Server Config',
|
|
29
|
+
icon: 'sliders',
|
|
30
|
+
component: AdminSolidServerConfigComponent,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
{
|
|
34
|
+
slug: 'solid-server',
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
loadInitializers(SolidEngine, modulePrefix);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import Route from '@ember/routing/route';
|
|
2
|
+
import getWithDefault from '@fleetbase/ember-core/utils/get-with-default';
|
|
3
|
+
import { inject as service } from '@ember/service';
|
|
4
|
+
|
|
5
|
+
export default class ApplicationRoute extends Route {
|
|
6
|
+
@service notifications;
|
|
7
|
+
|
|
8
|
+
beforeModel(transition) {
|
|
9
|
+
const queryParams = getWithDefault(transition, 'router._lastQueryParams', {});
|
|
10
|
+
if (queryParams.error) {
|
|
11
|
+
this.notifications.error(queryParams.error);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
package/addon/routes.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
.solid-fleetbase-home-container {
|
|
2
|
+
margin: auto;
|
|
3
|
+
width: 1200px;
|
|
4
|
+
padding: 2rem;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.solid-fleetbase-home-container h1 {
|
|
8
|
+
font-size: 1.5rem;
|
|
9
|
+
font-weight: 600;
|
|
10
|
+
margin-bottom: 0.75rem;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.solid-fleetbase-home-container h2 {
|
|
14
|
+
font-size: 1.25rem;
|
|
15
|
+
font-weight: 500;
|
|
16
|
+
margin-bottom: 0.75rem;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
body[data-theme='light'] .solid-fleetbase-home-container a:not([class*='text-']),
|
|
20
|
+
body[data-theme='dark'] .solid-fleetbase-home-container a:not([class*='text-']),
|
|
21
|
+
.solid-fleetbase-home-container a {
|
|
22
|
+
color: #60a5fa;
|
|
23
|
+
text-decoration: underline;
|
|
24
|
+
text-decoration-line: underline;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.solid-fleetbase-home-container a:hover {
|
|
28
|
+
opacity: 0.5;
|
|
29
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<Layout::Section::Container class="solid-fleetbase-home">
|
|
2
|
+
<Layout::Section::Header @title="Solid for Fleetbase" />
|
|
3
|
+
|
|
4
|
+
<Layout::Section::Body class="solid-fleetbase-home-container">
|
|
5
|
+
<h1>Welcome to Solid for Fleetbase</h1>
|
|
6
|
+
<h2>Getting Started</h2>
|
|
7
|
+
<div class="mt-2">
|
|
8
|
+
<p>
|
|
9
|
+
<a href="#" {{on "click" (perform this.authenticate)}}>Sign up for an account</a> to get started with your own Pod and WebID. Once you are logged in you can begin to manage your pods and sync data directly from Fleetbase to your Pods.
|
|
10
|
+
</p>
|
|
11
|
+
</div>
|
|
12
|
+
{{!-- <Button @text="Click to Test" @icon="magic" @onClick={{perform this.getAccountIndex}} @wrapperClass="mt-4" /> --}}
|
|
13
|
+
</Layout::Section::Body>
|
|
14
|
+
{{outlet}}
|
|
15
|
+
</Layout::Section::Container>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/solid-engine/components/admin/solid-server-config';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/solid-engine/components/solid-brand-icon';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/solid-engine/controllers/application';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@fleetbase/solid-engine/routes/application';
|
package/composer.json
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "fleetbase/solid-api",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "Solid Protocol Extension to Store and Share Data with Fleetbase",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"fleetbase-extension",
|
|
7
|
+
"solid",
|
|
8
|
+
"solid-protocol",
|
|
9
|
+
"decentralized",
|
|
10
|
+
"decentralized-data",
|
|
11
|
+
"fleetbase",
|
|
12
|
+
"fleetbase-pod",
|
|
13
|
+
"rdf",
|
|
14
|
+
"linked-data",
|
|
15
|
+
"ember-addon",
|
|
16
|
+
"ember-engine"
|
|
17
|
+
],
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"authors": [
|
|
20
|
+
{
|
|
21
|
+
"name": "Fleetbase Pte Ltd.",
|
|
22
|
+
"email": "hello@fleetbase.io"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"name": "Ronald A. Richardson",
|
|
26
|
+
"email": "ron@fleetbase.io"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"require": {
|
|
30
|
+
"php": "^8.0",
|
|
31
|
+
"fleetbase/core-api": "^1.4.16",
|
|
32
|
+
"fleetbase/fleetops-api": "^0.4.25",
|
|
33
|
+
"php-http/guzzle7-adapter": "^1.0",
|
|
34
|
+
"psr/http-factory-implementation": "*",
|
|
35
|
+
"jumbojett/openid-connect-php": "^0.9.10",
|
|
36
|
+
"easyrdf/easyrdf": "^1.1",
|
|
37
|
+
"ml/json-ld": "^1.2",
|
|
38
|
+
"web-token/jwt-core": "^3.0",
|
|
39
|
+
"web-token/jwt-key-mgmt": "^3.0",
|
|
40
|
+
"web-token/jwt-signature": "^3.0",
|
|
41
|
+
"web-token/jwt-checker": "^3.0",
|
|
42
|
+
"web-token/jwt-signature-algorithm-hmac": "^3.0",
|
|
43
|
+
"web-token/jwt-signature-algorithm-ecdsa": "^3.0",
|
|
44
|
+
"web-token/jwt-signature-algorithm-rsa": "^3.0"
|
|
45
|
+
},
|
|
46
|
+
"require-dev": {
|
|
47
|
+
"friendsofphp/php-cs-fixer": "^3.34.1",
|
|
48
|
+
"nunomaduro/collision": "^7.0",
|
|
49
|
+
"pestphp/pest": "^2.33.2",
|
|
50
|
+
"phpstan/phpstan": "^1.10.38",
|
|
51
|
+
"symfony/var-dumper": "^5.4.29"
|
|
52
|
+
},
|
|
53
|
+
"autoload": {
|
|
54
|
+
"psr-4": {
|
|
55
|
+
"Fleetbase\\Solid\\": "server/src/",
|
|
56
|
+
"Fleetbase\\Solid\\Seeders\\": "server/seeders/"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"autoload-dev": {
|
|
60
|
+
"psr-4": {
|
|
61
|
+
"Fleetbase\\Solid\\Tests\\": "server/tests/"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"minimum-stability": "dev",
|
|
65
|
+
"prefer-stable": true,
|
|
66
|
+
"extra": {
|
|
67
|
+
"laravel": {
|
|
68
|
+
"providers": [
|
|
69
|
+
"Fleetbase\\Solid\\Providers\\SolidServiceProvider"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
72
|
+
"fleetbase": {
|
|
73
|
+
"sandbox-migrations": false
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"config": {
|
|
77
|
+
"vendor-dir": "./server_vendor",
|
|
78
|
+
"sort-packages": true,
|
|
79
|
+
"preferred-install": "dist",
|
|
80
|
+
"allow-plugins": {
|
|
81
|
+
"pestphp/pest-plugin": true,
|
|
82
|
+
"php-http/discovery": true
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"scripts": {
|
|
86
|
+
"lint": "php-cs-fixer fix -v",
|
|
87
|
+
"test:lint": "php-cs-fixer fix -v --dry-run",
|
|
88
|
+
"test:types": "phpstan analyse --ansi --memory-limit=0",
|
|
89
|
+
"test:unit": "pest --colors=always",
|
|
90
|
+
"test": [
|
|
91
|
+
"@test:lint",
|
|
92
|
+
"@test:types",
|
|
93
|
+
"@test:unit"
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
}
|
package/extension.json
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
const { buildEngine } = require('ember-engines/lib/engine-addon');
|
|
3
|
+
const { name } = require('./package');
|
|
4
|
+
const Funnel = require('broccoli-funnel');
|
|
5
|
+
|
|
6
|
+
module.exports = buildEngine({
|
|
7
|
+
name,
|
|
8
|
+
|
|
9
|
+
postprocessTree(type, tree) {
|
|
10
|
+
if (type === 'css') {
|
|
11
|
+
tree = new Funnel(tree, {
|
|
12
|
+
exclude: ['**/@fleetbase/ember-ui/**/*.css'],
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return tree;
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
lazyLoading: {
|
|
20
|
+
enabled: true,
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
isDevelopingAddon() {
|
|
24
|
+
return true;
|
|
25
|
+
},
|
|
26
|
+
});
|