🔐 Removes auth from frontend
This commit is contained in:
+20
-25
@@ -4,31 +4,26 @@
|
||||
|
||||
The back end exposes a number of API endpoints which are referenced in the table below.
|
||||
|
||||
| Method | Endpoint | Authentication | POST JSON Body | Info |
|
||||
| ------ | --------------------------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
|
||||
| GET | /rest/features | `NONE_REQUIRED` | none | Tells the client which features of the UI should be use |
|
||||
| GET | /rest/ntpStatus | `IS_AUTHENTICATED` | none | Current NTP connection status |
|
||||
| GET | /rest/ntpSettings | `IS_ADMIN` | none | Current NTP settings |
|
||||
| POST | /rest/ntpSettings | `IS_ADMIN` | `{"enabled": true,"server": "time.google.com","tz_label": "Europe/London","tz_format": "GMT0BST,M3.5.0/1,M10.5.0"}` | Update the NTP settings |
|
||||
| GET | /rest/apStatus | `IS_AUTHENTICATED` | none | Current AP status and client information |
|
||||
| GET | /rest/apSettings | `IS_ADMIN` | none | Current AP settings |
|
||||
| POST | /rest/apSettings | `IS_ADMIN` | `{"provision_mode": 1,"ssid": "ESP32-SvelteKit-e89f6d20372c","password": "esp-sveltekit","channel": 1,"ssid_hidden": false,"max_clients": 4,"local_ip": "192.168.4.1","gateway_ip": "192.168.4.1","subnet_mask": "255.255.255.0"}` | Update AP settings |
|
||||
| GET | /rest/wifiStatus | `IS_AUTHENTICATED` | none | Current status of the wifi client connection |
|
||||
| GET | /rest/scanNetworks | `IS_ADMIN` | none | Async Scan for Networks in Range |
|
||||
| GET | /rest/listNetworks | `IS_ADMIN` | none | List networks in range after successful scanning. Otherwise triggers scanning. |
|
||||
| GET | /rest/wifiSettings | `IS_ADMIN` | none | Current WiFi settings |
|
||||
| POST | /rest/wifiSettings | `IS_ADMIN` | `{"hostname":"esp32-f412fa4495f8","priority_RSSI":true,"wifi_networks":[{"ssid":"YourSSID","password":"YourPassword","static_ip_config":false}]}` | Update WiFi settings and credentials |
|
||||
| GET | /rest/systemStatus | `IS_AUTHENTICATED` | none | Get system information about the ESP. |
|
||||
| POST | /rest/restart | `IS_ADMIN` | none | Restart the ESP32 |
|
||||
| POST | /rest/factoryReset | `IS_ADMIN` | none | Reset the ESP32 and all settings to their default values |
|
||||
| POST | /rest/uploadFirmware | `IS_ADMIN` | none | File upload of firmware.bin |
|
||||
| POST | /rest/signIn | `NONE_REQUIRED` | `{"password": "admin","username": "admin"}` | Signs a user in and returns access token |
|
||||
| GET | /rest/securitySettings | `IS_ADMIN` | none | retrieves all user information and roles |
|
||||
| POST | /rest/securitySettings | `IS_ADMIN` | `{"jwt_secret": "734cb5bb-5597b722", "users": [{"username": "admin", "password": "admin", "admin": true}, {"username": "guest", "password": "guest", "admin": false, }]}` | retrieves all user information and roles |
|
||||
| GET | /rest/verifyAuthorization | `NONE_REQUIRED` | none | Verifies the content of the auth bearer token |
|
||||
| GET | /rest/generateToken?username={username} | `IS_ADMIN` | `{"token": "734cb5bb-5597b722"}` | Generates a new JWT token for the user from username |
|
||||
| POST | /rest/sleep | `IS_AUTHENTICATED` | none | Puts the device in deep sleep mode |
|
||||
| POST | /rest/downloadUpdate | `IS_ADMIN` | `{"download_url": "https://github.com/theelims/ESP32-sveltekit/releases/download/v0.1.0/firmware_esp32s3.bin"}` | Download link for OTA. This requires a valid SSL certificate and will follow redirects. |
|
||||
| Method | Endpoint | Authentication | POST JSON Body | Info |
|
||||
| ------ | -------------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
|
||||
| GET | /rest/features | `NONE_REQUIRED` | none | Tells the client which features of the UI should be use |
|
||||
| GET | /rest/ntpStatus | `IS_AUTHENTICATED` | none | Current NTP connection status |
|
||||
| GET | /rest/ntpSettings | `IS_ADMIN` | none | Current NTP settings |
|
||||
| POST | /rest/ntpSettings | `IS_ADMIN` | `{"enabled": true,"server": "time.google.com","tz_label": "Europe/London","tz_format": "GMT0BST,M3.5.0/1,M10.5.0"}` | Update the NTP settings |
|
||||
| GET | /rest/apStatus | `IS_AUTHENTICATED` | none | Current AP status and client information |
|
||||
| GET | /rest/apSettings | `IS_ADMIN` | none | Current AP settings |
|
||||
| POST | /rest/apSettings | `IS_ADMIN` | `{"provision_mode": 1,"ssid": "ESP32-SvelteKit-e89f6d20372c","password": "esp-sveltekit","channel": 1,"ssid_hidden": false,"max_clients": 4,"local_ip": "192.168.4.1","gateway_ip": "192.168.4.1","subnet_mask": "255.255.255.0"}` | Update AP settings |
|
||||
| GET | /rest/wifiStatus | `IS_AUTHENTICATED` | none | Current status of the wifi client connection |
|
||||
| GET | /rest/scanNetworks | `IS_ADMIN` | none | Async Scan for Networks in Range |
|
||||
| GET | /rest/listNetworks | `IS_ADMIN` | none | List networks in range after successful scanning. Otherwise triggers scanning. |
|
||||
| GET | /rest/wifiSettings | `IS_ADMIN` | none | Current WiFi settings |
|
||||
| POST | /rest/wifiSettings | `IS_ADMIN` | `{"hostname":"esp32-f412fa4495f8","priority_RSSI":true,"wifi_networks":[{"ssid":"YourSSID","password":"YourPassword","static_ip_config":false}]}` | Update WiFi settings and credentials |
|
||||
| GET | /rest/systemStatus | `IS_AUTHENTICATED` | none | Get system information about the ESP. |
|
||||
| POST | /rest/restart | `IS_ADMIN` | none | Restart the ESP32 |
|
||||
| POST | /rest/factoryReset | `IS_ADMIN` | none | Reset the ESP32 and all settings to their default values |
|
||||
| POST | /rest/uploadFirmware | `IS_ADMIN` | none | File upload of firmware.bin |
|
||||
| POST | /rest/sleep | `IS_AUTHENTICATED` | none | Puts the device in deep sleep mode |
|
||||
| POST | /rest/downloadUpdate | `IS_ADMIN` | `{"download_url": "https://github.com/theelims/ESP32-sveltekit/releases/download/v0.1.0/firmware_esp32s3.bin"}` | Download link for OTA. This requires a valid SSL certificate and will follow redirects. |
|
||||
|
||||
<!-- | HTTP Method | Endpoint | Description | Parameters |
|
||||
|-------------|----------------|----------------------------|---------------------------|
|
||||
|
||||
@@ -1,23 +1,22 @@
|
||||
# Software description
|
||||
|
||||
|
||||
The software make use of a range of different libraries to enhance the functionality.
|
||||
Up to date list can be seen in platformio.ini file.
|
||||
The libraries includes:
|
||||
|
||||
* Esp32SvelteKit
|
||||
* PsychicHttp
|
||||
* ArduinoJson
|
||||
* Adafruit SSD1306
|
||||
* Adafruit GFX Library
|
||||
* Adafruit BusIO
|
||||
* Adafruit PWM Servo Driver Library
|
||||
* Adafruit ADS1X15
|
||||
* Adafruit HMC5883 Unified
|
||||
* Adafruit Unified Sensor
|
||||
* I2Cdevlib-MPU6050
|
||||
* NewPing
|
||||
* SPI
|
||||
- Esp32SvelteKit
|
||||
- PsychicHttp
|
||||
- ArduinoJson
|
||||
- Adafruit SSD1306
|
||||
- Adafruit GFX Library
|
||||
- Adafruit BusIO
|
||||
- Adafruit PWM Servo Driver Library
|
||||
- Adafruit ADS1X15
|
||||
- Adafruit HMC5883 Unified
|
||||
- Adafruit Unified Sensor
|
||||
- I2Cdevlib-MPU6050
|
||||
- NewPing
|
||||
- SPI
|
||||
|
||||
#### Structure
|
||||
|
||||
@@ -36,7 +35,6 @@ To dis-/enable the major feature defines are used. Define them in either feature
|
||||
| --- | --- | ---
|
||||
| FT_BATTERY | Whether or not to use battery | 0
|
||||
| FT_NTP | Whether or not to use time server | 1
|
||||
| FT_SECURITY | Whether or not to use login system | 0
|
||||
| FT_SLEEP | Whether or not include sleep management | 0
|
||||
| FT_UPLOAD_FIRMWARE | Whether or not to use OAT | 0
|
||||
| FT_DOWNLOAD_FIRMWARE | Whether or not to use github for firmware updates | 0
|
||||
@@ -50,7 +48,9 @@ To dis-/enable the major feature defines are used. Define them in either feature
|
||||
### 📲 Controller
|
||||
|
||||
The controller is a SvelteKit app, which main focus is to calibrate and control the robot.
|
||||
|
||||
<!-- Write about the emulation, stream, controls and link to the space issues -->
|
||||
|
||||
It is made to be included and hosted by the robot.
|
||||
Therefore there is placed a lot of thought behind the functionality and dependencies.
|
||||
|
||||
@@ -58,22 +58,22 @@ Therefore there is placed a lot of thought behind the functionality and dependen
|
||||
|
||||
For the development dependencies I choose the following
|
||||
|
||||
| Dependencies | Description
|
||||
| --- | ---
|
||||
| SvelteKit | SvelteKit is an application framework built on top of Svelte, enhancing it with features like routing, server-side rendering, and static site generation. It streamlines the development process by integrating server-side capabilities with Svelte's client-side benefits. Furthermore it make the development process fast and enjoyable.
|
||||
| Vite | Vite is a frontend tool that is used for building fast and optimized web applications. Is serves code local during development and bundles assets for production
|
||||
| Typescript | TypeScript's integration of static typing enhances code reliability and maintainability.
|
||||
| Tailwind CSS | Tailwind CSS accelerates web development with its utility-first approach, ensuring rapid styling and consistent design.
|
||||
| Dependencies | Description |
|
||||
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| SvelteKit | SvelteKit is an application framework built on top of Svelte, enhancing it with features like routing, server-side rendering, and static site generation. It streamlines the development process by integrating server-side capabilities with Svelte's client-side benefits. Furthermore it make the development process fast and enjoyable. |
|
||||
| Vite | Vite is a frontend tool that is used for building fast and optimized web applications. Is serves code local during development and bundles assets for production |
|
||||
| Typescript | TypeScript's integration of static typing enhances code reliability and maintainability. |
|
||||
| Tailwind CSS | Tailwind CSS accelerates web development with its utility-first approach, ensuring rapid styling and consistent design. |
|
||||
|
||||
#### Libraries
|
||||
|
||||
For the app functionality I choose the following:
|
||||
|
||||
| Dependencies | Description
|
||||
| --- | ---
|
||||
| [Three](https://www.npmjs.com/package/three) | Easy to use, lightweight, cross-browser, general purpose 3D library.
|
||||
| [Urdf-loader](https://www.npmjs.com/package/urdf-loader) | Utilities for loading URDF files into THREE.js and a Web Component that loads and renders the model.
|
||||
| [Xacro-parser](https://www.npmjs.com/package/xacro-parser) | Javascript parser and loader for processing the ROS Xacro file format.
|
||||
| [NippleJS](https://www.npmjs.com/package/nipplejs) | A vanilla virtual joystick for touch capable interfaces.
|
||||
| [Uzip](https://www.npmjs.com/package/uzip) | Simple, tiny and fast ZIP library.
|
||||
| [ChartJS](https://www.npmjs.com/package/chart.js) | Simple and flexible charting library.
|
||||
| Dependencies | Description |
|
||||
| ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
||||
| [Three](https://www.npmjs.com/package/three) | Easy to use, lightweight, cross-browser, general purpose 3D library. |
|
||||
| [Urdf-loader](https://www.npmjs.com/package/urdf-loader) | Utilities for loading URDF files into THREE.js and a Web Component that loads and renders the model. |
|
||||
| [Xacro-parser](https://www.npmjs.com/package/xacro-parser) | Javascript parser and loader for processing the ROS Xacro file format. |
|
||||
| [NippleJS](https://www.npmjs.com/package/nipplejs) | A vanilla virtual joystick for touch capable interfaces. |
|
||||
| [Uzip](https://www.npmjs.com/package/uzip) | Simple, tiny and fast ZIP library. |
|
||||
| [ChartJS](https://www.npmjs.com/package/chart.js) | Simple and flexible charting library. |
|
||||
|
||||
Reference in New Issue
Block a user