Server
The Server was the initial plan for the project. It is a FastAPI server which makes the Tools available via a REST API. It also provides access to its own SQLite database system.
Endpoints
Endpoint |
Function |
|---|---|
|
root |
|
decrypt |
|
encrypt |
|
generate_key |
|
hash_string |
|
add_user |
|
connect |
|
create_table |
|
delete_user |
|
delete_all_users |
|
get_user |
|
get_all_users |
|
listTables |
|
update_user |
|
swagger_ui_html |
|
swagger_ui_redirect |
|
openapi |
|
ping |
|
redoc_html |
Swagger UI
For a better visualization of the API, the Swagger UI is available at /docs.
- GET /crypto/encrypt
Encrypt
Encrypts a string with a key.
- Parameters:
text – The string to encrypt
key – [Optional] The key to encrypt with. If not provided, a new key will be generated.
- Return:
A dictionary with the encrypted string and the key
- Query Parameters:
text (string) – (Required)
key (string) –
- Status Codes:
200 OK – Successful Response
422 Unprocessable Entity – Validation Error
- GET /crypto/decrypt
Decrypt
Decrypts a string with a key.
- Parameters:
text – The string to decrypt
key – The key to decrypt with
- Return:
A dictionary with the decrypted string
- Query Parameters:
text (string) – (Required)
key (string) – (Required)
- Status Codes:
200 OK – Successful Response
422 Unprocessable Entity – Validation Error
- GET /crypto/generateKey
Generate Key
Generates a key.
- Return:
A dictionary with the generated key
- Status Codes:
200 OK – Successful Response
- GET /crypto/hash
Hash String
Hashes a string.
- Parameters:
text – The string to hash
mode – [Optional] The mode to hash with. Default is sha256
- Return:
A dictionary with the hashed string
- Query Parameters:
text (string) – (Required)
mode (string) –
- Status Codes:
200 OK – Successful Response
422 Unprocessable Entity – Validation Error
- PUT /db/add
Add User
- Query Parameters:
username (string) – (Required)
password (string) – (Required)
- Status Codes:
200 OK – Successful Response
422 Unprocessable Entity – Validation Error
- PATCH /db/update
Update User
- Query Parameters:
username (string) – (Required)
password (string) – (Required)
- Status Codes:
200 OK – Successful Response
422 Unprocessable Entity – Validation Error
- DELETE /db/delete
Delete User
- Query Parameters:
username (string) – (Required)
- Status Codes:
200 OK – Successful Response
422 Unprocessable Entity – Validation Error
- GET /db/get
Get User
- Query Parameters:
username (string) – (Required)
- Status Codes:
200 OK – Successful Response
422 Unprocessable Entity – Validation Error
- DELETE /db/deleteall
Delete All Users
- Query Parameters:
you_sure (boolean) –
- Status Codes:
200 OK – Successful Response
422 Unprocessable Entity – Validation Error