[add] added maximum client and demo client protection

- default demo clients can no longer be modified/deleted when in demo mode
 - increased default demo reset to 60 minutes
This commit is contained in:
2021-02-25 12:52:23 -05:00
parent 472ae4c90f
commit 5868377210
7 changed files with 60 additions and 7 deletions

33
api.yml
View File

@@ -1,11 +1,34 @@
openapi: "3.0.0"
info:
description: "Simple dynDNS via Rest-API."
description: "Simple dynDNS via Rest-API.
The demo database will reset every **60** minutes. A maximum of 250 clients can exist in the demo database.
The following default clients and api keys can be used:
| client name | api key |
|--------------|------------------------------------------------------------------------------------------|
| admin | `zW3If4s5.41a7c846.23b142e6451df545d5034ca8f6050b80ff3e9689f20d5e45d72d160fa7e1cf32` |
| read_client | `zW3If4s5.28aef5cb.d502cb94ba0802c6363f95ecb3a70de7e2e4b889779e435b7c033f2c72ed4f20` |
| write_client | `zW3If4s5.3d6129cc.48d41d2a28b16a9a274d3f407026aee2b82cddbb3c11a5496ffe329c78e5d54b` |
In `demo-mode` it is not possible to call `POST /admin/client`, `PUT /admin/client` or `DELETE /admin/clients/{client_name}` for any of the above default clients. Any newly created client can be freely modified.
***Note**: the X-API-Key value entered when using Authorize takes precedence over values entered in the X-API-Key parameters field.
Since the X-API-Key parameter field is flagged as required a simple space (or any other character) will still be needed for executing the request here.*
"
version: "1.0"
title: "rynDNS"
servers:
- url: "https://api.pdev.dev/rynDNS/v1"
- url: "https://demo.api.pdev.dev/rynDNS"
description: ""
security:
@@ -49,6 +72,8 @@ paths:
description: "Invalid input"
"406":
description: "Not Acceptable - Can not remove last admin account permissions"
"429":
description: "Too many clients - Maximum client count reached"
put:
tags:
- "admin"
@@ -356,5 +381,5 @@ components:
example: "115.16.0.99"
pattern: "^(((25[0-5]|(2[0-4]|1[0-9]|[1-9]|)[0-9])(.(?!$)|$)){4})?$"
externalDocs:
description: "Source"
url: "https://git.pdev.dev"
description: "<rynDNS source code>"
url: "https://git.pdev.dev/pdev/ryndns"