Server-API: keys
Als Markdown kopierenDiese Routen liegen auf der Server-API, Port 21114 (21121 in Docker). Sie nehmen einen API-Schlüssel in X-API-Key oder ein Anmelde-Token; siehe Die HTTP-API. Die Beschreibungen stehen auf Englisch, wie in der OpenAPI-Beschreibung.
The server's public key, which clients need to trust it.
Show the server's public key in base64.
Answers everyone. The key is empty while the server has no key pair.
On the server API, port 21114.
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
key |
string | yes | The Ed25519 public key in base64 |
Show whether devices need the server's key to connect.
On the server API, port 21114. Needs server.config.
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
enforced |
boolean | yes | Punch-hole and relay requests without the server's key are refused |
devices_without_key |
integer | yes | How many devices connected without the key since counting_since |
counting_since |
string or null (date-time) | yes | null while nothing is counted |
| Error | When |
|---|---|
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |
Require the server's key from connecting devices, or stop requiring it.
Stores the setting and applies it at once. The change is written in the audit log.
On the server API, port 21114. Needs server.config.
Request body, application/json:
| Field | Type | Required |
|---|---|---|
enforced |
boolean | yes |
200: Saved and applied (application/json)
The check after the change, as GET answers it
| Field | Type | Required |
|---|---|---|
enforced |
boolean | yes |
devices_without_key |
integer | yes |
counting_since |
string (date-time) | yes |
| Error | When |
|---|---|
| 400 | enforced is missing or not true or false (enforced must be true or false) |
| 401 | No credential, or one that is not valid |
| 403 | The credential's role lacks the permission |
Show the SHA-256 fingerprint of the server's public key.
Answers everyone. The fingerprint is empty while the server has no key pair.
On the server API, port 21114.
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
fingerprint |
string | yes | Upper-case hex pairs separated by colons |
algorithm |
"SHA-256" |
yes |
Show the server's public key in base64 and hex.
Answers everyone. The base64 key is the key clients need.
On the server API, port 21114.
200: Done (application/json)
| Field | Type | Required | What it is |
|---|---|---|---|
key |
string | yes | The Ed25519 public key in base64 |
key_hex |
string | yes | The same key in hex |
| Error | When |
|---|---|
| 500 | The server has no key pair yet |