|
|
# API Document
|
|
|
1. Create a new account
|
|
|
|
|
|
* URL: `account/new`
|
|
|
|
|
|
* Request
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
| ----- | ----- | ----- |
|
|
|
| username | string | username of the new account |
|
|
|
| password | string | password of the new account |
|
|
|
|
|
|
* Response
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
| ----- | ----- | ----- |
|
|
|
| nfc_pass | char(6) | the NFC password of the new account |
|
|
|
| serial | char(32) | the serial of the new account |
|
|
|
| username | string | the username of the new account |
|
|
|
|
|
|
2. Authenticate (Install) a new machine
|
|
|
|
|
|
* URL: `machine/new`
|
|
|
|
|
|
* Request
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
| ----- | ----- | ----- |
|
|
|
| username | string | user who owns the machine |
|
|
|
| password | string | the password |
|
|
|
| machine_cname | string | canonical name of the machine |
|
|
|
|
|
|
* Response
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
| ----- | ----- | ----- |
|
|
|
| pub_key | base64 string | RSA public key |
|
|
|
| pri_key | base64 string | RSA private key |
|
|
|
| machine_id | int | ID of the machine |
|
|
|
|
|
|
3. Revoke the authentication of a machine
|
|
|
|
|
|
| Parameter | Type | Description |
|
|
|
| ----- | ----- | ----- |
|
|
|
| username | string | username |
|
|
|
| password | string | password |
|
|
|
| machine_id | int | ID of the machine to revoke | |
|
|
\ No newline at end of file |