-
Notifications
You must be signed in to change notification settings - Fork 3
API Reference
Every call to API server must have the following authorization header {Authorization: Bearer JWT}. The requester must have the private key, so JWT can be signed. Then the server will check the signature of the JWT using the public key provided when the server is initializing.
JWT must have the following fields.
{
"alg": "RS256",
"typ": "JWT"
}
{
"sub": "org-id",
"exp": 1516240342,
"iat": 1516239022
}POST /api/user/add
| Name | Type | In | Description |
|---|---|---|---|
| username | string | body | VPN identity of the new user. The minimum length is 6. Maximum length is 20 only alphanumeric characters allowed and username can only be started with characters. Not case sensitive |
| secret | string | body | Secret for the user. Minimum length is 8. Maximum length is 20 |
POST /api/user/update
| Name | Type | In | Description |
|---|---|---|---|
| username | string | body | VPN identity of the new user. The minimum length is 6. Maximum length is 20 only alphanumeric characters allowed and username can only be started with characters. Not case sensitive |
| secret | string | body | Secret for the user. Minimum length is 8. Maximum length is 20 |
If username does not exist it will return an error.
DELETE /api/user/delete/{username}
| Name | Type | In | Description |
|---|---|---|---|
| username | string | path | Username to be removed |
If username does not exist it will return an error.
GET /api/user/list
This will return a list of usernames as an array.
Ex: ['user1','user2','user3']
GET /api/util/status
Returns the VPN server status
GET /api/util/getca
Returns the CA certificate as a text
GET /api/util/getcert
Returns the client certificate as a text
GET /api/util/getubuntuclientconfig
Returns the ubuntu client configuration script as text
GET /api/util/logs
Returns the VPN server logs