2024-07-26 13:46:05 +02:00
|
|
|
{
|
|
|
|
"swagger": "2.0",
|
|
|
|
"info": {
|
2024-09-27 09:20:59 +02:00
|
|
|
"title": "oc-auth",
|
|
|
|
"description": "OpenCloud authentication services\n",
|
2024-07-26 13:46:05 +02:00
|
|
|
"version": "1.0.0",
|
2024-09-27 09:20:59 +02:00
|
|
|
"termsOfService": "http://cloud.o-forge.io/",
|
2024-07-26 13:46:05 +02:00
|
|
|
"contact": {
|
2024-09-27 09:20:59 +02:00
|
|
|
"email": "admin@o-cloud.io"
|
2024-07-26 13:46:05 +02:00
|
|
|
},
|
|
|
|
"license": {
|
2024-10-28 14:58:11 +01:00
|
|
|
"name": "AGPL",
|
|
|
|
"url": "https://www.gnu.org/licenses/agpl-3.0.html"
|
2024-07-26 13:46:05 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"basePath": "/oc",
|
|
|
|
"paths": {
|
2024-10-28 14:58:11 +01:00
|
|
|
"/auth/claims": {
|
2024-07-26 13:46:05 +02:00
|
|
|
"post": {
|
|
|
|
"tags": [
|
|
|
|
"auth"
|
|
|
|
],
|
2024-10-28 14:58:11 +01:00
|
|
|
"description": "enrich token with claims\n\u003cbr\u003e",
|
|
|
|
"operationId": "OAuthController.Claims",
|
2024-07-26 13:46:05 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "body",
|
|
|
|
"name": "body",
|
2024-10-28 14:58:11 +01:00
|
|
|
"description": "The token info",
|
2024-07-26 13:46:05 +02:00
|
|
|
"required": true,
|
|
|
|
"schema": {
|
2024-10-28 14:58:11 +01:00
|
|
|
"$ref": "#/definitions/models.Token"
|
2024-07-26 13:46:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
2024-10-28 14:58:11 +01:00
|
|
|
"description": "{string}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/auth/forward": {
|
|
|
|
"get": {
|
|
|
|
"tags": [
|
|
|
|
"auth"
|
|
|
|
],
|
|
|
|
"description": "auth forward\n\u003cbr\u003e",
|
|
|
|
"operationId": "OAuthController.AuthForward",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "header",
|
|
|
|
"name": "Authorization",
|
|
|
|
"description": "auth token",
|
|
|
|
"type": "string"
|
2024-07-26 13:46:05 +02:00
|
|
|
},
|
2024-10-28 14:58:11 +01:00
|
|
|
{
|
|
|
|
"in": "body",
|
|
|
|
"name": "body",
|
|
|
|
"description": "The workflow content",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/models.workflow"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{string}"
|
2024-07-26 13:46:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-10-28 14:58:11 +01:00
|
|
|
"/auth/introspect": {
|
2024-09-27 09:20:59 +02:00
|
|
|
"get": {
|
|
|
|
"tags": [
|
|
|
|
"auth"
|
|
|
|
],
|
2024-10-28 14:58:11 +01:00
|
|
|
"description": "introspect token\n\u003cbr\u003e",
|
|
|
|
"operationId": "OAuthController.Introspection",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "header",
|
|
|
|
"name": "Authorization",
|
|
|
|
"description": "auth token",
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{string}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/auth/ldap/login": {
|
|
|
|
"post": {
|
|
|
|
"tags": [
|
|
|
|
"auth"
|
|
|
|
],
|
|
|
|
"description": "authenticate user\n\u003cbr\u003e",
|
|
|
|
"operationId": "OAuthController.Login",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "body",
|
|
|
|
"name": "body",
|
|
|
|
"description": "The workflow content",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/models.workflow"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{string}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/auth/ldap/logout": {
|
|
|
|
"delete": {
|
|
|
|
"tags": [
|
|
|
|
"auth"
|
|
|
|
],
|
|
|
|
"description": "unauthenticate user\n\u003cbr\u003e",
|
|
|
|
"operationId": "OAuthController.Logout",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "header",
|
|
|
|
"name": "Authorization",
|
|
|
|
"description": "auth token",
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{string}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/auth/refresh": {
|
|
|
|
"post": {
|
|
|
|
"tags": [
|
|
|
|
"auth"
|
|
|
|
],
|
|
|
|
"description": "introspect token\n\u003cbr\u003e",
|
|
|
|
"operationId": "OAuthController.Introspection",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "body",
|
|
|
|
"name": "body",
|
|
|
|
"description": "The token info",
|
|
|
|
"required": true,
|
|
|
|
"schema": {
|
|
|
|
"$ref": "#/definitions/models.Token"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{string}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/permission/": {
|
|
|
|
"get": {
|
|
|
|
"tags": [
|
|
|
|
"permission"
|
|
|
|
],
|
|
|
|
"description": "find permissions\n\u003cbr\u003e",
|
|
|
|
"operationId": "PermissionController.GetAll",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{permission} string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/permission/clear": {
|
|
|
|
"delete": {
|
|
|
|
"tags": [
|
|
|
|
"permission"
|
|
|
|
],
|
|
|
|
"description": "clear the permission\n\u003cbr\u003e",
|
|
|
|
"operationId": "PermissionController.Clear",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{string} delete success!"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/permission/role/{id}": {
|
|
|
|
"get": {
|
|
|
|
"tags": [
|
|
|
|
"permission"
|
|
|
|
],
|
|
|
|
"description": "find permission by role id\n\u003cbr\u003e",
|
|
|
|
"operationId": "PermissionController.GetByRole",
|
2024-09-27 09:20:59 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "path",
|
2024-10-28 14:58:11 +01:00
|
|
|
"name": "id",
|
|
|
|
"description": "the id you want to get",
|
2024-09-27 09:20:59 +02:00
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
2024-10-28 14:58:11 +01:00
|
|
|
"description": "{auth} string"
|
2024-09-27 09:20:59 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-10-28 14:58:11 +01:00
|
|
|
"/permission/user/{id}": {
|
2024-07-26 13:46:05 +02:00
|
|
|
"get": {
|
|
|
|
"tags": [
|
2024-10-28 14:58:11 +01:00
|
|
|
"permission"
|
2024-07-26 13:46:05 +02:00
|
|
|
],
|
2024-10-28 14:58:11 +01:00
|
|
|
"description": "find permission by user id\n\u003cbr\u003e",
|
|
|
|
"operationId": "PermissionController.GetByUser",
|
2024-07-26 13:46:05 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "path",
|
2024-10-28 14:58:11 +01:00
|
|
|
"name": "id",
|
|
|
|
"description": "the id you want to get",
|
2024-07-26 13:46:05 +02:00
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
2024-10-28 14:58:11 +01:00
|
|
|
"description": "{auth} string"
|
2024-07-26 13:46:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-10-28 14:58:11 +01:00
|
|
|
"/permission/{id}/{relation[get]}": {
|
2024-07-26 13:46:05 +02:00
|
|
|
"get": {
|
|
|
|
"tags": [
|
2024-10-28 14:58:11 +01:00
|
|
|
"permission"
|
2024-07-26 13:46:05 +02:00
|
|
|
],
|
2024-10-28 14:58:11 +01:00
|
|
|
"description": "find auth by permission\n\u003cbr\u003e",
|
|
|
|
"operationId": "PermissionController.Get",
|
2024-07-26 13:46:05 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "path",
|
2024-10-28 14:58:11 +01:00
|
|
|
"name": "id",
|
|
|
|
"description": "the permission you want to get",
|
2024-07-26 13:46:05 +02:00
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{auth} models.auth"
|
2024-10-28 14:58:11 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/permission/{permission_id}/{role_id}/{relation}": {
|
|
|
|
"post": {
|
|
|
|
"tags": [
|
|
|
|
"permission"
|
|
|
|
],
|
|
|
|
"description": "bind the permission to role\n\u003cbr\u003e",
|
|
|
|
"operationId": "PermissionController.Bind",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "path",
|
|
|
|
"name": "role_id",
|
|
|
|
"description": "The role_id you want to bind",
|
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
2024-07-26 13:46:05 +02:00
|
|
|
},
|
2024-10-28 14:58:11 +01:00
|
|
|
{
|
|
|
|
"in": "path",
|
|
|
|
"name": "method",
|
|
|
|
"description": "The method you want to relate role \u0026 permission",
|
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"in": "path",
|
|
|
|
"name": "permission_id",
|
|
|
|
"description": "The permission_id you want to bind",
|
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{string} bind success!"
|
2024-07-26 13:46:05 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"delete": {
|
|
|
|
"tags": [
|
2024-10-28 14:58:11 +01:00
|
|
|
"permission"
|
2024-07-26 13:46:05 +02:00
|
|
|
],
|
2024-10-28 14:58:11 +01:00
|
|
|
"description": "unbind the permission to role\n\u003cbr\u003e",
|
|
|
|
"operationId": "PermissionController.UnBind",
|
2024-07-26 13:46:05 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "path",
|
2024-10-28 14:58:11 +01:00
|
|
|
"name": "role_id",
|
|
|
|
"description": "The role_id you want to unbind",
|
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"in": "path",
|
|
|
|
"name": "relation",
|
|
|
|
"description": "The method you want to unrelate role \u0026 permission",
|
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"in": "path",
|
|
|
|
"name": "permission_id",
|
|
|
|
"description": "The permission_id you want to unbind",
|
2024-07-26 13:46:05 +02:00
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
],
|
2024-10-28 14:58:11 +01:00
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{string} bind success!"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/role/": {
|
|
|
|
"get": {
|
|
|
|
"tags": [
|
|
|
|
"role"
|
|
|
|
],
|
|
|
|
"description": "find roles\n\u003cbr\u003e",
|
|
|
|
"operationId": "RoleController.GetAll",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{role} string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/role/clear": {
|
|
|
|
"delete": {
|
|
|
|
"tags": [
|
|
|
|
"role"
|
|
|
|
],
|
|
|
|
"description": "clear the role\n\u003cbr\u003e",
|
|
|
|
"operationId": "RoleController.Clear",
|
2024-07-26 13:46:05 +02:00
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{string} delete success!"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-09-27 09:20:59 +02:00
|
|
|
},
|
2024-10-28 14:58:11 +01:00
|
|
|
"/role/user/{id}": {
|
|
|
|
"get": {
|
|
|
|
"tags": [
|
|
|
|
"role"
|
|
|
|
],
|
|
|
|
"description": "find role by user id\n\u003cbr\u003e",
|
|
|
|
"operationId": "RoleController.GetByUser",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "path",
|
|
|
|
"name": "id",
|
|
|
|
"description": "the id you want to get",
|
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{auth} string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/role/{id}": {
|
|
|
|
"get": {
|
|
|
|
"tags": [
|
|
|
|
"role"
|
|
|
|
],
|
|
|
|
"description": "find role by id\n\u003cbr\u003e",
|
|
|
|
"operationId": "RoleController.Get",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "path",
|
|
|
|
"name": "id",
|
|
|
|
"description": "the id you want to get",
|
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{role} string"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-09-27 09:20:59 +02:00
|
|
|
"post": {
|
|
|
|
"tags": [
|
2024-10-28 14:58:11 +01:00
|
|
|
"role"
|
2024-09-27 09:20:59 +02:00
|
|
|
],
|
2024-10-28 14:58:11 +01:00
|
|
|
"description": "create role\n\u003cbr\u003e",
|
|
|
|
"operationId": "RoleController.Create",
|
2024-09-27 09:20:59 +02:00
|
|
|
"parameters": [
|
|
|
|
{
|
2024-10-28 14:58:11 +01:00
|
|
|
"in": "path",
|
|
|
|
"name": "id",
|
|
|
|
"description": "the id you want to get",
|
2024-09-27 09:20:59 +02:00
|
|
|
"required": true,
|
2024-10-28 14:58:11 +01:00
|
|
|
"type": "string"
|
2024-09-27 09:20:59 +02:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
2024-10-28 14:58:11 +01:00
|
|
|
"description": "{auth} create success!"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"delete": {
|
|
|
|
"tags": [
|
|
|
|
"role"
|
|
|
|
],
|
|
|
|
"description": "delete the role\n\u003cbr\u003e",
|
|
|
|
"operationId": "RoleController.Delete",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "path",
|
|
|
|
"name": "id",
|
|
|
|
"description": "The id you want to delete",
|
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{string} delete success!"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/role/{user_id}/{role_id}": {
|
|
|
|
"post": {
|
|
|
|
"tags": [
|
|
|
|
"role"
|
|
|
|
],
|
|
|
|
"description": "bind the role to user\n\u003cbr\u003e",
|
|
|
|
"operationId": "RoleController.Bind",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "path",
|
|
|
|
"name": "user_id",
|
|
|
|
"description": "The user_id you want to bind",
|
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
2024-09-27 09:20:59 +02:00
|
|
|
},
|
2024-10-28 14:58:11 +01:00
|
|
|
{
|
|
|
|
"in": "path",
|
|
|
|
"name": "role_id",
|
|
|
|
"description": "The role_id you want to bind",
|
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{string} bind success!"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"delete": {
|
|
|
|
"tags": [
|
|
|
|
"role"
|
|
|
|
],
|
|
|
|
"description": "unbind the role to user\n\u003cbr\u003e",
|
|
|
|
"operationId": "RoleController.UnBind",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"in": "path",
|
|
|
|
"name": "role_id",
|
|
|
|
"description": "The role_id you want to unbind",
|
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"in": "path",
|
|
|
|
"name": "user_id",
|
|
|
|
"description": "The user_id you want to unbind",
|
|
|
|
"required": true,
|
|
|
|
"type": "string"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": "{string} bind success!"
|
2024-09-27 09:20:59 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"/version/": {
|
|
|
|
"get": {
|
|
|
|
"tags": [
|
|
|
|
"version"
|
|
|
|
],
|
|
|
|
"description": "get version\n\u003cbr\u003e",
|
|
|
|
"operationId": "VersionController.GetAll",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-10-28 14:58:11 +01:00
|
|
|
},
|
|
|
|
"/version/discovery": {
|
|
|
|
"get": {
|
|
|
|
"tags": [
|
|
|
|
"version"
|
|
|
|
],
|
|
|
|
"description": "get version\n\u003cbr\u003e",
|
|
|
|
"operationId": "VersionController.Get",
|
|
|
|
"responses": {
|
|
|
|
"200": {
|
|
|
|
"description": ""
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-07-26 13:46:05 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"definitions": {
|
2024-10-28 14:58:11 +01:00
|
|
|
"models.Token": {
|
|
|
|
"title": "Token",
|
|
|
|
"type": "object"
|
|
|
|
},
|
|
|
|
"models.workflow": {
|
|
|
|
"title": "workflow",
|
2024-07-26 13:46:05 +02:00
|
|
|
"type": "object"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"tags": [
|
|
|
|
{
|
|
|
|
"name": "auth",
|
|
|
|
"description": "Operations about auth\n"
|
|
|
|
},
|
2024-09-27 09:20:59 +02:00
|
|
|
{
|
2024-10-28 14:58:11 +01:00
|
|
|
"name": "role",
|
|
|
|
"description": "Operations about auth\n"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "permission",
|
2024-09-27 09:20:59 +02:00
|
|
|
"description": "Operations about auth\n"
|
|
|
|
},
|
2024-07-26 13:46:05 +02:00
|
|
|
{
|
|
|
|
"name": "version",
|
|
|
|
"description": "VersionController operations for Version\n"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|