doc: added some rough documentation.

This commit is contained in:
silver 2023-07-23 22:24:03 +01:00
parent 25ad5ca62c
commit 115f5a5c31

78
README.md Normal file
View file

@ -0,0 +1,78 @@
# Skynet LDAP backend
Basic information on the Skynet ldap backend for use on <https://sso.skynet.ie>
### Error: HTTP 500
No indication of the issue is returned to teh frontend.
## Routes
Base URL: <https://api.sso.skynet.ie>
### 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"
}
```