-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Labels
enhancementAn enhancement to existing implementationAn enhancement to existing implementation
Description
🚀 Feature Request
In order to make public API endpoints easy to set up, we must do everything to:
- minimize the work required to setup the environment (just use a reverse proxy with a certificate and point it to the host/port/path and that's it)
- to maximize the compatibility between providers
Now there are two public servers providing Semux API:
- https://api.semux.online (+ https://api.testnet.semux.online)
- https://www.sempy.online/api/ui/#/semux (this is almost 100% Semux API)
Both use very different approach and software:
These projects were created because Semux Core is missing dedicated endpoint serving nothing but public API, where one:
- does not need to authenticate
- does not have access to wallet of the Semux node
- does not see non-public endpoints in the swagger-generated page and the specification file
Current solution
In my opinion, the API: divide APIs into groups #267 is not a good solution:
- does little to help setup a public API endpoint,
- does assume that from now on, each and every public endpoint must be GET and wallet endpoint must NOT be GET,
- is confusing, e.g. the extra comment in config file:
for no reason in the Semux API jargon,
# Allow GET methods (safe for public access) only api.allowGetMethodsOnly = trueallowGetMethodsOnlyequalspublicMethodsOnly
Suggestions
- rollback the GET=public rule
- make it so that once we setup reverse proxy, there is nothing but public API with no wallet endpoints, no authentication sections, etc…
We can either:
- setup separate public API from wallet API (two swagger files, two root paths)
- or just mark each endpoint (public or wallet) and let the Semux Core generate the proper API page+endpints according to some settings like
api.publicOnly=true.
The first approach has an advantage that one can publish public API (e.g. reverse proxy points to host:port/api/public) and still use wallet API internally.
The latter approach is implemented in https://github.com/witoldsz/api.semux.online by filtering the swagger specification file. @orogvany said:
Swagger has API so no manual filtering necessary
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementAn enhancement to existing implementationAn enhancement to existing implementation