https://github.com/ulbora/ulborauserservice
A microservice for managing users
https://github.com/ulbora/ulborauserservice
Last synced: 2 months ago
JSON representation
A microservice for managing users
- Host: GitHub
- URL: https://github.com/ulbora/ulborauserservice
- Owner: Ulbora
- License: agpl-3.0
- Created: 2016-10-29T21:04:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2018-06-09T18:05:27.000Z (about 8 years ago)
- Last Synced: 2025-03-21T18:32:52.798Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 58.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Ulbora User Service
==============
A User Micro Service
## Headers
Content-Type: application/json (for POST and PUT)
Authorization: Bearer atToken
clientId: clientId (example 33477)
## Add Role
```
POST:
URL: http://localhost:3001/rs/role/add
Example Request
{
"role": "tester1234role45667"
}
```
```
Example Response
{
"success": true,
"message": ""
}
```
## Get Role List
```
GET:
URL: http://localhost:3001/rs/role/list
```
```
Example Response
[
{
"id": 1,
"role": "admin"
},
{
"id": 127,
"role": "tester55"
},
{
"id": 2,
"role": "user"
}
]
```
## Get Role
```
GET:
URL: http://localhost:3001/rs/role/get/94
```
```
Example Response
{
"id": 94,
"role": "admin"
}
```
## Delete Role
```
DELETE:
URL: http://localhost:3001/rs/role/delete/94
```
```
Example Response
{
"success": true,
"message": ""
}
```
## Add User
```
POST:
URL: http://localhost:3001/rs/user/add
Example Request
{
"username":"ken",
"password":"ken",
"enabled":true,
"emailAddress":"bob@bob.com",
"firstName":"ken",
"lastName":"williamson",
"roleId":1,
"clientId":"403"
}
```
```
Example Response
{
"success": true,
"emailAddress":"bob@bob.com",
"message": ""
}
```
## Update User (change password)
```
PUT:
URL: http://localhost:3001/rs/user/update
Example Request
{
"username":"ken",
"password":"ken",
"clientId":"5"
}
```
```
Example Response
{
"success": true,
"message": ""
}
```
## Update User (disable/enable)
```
PUT:
URL: http://localhost:3001/rs/user/update
Example Request
{
"username":"ken",
"enabled":true,
"clientId":"5"
}
```
```
Example Response
{
"success": true,
"message": ""
}
```
## Update User (info)
```
PUT:
URL: http://localhost:3001/rs/user/update
Example Request
{
"username":"ken",
"emailAddress":"bob@bob.com",
"firstName":"bob",
"lastName":"williams",
"roleId": 1,
"clientId":"5"
}
```
```
Example Response
{
"success": true,
"message": ""
}
```
## Get User
```
GET:
URL: http://localhost:3001/rs/user/get/ken/2
```
```
Example Response
{
"username": "ken",
"enabled": true,
"dateEntered": "2017-05-06T04:00:00.000Z",
"emailAddress": "bob@bob.com",
"firstName": "ken",
"lastName": "williamson",
"roleId": 1,
"clientId": "2"
}
```
## Get User List
```
GET:
URL: http://localhost:3001/rs/user/list
```
```
Example Response
[
{
"username": "ken",
"clientId": "2",
"firstName": "ken",
"lastName": "williamson",
"enabled": true
},
{
"username": "ken",
"clientId": "3",
"firstName": "ken",
"lastName": "williamson",
"enabled": true
},
{
"username": "ken",
"clientId": "4",
"firstName": "ken",
"lastName": "williamson",
"enabled": true
},
{
"username": "ken",
"clientId": "403",
"firstName": "ken",
"lastName": "williamson",
"enabled": true
},
{
"username": "tester2",
"clientId": "4454",
"firstName": "bob",
"lastName": "hope",
"enabled": true
}
]
```
## Delete User
```
DELETE:
URL: http://localhost:3001/rs/user/delete/ken/5
```
```
Example Response
{
"success": true,
"message": ""
}
```
## Login
```
POST:
URL: http://localhost:3001/rs/user/login
Example Request
{
"username":"ken",
"password":"ken",
"clientId":"5"
}
```
```
Example Response
{
"success": true,
"id": 49,
"message": ""
}
```