Added Documentation for the API Key authentication system

This commit is contained in:
2026-01-21 11:04:43 +01:00
parent 5c7b1ac5e9
commit 55df227599
+41 -7
View File
@@ -5,7 +5,8 @@
2. [How it works](#how-it-works) 2. [How it works](#how-it-works)
3. [Modules](#modules) 3. [Modules](#modules)
4. [IPC](#ipc) 4. [IPC](#ipc)
5. [UI](#ui) 5. [Authentication](#authentication)
6. [UI](#ui)
## How to run the Software ## How to run the Software
If you read the readme file, you will see the basic setup command in order to run the program. If you read the readme file, you will see the basic setup command in order to run the program.
@@ -18,13 +19,9 @@ Next up you need to set up the .env file.
The file must contain your keys for the modules you want to use. The file must contain your keys for the modules you want to use.
The .env file looks like this: The .env file looks like this:
``` ```
ASSEMBLYAI_API_KEY=wefhjhjakeghjkahejkghjkaegh auth_username=wefhjhjakeghjkahejkghjkaegh
GOOGLE_API_KEY=wefhjhjakeghjkahejkghjkaegh auth_password=wefhjhjakeghjkahejkghjkaegh
SAIA_API_KEY=wefhjhjakeghjkahejkghjkaegh
``` ```
Note that if you write your module in the same format we did, then you will only need to supply the api keys to the individual services you will actually use.
If you dont want to use Assembly AI, you can for example just leave this row out of your .env, and the program will just work fine.
Only issue will be that it will throw an error if you do run the Assembly AI module anyways.
Once that is done, you can run the command `npm start` to actually start the program. Once that is done, you can run the command `npm start` to actually start the program.
Alternatively you can double click the start.bat if you are on Windows for example. Alternatively you can double click the start.bat if you are on Windows for example.
@@ -116,6 +113,43 @@ As for the rest of the fields, they are pretty self explanatory except `document
This is the minimum required setup for the currently implemented pipeline to work. This is the minimum required setup for the currently implemented pipeline to work.
You can always add fields to it, but dont remove the ones from above. You can always add fields to it, but dont remove the ones from above.
## Authentication
Our Software uses a custom API key management System.
This system itself is proprietary, and will as such not be delivered with the software.
The way it works is simply via a HTTP request.
In the current version, the main reads the username and password for authentication from the .env file, and then uses these in the header for the HTTP request.
```
hostname: "keyserver.dommymommy.xyz", // The URL to the key server
port: 443, // The Port of the
path: "/v1/auth", // The API Endpoint
method: "GET",
headers: {
"Content-Type": "application/json", // The content type should be JSON
"username": un, // the Username used to authenticate
"password": pw // The password used to authenticate
}
```
### The Important bit of this whole setup
Once the HTTP request is made, it will return a JSON object with the API keys as fields.
One such output could look like this:
```json
{
"ASSEMBLYAI_API_KEY": "eajgjkhgahghahegoikh",
"GOOGLE_API_KEY": "eajgjkhgahghahegoikh",
"SAIA_API_KEY": "eajgjkhgahghahegoikh"
}
```
The key for each entry is being used to store the key in memory.
Specifically under `process.env`
So, if everything in this request worked out, we will have:
```js
process.env.ASSEMBLYAI_API_KEY
process.env.GOOGLE_API_KEY
process.env.SAIA_API_KEY
```
These variables are accessible anywhere in the code and contain the API Keys, so make sure you dont add some untrusted modules that could steal these API Keys.
## UI ## UI
The UI has a simple, self-explanatory design, in white and blue. The UI has a simple, self-explanatory design, in white and blue.
For easy handling and understanding, the UI is using 6 steps to guide the user through the process and offers a help page For easy handling and understanding, the UI is using 6 steps to guide the user through the process and offers a help page