From 115f5a5c317ace77ad6ad4dfc9b2ae7e4395b898 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Sun, 23 Jul 2023 22:24:03 +0100 Subject: [PATCH] doc: added some rough documentation. --- README.md | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..36dfe48 --- /dev/null +++ b/README.md @@ -0,0 +1,78 @@ +# Skynet LDAP backend + +Basic information on the Skynet ldap backend for use on + + +### Error: HTTP 500 +No indication of the issue is returned to teh frontend. + +## Routes +Base URL: + + +### POST /ldap/update +Fields: +* userPassword +* mail +* sshPublicKey +* cn +* sn +* skDiscord + +```json +{ + "user" : "username", + "pass" : "password", + "field": "field to change", + "value": "new value of field" +} +``` + +Changing ``userPassword`` requires the existing password in teh apssword field and the new one in teh value field. + +### POST /ldap/new + +```json +{ + "user" : "username the user wants", + "mail" : "An email account that matches what is on wolves", + "name_first": "Firstname", + "name_second": "Surname" +} +``` + +Username taken: +```json +{"result": "error", "error": "username not available"} +``` + +Email used: +```json +{"result": "error", "error": "email in use"} +``` + +### POST /ldap/new/verify + +```json +{ + "auth_code": "Auth code that got send in the email", + "password": "Password the user wants to use" +} +``` + +Auth code non existent: +```json +{"result": "error"} +``` + + +## Responses + +Generic responses which is used unless otherwise specified above. + +### Success: HTTP 200 +```json +{ + "result": "success" +} +``` \ No newline at end of file