A basic web server for AstralSafe license generation and validation using Node.js and Express.js.
The license is generated using AES and a quantum random key.
A simple client made with .NET MAUI can be found here
A better version of the API documentation using Swagger is available at https://lumarans30.github.io/AstralSafeServer/ or at http://localhost:8080/docs.
By running the server locally, you can test API requests with custom attributes via Swagger.
You can send a POST HTTP request to the following endpoints of http://localhost:8080 with the params:
{"uid": ""} or {"uid": "", "license": ""}.
- /api/keygen
- /api/validate-license
curl -X POST -d '{""uid"": ""xxxx-xxxx-xxxx-xxxx""}' -H "Content-Type: application/json" http://localhost:8080/api/keygen
output: {"key": "string", "license":"string"}
curl -X POST -d '{""uid"": ""xxxx-xxxx-xxxx-xxxx"", ""license"": ""string""}' -H "Content-Type: application/json" http://localhost:8080/api/validate-license
if the license is valid, the output will be: {"key": "string"}
else the output will be: {"valid": "false"}
To check if the server is running, you can go to http://localhost:8080/.
Using the OpenApi documents in the swagger.yaml file in the dist directory, it is possible to automatically generate a client or server for different programming languages by importing the file into the Swagger Editor.