feat: added verification for the ssh keys #42

Merged
silver merged 5 commits from #15-set-email-via-ssh-key into main 2023-08-19 20:44:58 +00:00
Showing only changes of commit bacb03d051 - Show all commits

View file

@ -106,7 +106,7 @@ All responses:
### POST /ldap/recover/password/auth ### POST /ldap/recover/password/auth
```json ```json
{ {
"auth" : "Auth key from teh email", "auth" : "Auth key from teh email",
"pass" : "Password the user chooses" "pass" : "Password the user chooses"
} }
@ -127,6 +127,65 @@ Success:
{"result": "success", "success": "Password set"} {"result": "success", "success": "Password set"}
``` ```
### POST /ldap/recover/ssh/request
This endpoint can set emails for old skynet members who previously logged in via ssh keys.
1. Request for their account.
2. A list of public keys will be displayed.
3. Sign using one of the private keys.
4. Submit the pem value.
```bash
echo "auth code" | ssh-keygen -Y sign -n file -f /path/to/private/key
```
```json
{
"user" : "Skynet username",
"email" : "Email to set"
}
```
Errors:
```json
{"result": "error", "error": "Skynet email not permitted."}
```
```json
{ "result": "success", "success": { "auth": "", "keys": [] }}
```
```json
{ "result": "success", "success": { "auth": "code here", "keys": ["key 1", "key 2"] }}
```
### POST /ldap/recover/ssh/verify
```json
{
"user" : "Skynet username",
"auth_signed" : "signed auth code"
}
```
#### Errors
```json
{ "result": "error"}
```
```json
{ "result": "error", "error": "Incorrect signed format"}
```
```json
{"result": "error", "error": "no valid key"}
```
#### Success
```json
{"result": "success", "success": "key valid"}
```
## Responses ## Responses
Generic responses which is used unless otherwise specified above. Generic responses which is used unless otherwise specified above.