235 lines
7.2 KiB
JSON
235 lines
7.2 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"title": "oc-auth",
|
|
"description": "OpenCloud authentication services\n",
|
|
"version": "1.0.0",
|
|
"termsOfService": "http://cloud.o-forge.io/",
|
|
"contact": {
|
|
"email": "admin@o-cloud.io"
|
|
},
|
|
"license": {
|
|
"name": "MIT",
|
|
"url": "https://opensource.org/license/mit"
|
|
}
|
|
},
|
|
"basePath": "/oc",
|
|
"paths": {
|
|
"/auth/": {
|
|
"post": {
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"description": "create auths\n\u003cbr\u003e",
|
|
"operationId": "AuthController.Create",
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"description": "The auth content",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/models.auth"
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "{string} models.auth.Id"
|
|
},
|
|
"403": {
|
|
"description": "body is empty"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/discover/{url}": {
|
|
"get": {
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"description": "find auth by authid\n\u003cbr\u003e",
|
|
"operationId": "AuthController.Get",
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "authId",
|
|
"description": "the authid you want to get",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "{auth} models.auth"
|
|
},
|
|
"403": {
|
|
"description": ":authId is empty"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/find/{query}": {
|
|
"get": {
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"description": "find auths with query\n\u003cbr\u003e",
|
|
"operationId": "AuthController.Find",
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "query",
|
|
"description": "the keywords you need",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "{auths} []models.auth"
|
|
},
|
|
"403": {
|
|
"description": ""
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/auth/{authId}": {
|
|
"get": {
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"description": "find auth by authid\n\u003cbr\u003e",
|
|
"operationId": "AuthController.Get",
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "authId",
|
|
"description": "the authid you want to get",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "{auth} models.auth"
|
|
},
|
|
"403": {
|
|
"description": ":authId is empty"
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"tags": [
|
|
"auth"
|
|
],
|
|
"description": "delete the auth\n\u003cbr\u003e",
|
|
"operationId": "AuthController.Delete",
|
|
"parameters": [
|
|
{
|
|
"in": "path",
|
|
"name": "authId",
|
|
"description": "The authId you want to delete",
|
|
"required": true,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "{string} delete success!"
|
|
},
|
|
"403": {
|
|
"description": "authId is empty"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/registration/": {
|
|
"post": {
|
|
"tags": [
|
|
"registration"
|
|
],
|
|
"description": "create auths\n\u003cbr\u003e",
|
|
"operationId": "RegistrationController.Create",
|
|
"parameters": [
|
|
{
|
|
"in": "body",
|
|
"name": "body",
|
|
"description": "The app info",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/models.Application"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "{string} models.auth.Id"
|
|
},
|
|
"403": {
|
|
"description": "body is empty"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/version/": {
|
|
"get": {
|
|
"tags": [
|
|
"version"
|
|
],
|
|
"description": "get version\n\u003cbr\u003e",
|
|
"operationId": "VersionController.GetAll",
|
|
"responses": {
|
|
"200": {
|
|
"description": ""
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"models.Application": {
|
|
"title": "Application",
|
|
"type": "object",
|
|
"properties": {
|
|
"access_token": {
|
|
"type": "string"
|
|
},
|
|
"callback_url": {
|
|
"type": "string"
|
|
},
|
|
"client_id": {
|
|
"type": "string"
|
|
},
|
|
"client_name": {
|
|
"type": "string"
|
|
},
|
|
"client_secret": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"models.auth": {
|
|
"title": "auth",
|
|
"type": "object"
|
|
}
|
|
},
|
|
"tags": [
|
|
{
|
|
"name": "auth",
|
|
"description": "Operations about auth\n"
|
|
},
|
|
{
|
|
"name": "registration",
|
|
"description": "Operations about auth\n"
|
|
},
|
|
{
|
|
"name": "version",
|
|
"description": "VersionController operations for Version\n"
|
|
}
|
|
]
|
|
} |