-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreadme.md.old
99 lines (72 loc) · 1.7 KB
/
readme.md.old
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# openKyc service
## Usage
### Add a new user
**Definition**
'POST /users'
**Arguments**
- '"user_id":string' id of the user
- '"email":string' email of the user
- '"callback_url":string' The url to where the user will be redirected when verifying the email address
- '"public_key":string' A base64 encoded curve ed25519 public key of the user
**Response**
- '200 ok' on success
```
Mail sent
```
### Verify email
**Definition**
'POST /users/\<userid\>/verify'
**Arguments**
- '"userid":string' id of the user
- '"verification_code":string' The code got via email
**Response**
- '200 Ok' on success
Email will be signed with the server's private key
```json
{
"user_id": "sara.vermeire",
"email": "[email protected]",
"signature": "dcvasdfesdfbsadfewsadbhgfdsegadfvadsf",
"verified": 1
}
```
- '403 Forbidden' on code not matching stored code
```
VerificationCode not ok
```
### Get emailaddress & verification status
In order to get the email and verification status of this user a signed message is needed.
**Definition**
'GET /users\<userid\>'
**Arguments**
- '"userid":string' id of the user
**Response**
- '200 Ok' on success
The emailaddress of the user will be encrypted with the user's public key
```json
{
"user_id": "sara.vermeire",
"email": "dcvasdfesdfbsadfewsadbhgfdsegadfvadsf",
"verified": 1
}
```
- '403 Forbidden' on code not matching stored code
```
VerificationCode not ok
```
### Development
Setup
```bash
python3 -m venv py_env
pip install -r requirements.txt
```
Run
```bash
export FLASK_APP=openkyc.py
flask run --reload --debugger -p 5005 --host 0.0.0.0
```
### Deploy
```
export PASSWORD=<insert password>
gunicorn -b localhost:5005 -w 1 kyc:app
```