Skip to content

Latest commit

 

History

History
65 lines (38 loc) · 2.2 KB

README.md

File metadata and controls

65 lines (38 loc) · 2.2 KB

AstralSafeServer

GitHub GitHub repo size Lines of code GitHub issues Website GitHub last commit

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

Docs

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.

Usage

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

Example

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"}


Website

To check if the server is running, you can go to http://localhost:8080/.


Client generation

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.