MinecraftAdministrationCenter / mac-docs

Public documentation for the administration panel(both API and UI).
MIT License
0 stars 0 forks source link

RESTful API - Global Endpoints #5

Open FastFelix771 opened 7 years ago

FastFelix771 commented 7 years ago

Following mostly the pattern of the usual, versioned, endpoints - here we should declare the global endpoints for the RESTful backend.

Things to remember about global endpoints:


Name: PingPong URL: back.end/global/ping/pong Method: GET Request: { json structure here } Response: { json structure here }

Some description.... ..... .....


FastFelix771 commented 7 years ago

Name: Status URL: back.end/global/status Method: GET Request: empty Response: { version: 1.0.0, uptime: 1059439074 }

A simple ping to check if the backend can be reached. The uptime timestamp is the current uptime in milliseconds.


@jens1o This looks similiar to your formerly suggested ping endpoint - would this one fit for such needs?

jens1o commented 7 years ago

Yeah, that's looking good :)

Stay fresh!

FastFelix771 commented 7 years ago

Name: Public Key URL: back.end/global/key Method: GET Request: empty Response: { strength: 4096, key: AbeEuewggewregZUouihef==, fingerprint: 8ßsd898fsd8f9ew8aeffg000 }

Provides the backends public RSA encryption key. The key is provided as base64 encoded string and needs to be decoded before its usable as encryption key.

The strength is sent in case that applications have to specify it in their crypto-handler before they can use the key. This data could be read from the key itself, but especially for smaller applications without libraries that support such actions, this may be a lot more convenient.

The fingerprint is an SHA-256 hash which can be used to validate the keys integrity. To validate the integrity of the key, the key itself first needs to be decoded.


FastFelix771 commented 7 years ago

@jens1o Any ideas for the api version list? back.end/global/versions or back.end/global/api - something like that.

jens1o commented 7 years ago

api version list

There's no need for that? We can do that via the status endpoint?

FastFelix771 commented 7 years ago

There's no need for that? We can do that via the status endpoint?

We could. But i would like to preserve the status endpoint for a simple "are-u-alive"-check.