This is the Skywire User System service.
Version: 1.0
Instructions for running the project:
- run postgres_docker.sh
- copy config-example into config.toml
- ensure you have golang/dep installed on your PATH
- run dep ensure
- go run cmd/main.go
This is a Skywire User System service.
Create a new Admin in the system
Collect provided Admin attributes from the body and create new Admin in the system
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
newAdmin | body | New Admin | Yes | user.Model |
Code | Description | Schema |
---|---|---|
201 | Created | user.Model |
422 | Unprocessable Entity | api.ErrorResponse |
500 | Internal Server Error | api.ErrorResponse |
List all admins
Method for admins to get list of all admins
Code | Description | Schema |
---|---|---|
200 | OK | [ user.Model ] |
500 | Internal Server Error | api.ErrorResponse |
Update admin rights
Changes rights of a user according to the request
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
updated | body | Model with new rights | Yes | user.Model |
Code | Description | Schema |
---|---|---|
200 | OK | user.Model |
400 | Bad Request | api.ErrorResponse |
422 | Unprocessable Entity | api.ErrorResponse |
500 | Internal Server Error | api.ErrorResponse |
List all users
Returns the list of all current users
Code | Description | Schema |
---|---|---|
200 | OK | [ user.Model ] |
500 | Internal Server Error | api.ErrorResponse |
Removes user
Removes user for given username
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
username | query | Mail of user to be removed | Yes | string |
Code | Description | Schema |
---|---|---|
200 | ||
500 | Internal Server Error | api.ErrorResponse |
Returns user
Returns user found by username provided
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
username | query | User's email | Yes | string |
Code | Description | Schema |
---|---|---|
200 | OK | user.Model |
400 | Bad Request | api.ErrorResponse |
Retrieve signed in User's info
Information about currently signed in user is collected and returned as response.
Code | Description | Schema |
---|---|---|
200 | OK | user.Model |
401 | Unauthorized | api.ErrorResponse |
422 | Unprocessable Entity | api.ErrorResponse |
500 | Internal Server Error | api.ErrorResponse |
Create a new User in the system
Collect provided User attributes from the body and create new User in the system
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
newUser | body | New User | Yes | user.Model |
Code | Description | Schema |
---|---|---|
201 | Created | user.Model |
422 | Unprocessable Entity | api.ErrorResponse |
500 | Internal Server Error | api.ErrorResponse |
Confirm a setup for OTP code on your account
Send a otp code to the backend, and have it set up on your account, so it will be required for future actions
Code | Description | Schema |
---|---|---|
200 | ||
500 | Internal Server Error | api.ErrorResponse |
Disable OTP code for your account
Code | Description | Schema |
---|---|---|
200 | ||
500 | Internal Server Error | api.ErrorResponse |
Start forgot password flow
If User has forgotten his password this endpoint enables him to reset password using link sent to provided email address.
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
query | User's email | Yes | string |
Code | Description | Schema |
---|---|---|
200 | ||
422 | Unprocessable Entity | api.ErrorResponse |
500 | Internal Server Error | api.ErrorResponse |
Update Users's password
Collect, validate and store User's new Skycoin address.
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
newAddress | body | User's new Skycoin address | Yes | object |
Code | Description | Schema |
---|---|---|
200 | OK | user.Model |
400 | Bad Request | api.ErrorResponse |
422 | Unprocessable Entity | api.ErrorResponse |
500 | Internal Server Error | api.ErrorResponse |
Re-send welcome mail containing verification token
In case User misplaces original welcome mail new one is sent to the registered email address
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
query | User's email address | Yes | string |
Code | Description | Schema |
---|---|---|
200 | ||
400 | Bad Request | api.ErrorResponse |
Process forgot password request
If User has forgotten his password and received password reset link this endpoint validates input and stores new password.
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
forgotPasswordRequest | body | User's forgot password input | Yes | object |
Code | Description | Schema |
---|---|---|
200 | ||
422 | Unprocessable Entity | api.ErrorResponse |
500 | Internal Server Error | api.ErrorResponse |
Request a setup for OTP code for your account
Request otp to be set up for your account
Code | Description | Schema |
---|---|---|
200 | ||
500 | Internal Server Error | api.ErrorResponse |
Verify User's email address based on token provided via email
After User creates account first available action is to verify account's email address.
Name | Located in | Description | Required | Schema |
---|---|---|---|---|
token | query | User's token for email validation | Yes | string |
Code | Description | Schema |
---|---|---|
200 | OK | user.Model |
400 | Bad Request | api.ErrorResponse |
500 | Internal Server Error | api.ErrorResponse |
Name | Type | Description | Required |
---|---|---|---|
message | string | No |
Name | Type | Description | Required |
---|---|---|---|
createdAt | string | No | |
disabled | string | No | |
id | integer | No | |
password | string | No | |
rights | string | No | |
status | integer | No | |
useOtp | boolean | No | |
username | string | No |