BigBucks Solutions Auth Engine 0.0.1
This is REST api definitions.
Servers
Description | URL |
---|---|
//localhost:8000/api/v1 | //localhost:8000/api/v1 |
permissions
GET /master-data/actions
Get actions
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
X-Auth |
header | string | No | Authorization |
Response 200 OK
[
"string"
]
Schema of the response body
{
"items": {
"type": "string"
},
"type": "array"
}
GET /master-data/resources
Get resources
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
X-Auth |
header | string | No | Authorization |
Response 200 OK
[
"string"
]
Schema of the response body
{
"items": {
"type": "string"
},
"type": "array"
}
GET /master-data/scopes
Get scopes
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
X-Auth |
header | string | No | Authorization |
Response 200 OK
[
"string"
]
Schema of the response body
{
"items": {
"type": "string"
},
"type": "array"
}
POST /permissions
Create new permission
Description
Create a new permission in the system
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
X-Auth |
header | string | No | Authorization |
Request body
{
"action": "string",
"resource": "string",
"scope": "string"
}
Schema of the request body
{
"properties": {
"action": {
"minLength": 3,
"type": "string"
},
"resource": {
"minLength": 3,
"type": "string"
},
"scope": {
"minLength": 3,
"type": "string"
}
},
"required": [
"action",
"resource",
"scope"
],
"type": "object"
}
Response 201 Created
auth
GET /me
Get logged in user profile information
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
X-Auth |
header | string | No | Authorization |
Response 200 OK
{
"isSocialAccount": true,
"profile": {
"avatar": "string",
"email": "string",
"firstName": "string",
"lastName": "string",
"phone": "string"
},
"roles": [
{
"description": "string",
"extraAttrs": {},
"name": "string"
}
],
"username": "string"
}
Schema of the response body
{
"properties": {
"isSocialAccount": {
"type": "boolean"
},
"profile": {
"$ref": "#/components/schemas/bigbucks_solution_auth_rest-api_controllers_types.Profile"
},
"roles": {
"items": {
"$ref": "#/components/schemas/bigbucks_solution_auth_rest-api_controllers_types.Role"
},
"type": "array"
},
"username": {
"type": "string"
}
},
"type": "object"
}
Response 400 Bad Request
Response 500 Internal Server Error
POST /signin
Authenticate with username and pssword
Description
Authenticate user with password and issue jwt token
Request body
{
"password": "string",
"recaptcha": "string",
"username": "string"
}
Schema of the request body
{
"properties": {
"password": {
"type": "string"
},
"recaptcha": {
"type": "string"
},
"username": {
"type": "string"
}
},
"type": "object"
}
Response 200 OK
"string"
Schema of the response body
{
"type": "string"
}
Response 400 Bad Request
Schema of the response body
{
"type": "object"
}
Response 404 Not Found
Schema of the response body
{
"type": "object"
}
Response 500 Internal Server Error
Schema of the response body
{
"type": "object"
}
POST /signup
Register a new user
Description
Create a new user account
Request body
{
"email": "string",
"firstName": "string",
"lastName": "string",
"password": "string"
}
Schema of the request body
{
"properties": {
"email": {
"type": "string"
},
"firstName": {
"type": "string"
},
"lastName": {
"type": "string"
},
"password": {
"minLength": 6,
"type": "string"
}
},
"required": [
"email",
"firstName",
"lastName",
"password"
],
"type": "object"
}
Response 200 OK
{
"message": "message"
}
Schema of the response body
{
"properties": {
"message": {
"example": "message",
"type": "string"
}
},
"type": "object"
}
Response 400 Bad Request
Schema of the response body
{
"type": "object"
}
Response 404 Not Found
Schema of the response body
{
"type": "object"
}
Response 500 Internal Server Error
Schema of the response body
{
"type": "object"
}
POST /user/authorize
Check user have permission
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
X-Auth |
header | string | No | Authorization |
Request body
{
"action": "string",
"orgID": 0,
"resource": "string",
"scope": "string"
}
Schema of the request body
{
"properties": {
"action": {
"type": "string"
},
"orgID": {
"type": "integer"
},
"resource": {
"type": "string"
},
"scope": {
"type": "string"
}
},
"type": "object"
}
Response 200 OK
{
"status": true
}
Schema of the response body
{
"properties": {
"status": {
"type": "boolean"
}
},
"type": "object"
}
Response 400 Bad Request
Response 500 Internal Server Error
POST /user/changepassword/{token}
Reset the password with the password reset token sent
Description
Reset the password with the password reset token sent to email
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
token |
path | string | No | token |
Request body
{
"email": "string",
"password": "string"
}
Schema of the request body
{
"properties": {
"email": {
"type": "string"
},
"password": {
"type": "string"
}
},
"type": "object"
}
Response 200 OK
Response 400 Bad Request
Response 404 Not Found
Response 500 Internal Server Error
POST /user/reset
Send the password reset token
Description
Get password reset token to email
Request body
{
"email": "example@example.com"
}
Schema of the request body
{
"properties": {
"email": {
"example": "example@example.com",
"type": "string"
}
},
"type": "object"
}
Response 200 OK
{
"message": "message"
}
Schema of the response body
{
"properties": {
"message": {
"example": "message",
"type": "string"
}
},
"type": "object"
}
Response 400 Bad Request
Response 404 Not Found
Response 500 Internal Server Error
POST /user/updateprofile
Update User profile details
Description
Update user profile details
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
X-Auth |
header | string | No | Authorization |
Request body
{
"firstName": "John",
"lastName": "Doe",
"file": ""
}
Schema of the request body
{
"properties": {
"file": {
"type": "binary"
},
"firstName": {
"type": "string",
"example": "John"
},
"lastName": {
"type": "string",
"example": "Doe"
},
"phone": {
"type": "string",
"example": "0000000"
}
},
"example": {
"firstName": "John",
"lastName": "Doe",
"file": ""
},
"type": "object"
}
Response 200 OK
Response 400 Bad Request
Response 404 Not Found
Response 500 Internal Server Error
GET /users
Lists the users
Description
Lists the users for an organization
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
JWTAuth |
header | string | N/A | No | JWT token for user authentication (not a simple API key despite the 'apikey' type) |
JWTAuth |
header | string | N/A | No | JWT token for user authentication (not a simple API key despite the 'apikey' type) |
org_id |
query | integer | No | Filter by organization ID | |
page |
query | integer | 1 | No | Page number |
page_size |
query | integer | 10 | No | Page size |
role_id |
query | string | No | Filter by role name | |
X-Auth |
header | string | No | Authorization |
Response 200 OK
{
"page": 0,
"page_size": 0,
"total": 0,
"users": [
{
"activeSessions": 0,
"email": "string",
"firstName": "string",
"id": "string",
"lastLogin": "string",
"lastName": "string",
"roles": [
{
"id": "string",
"name": "string"
}
],
"status": "active",
"username": "string"
}
]
}
Schema of the response body
{
"properties": {
"page": {
"type": "integer"
},
"page_size": {
"type": "integer"
},
"total": {
"type": "integer"
},
"users": {
"items": {
"$ref": "#/components/schemas/types.ListUserResponse"
},
"type": "array"
}
},
"type": "object"
}
roles
GET /roles
List roles
Description
Get paginated list of roles with user count
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
page |
query | integer | 1 | No | Page number |
page_size |
query | integer | 10 | No | Page size |
role_name |
query | string | No | Filter by role name | |
X-Auth |
header | string | No | Authorization |
Response 200 OK
{
"page": 0,
"roles": [
{
"description": "string",
"extraAttrs": {},
"id": "string",
"name": "string",
"userCount": 0
}
],
"size": 0,
"total": 0
}
Schema of the response body
{
"properties": {
"page": {
"type": "integer"
},
"roles": {
"items": {
"$ref": "#/components/schemas/types.ListRoleResponse"
},
"type": "array"
},
"size": {
"type": "integer"
},
"total": {
"type": "integer"
}
},
"type": "object"
}
POST /roles
Create new role
Description
Create a new role in the system
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
X-Auth |
header | string | No | Authorization |
Request body
{
"description": "string",
"extraAttrs": {},
"name": "string"
}
Schema of the request body
{
"properties": {
"description": {
"type": "string"
},
"extraAttrs": {
"additionalProperties": true,
"type": "object"
},
"name": {
"type": "string"
}
},
"required": [
"name"
],
"type": "object"
}
Response 201 Created
POST /roles/:role_id/permissions
List permission of a role
Description
Lists permissions of a role
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
X-Auth |
header | string | No | Authorization |
Response 200 OK
[
{
"action": "string",
"isHidden": true,
"isLocked": true,
"resource": "string",
"scope": "string"
}
]
Schema of the response body
{
"items": {
"$ref": "#/components/schemas/types.ListRolePermission"
},
"type": "array"
}
POST /roles/bind-permission
Bind permission to role
Description
Associates a permission with a role
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
X-Auth |
header | string | No | Authorization |
Request body
{
"action": "string",
"resource": "string",
"role_id": "string",
"scope": "string"
}
Schema of the request body
{
"properties": {
"action": {
"type": "string"
},
"resource": {
"type": "string"
},
"role_id": {
"type": "string"
},
"scope": {
"type": "string"
}
},
"type": "object"
}
Response 200 OK
"string"
Schema of the response body
{
"type": "string"
}
POST /roles/bind-user
Bind role to user
Description
Associates a role with a user in an organization
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
X-Auth |
header | string | No | Authorization |
Request body
{
"orgId": "string",
"roleId": "string",
"userId": "string"
}
Schema of the request body
{
"properties": {
"orgId": {
"type": "string"
},
"roleId": {
"type": "string"
},
"userId": {
"type": "string"
}
},
"required": [
"orgId",
"roleId",
"userId"
],
"type": "object"
}
Response 200 OK
"string"
Schema of the response body
{
"type": "string"
}
POST /roles/unbind-permission
UnBind permission to role
Description
Removes a permission with a role
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
X-Auth |
header | string | No | Authorization |
Request body
{
"action": "string",
"resource": "string",
"role_id": "string",
"scope": "string"
}
Schema of the request body
{
"properties": {
"action": {
"type": "string"
},
"resource": {
"type": "string"
},
"role_id": {
"type": "string"
},
"scope": {
"type": "string"
}
},
"type": "object"
}
Response 200 OK
"string"
Schema of the response body
{
"type": "string"
}
POST /roles/unbind-user
UnBind role to user
Description
Removes a role with a user in an organization
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
X-Auth |
header | string | No | Authorization |
Request body
{
"orgId": "string",
"roleId": "string",
"userId": "string"
}
Schema of the request body
{
"properties": {
"orgId": {
"type": "string"
},
"roleId": {
"type": "string"
},
"userId": {
"type": "string"
}
},
"required": [
"orgId",
"roleId",
"userId"
],
"type": "object"
}
Response 200 OK
"string"
Schema of the response body
{
"type": "string"
}
sessions
GET /sessions/users/{user_id}
List User session for provided userId
Description
List User sessions for provided userId
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
user_id |
path | string | No | User ID | |
X-Auth |
header | string | No | Authorization |
Response 200 OK
[
{}
]
Schema of the response body
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
}
Response 400 Bad Request
Response 404 Not Found
Response 500 Internal Server Error
DELETE /sessions/{session_id}
Revoke a specific user session
Description
Revokes a specific session by session ID
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
session_id |
path | string | No | Session ID to revoke | |
X-Auth |
header | string | No | Authorization |
Response 200 OK
Schema of the response body
{
"additionalProperties": {
"type": "string"
},
"type": "object"
}
Response 400 Bad Request
Response 404 Not Found
Response 500 Internal Server Error
DELETE /users/{user_id}/sessions
Revoke all user sessions except current
Description
Revokes all sessions for a user except the current session
Input parameters
Parameter | In | Type | Default | Nullable | Description |
---|---|---|---|---|---|
user_id |
path | string | No | User ID | |
X-Auth |
header | string | No | Authorization |
Response 200 OK
Schema of the response body
{
"additionalProperties": {
"type": "string"
},
"type": "object"
}
Response 400 Bad Request
Response 404 Not Found
Response 500 Internal Server Error
Schemas
actions.UserListResponse
Name | Type |
---|---|
page |
integer |
page_size |
integer |
total |
integer |
users |
Array<types.ListUserResponse> |
bigbucks_solution_auth_rest-api_controllers_types.Profile
Name | Type |
---|---|
avatar |
string |
email |
string |
firstName |
string |
lastName |
string |
phone |
string |
bigbucks_solution_auth_rest-api_controllers_types.Role
Name | Type |
---|---|
description |
string |
extraAttrs |
|
name |
string |
constants.UserStatus
Type: string
controllers.JsonCred
Name | Type |
---|---|
password |
string |
recaptcha |
string |
username |
string |
controllers.RequestPasswordResetToken
Name | Type |
---|---|
email |
string |
controllers.ResetPassword
Name | Type |
---|---|
email |
string |
password |
string |
types.AuthorizeResponse
Name | Type |
---|---|
status |
boolean |
types.CheckPermissionBody
Name | Type |
---|---|
action |
string |
orgID |
integer |
resource |
string |
scope |
string |
types.CreatePermissionBody
Name | Type |
---|---|
action |
string |
resource |
string |
scope |
string |
types.ListRolePermission
Name | Type |
---|---|
action |
string |
isHidden |
boolean |
isLocked |
boolean |
resource |
string |
scope |
string |
types.ListRoleResponse
Name | Type |
---|---|
description |
string |
extraAttrs |
|
id |
string |
name |
string |
userCount |
integer |
types.ListRolesPagedResponse
Name | Type |
---|---|
page |
integer |
roles |
Array<types.ListRoleResponse> |
size |
integer |
total |
integer |
types.ListUserResponse
Name | Type |
---|---|
activeSessions |
integer |
email |
string |
firstName |
string |
id |
string |
lastLogin |
string |
lastName |
string |
roles |
Array<types.RoleWithId> |
status |
constants.UserStatus |
username |
string |
types.RolePermissionBindingBody
Name | Type |
---|---|
action |
string |
resource |
string |
role_id |
string |
scope |
string |
types.RoleWithId
Name | Type |
---|---|
id |
string |
name |
string |
types.SignupRequestBody
Name | Type |
---|---|
email |
string |
firstName |
string |
lastName |
string |
password |
string |
types.SimpleResponse
Name | Type |
---|---|
message |
string |
types.UserInfo
Name | Type |
---|---|
isSocialAccount |
boolean |
profile |
bigbucks_solution_auth_rest-api_controllers_types.Profile |
roles |
Array<bigbucks_solution_auth_rest-api_controllers_types.Role> |
username |
string |
types.UserRoleBindingBody
Name | Type |
---|---|
orgId |
string |
roleId |
string |
userId |
string |
userUpdateProfileBody
Name | Type |
---|---|
file |
|
firstName |
string |
lastName |
string |
phone |
string |
Security schemes
Name | Type | Scheme | Description |
---|---|---|---|
JWTAuth | apiKey | JWT token for user authentication (not a simple API key despite the 'apikey' type) |