532 lines
12 KiB
YAML
532 lines
12 KiB
YAML
swagger: "2.0"
|
|
info:
|
|
title: oc-auth
|
|
description: |
|
|
OpenCloud authentication services
|
|
version: 1.0.0
|
|
termsOfService: http://cloud.o-forge.io/
|
|
contact:
|
|
email: admin@o-cloud.io
|
|
license:
|
|
name: AGPL
|
|
url: https://www.gnu.org/licenses/agpl-3.0.html
|
|
basePath: /oc/
|
|
paths:
|
|
/forward:
|
|
get:
|
|
tags:
|
|
- oc-auth/controllersOAuthController
|
|
description: |-
|
|
auth forward
|
|
<br>
|
|
operationId: OAuthController.AuthForward
|
|
parameters:
|
|
- in: header
|
|
name: Authorization
|
|
description: auth token
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{string}'
|
|
/group/:
|
|
get:
|
|
tags:
|
|
- group
|
|
description: |-
|
|
find groups
|
|
<br>
|
|
operationId: GroupController.GetAll
|
|
responses:
|
|
"200":
|
|
description: '{group} string'
|
|
/group/{id}:
|
|
get:
|
|
tags:
|
|
- group
|
|
description: |-
|
|
find group by id
|
|
<br>
|
|
operationId: GroupController.Get
|
|
parameters:
|
|
- in: path
|
|
name: id
|
|
description: the id you want to get
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{group} string'
|
|
post:
|
|
tags:
|
|
- group
|
|
description: |-
|
|
create group
|
|
<br>
|
|
operationId: GroupController.Create
|
|
parameters:
|
|
- in: path
|
|
name: id
|
|
description: the id you want to get
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{auth} create success!'
|
|
delete:
|
|
tags:
|
|
- group
|
|
description: |-
|
|
delete the group
|
|
<br>
|
|
operationId: GroupController.Delete
|
|
parameters:
|
|
- in: path
|
|
name: id
|
|
description: The id you want to delete
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{string} delete success!'
|
|
/group/{user_id}/{group_id}:
|
|
post:
|
|
tags:
|
|
- group
|
|
description: |-
|
|
bind the group to user
|
|
<br>
|
|
operationId: GroupController.Bind
|
|
parameters:
|
|
- in: path
|
|
name: user_id
|
|
description: The user_id you want to bind
|
|
required: true
|
|
type: string
|
|
- in: path
|
|
name: group_id
|
|
description: The group_id you want to bind
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{string} bind success!'
|
|
delete:
|
|
tags:
|
|
- group
|
|
description: |-
|
|
unbind the group to user
|
|
<br>
|
|
operationId: GroupController.UnBind
|
|
parameters:
|
|
- in: path
|
|
name: group_id
|
|
description: The group_id you want to unbind
|
|
required: true
|
|
type: string
|
|
- in: path
|
|
name: group_id
|
|
description: The user_id you want to unbind
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{string} bind success!'
|
|
/group/clear:
|
|
delete:
|
|
tags:
|
|
- group
|
|
description: |-
|
|
clear the group
|
|
<br>
|
|
operationId: GroupController.Clear
|
|
responses:
|
|
"200":
|
|
description: '{string} delete success!'
|
|
/group/user/{id}:
|
|
get:
|
|
tags:
|
|
- group
|
|
description: |-
|
|
find group by user id
|
|
<br>
|
|
operationId: GroupController.GetByUser
|
|
parameters:
|
|
- in: path
|
|
name: id
|
|
description: the id you want to get
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{auth} string'
|
|
/introspect:
|
|
get:
|
|
tags:
|
|
- oc-auth/controllersOAuthController
|
|
description: |-
|
|
introspect token
|
|
<br>
|
|
operationId: OAuthController.Introspection
|
|
parameters:
|
|
- in: header
|
|
name: Authorization
|
|
description: auth token
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{string}'
|
|
/ldap/login:
|
|
post:
|
|
tags:
|
|
- oc-auth/controllersOAuthController
|
|
description: |-
|
|
authenticate user
|
|
<br>
|
|
operationId: OAuthController.Login
|
|
parameters:
|
|
- in: body
|
|
name: body
|
|
description: The workflow content
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/models.workflow'
|
|
responses:
|
|
"200":
|
|
description: '{string}'
|
|
/ldap/logout:
|
|
delete:
|
|
tags:
|
|
- oc-auth/controllersOAuthController
|
|
description: |-
|
|
unauthenticate user
|
|
<br>
|
|
operationId: OAuthController.Logout
|
|
parameters:
|
|
- in: header
|
|
name: Authorization
|
|
description: auth token
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{string}'
|
|
/permission/:
|
|
get:
|
|
tags:
|
|
- permission
|
|
description: |-
|
|
find permissions
|
|
<br>
|
|
operationId: PermissionController.GetAll
|
|
responses:
|
|
"200":
|
|
description: '{permission} string'
|
|
/permission/{id}/{relation}:
|
|
get:
|
|
tags:
|
|
- permission
|
|
description: |-
|
|
find auth by permission
|
|
<br>
|
|
operationId: PermissionController.Get
|
|
parameters:
|
|
- in: path
|
|
name: id
|
|
description: the permission you want to get
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{auth} models.auth'
|
|
/permission/{permission_id}/{role_id}/{relation}:
|
|
post:
|
|
tags:
|
|
- permission
|
|
description: |-
|
|
bind the permission to role
|
|
<br>
|
|
operationId: PermissionController.Bind
|
|
parameters:
|
|
- in: path
|
|
name: role_id
|
|
description: The role_id you want to bind
|
|
required: true
|
|
type: string
|
|
- in: path
|
|
name: method
|
|
description: The method you want to relate role & 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!'
|
|
delete:
|
|
tags:
|
|
- permission
|
|
description: |-
|
|
unbind the permission to role
|
|
<br>
|
|
operationId: PermissionController.UnBind
|
|
parameters:
|
|
- in: path
|
|
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 & permission
|
|
required: true
|
|
type: string
|
|
- in: path
|
|
name: permission_id
|
|
description: The permission_id you want to unbind
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{string} bind success!'
|
|
/permission/clear:
|
|
delete:
|
|
tags:
|
|
- permission
|
|
description: |-
|
|
clear the permission
|
|
<br>
|
|
operationId: PermissionController.Clear
|
|
responses:
|
|
"200":
|
|
description: '{string} delete success!'
|
|
/permission/role/{id}:
|
|
get:
|
|
tags:
|
|
- permission
|
|
description: |-
|
|
find permission by role id
|
|
<br>
|
|
operationId: PermissionController.GetByRole
|
|
parameters:
|
|
- in: path
|
|
name: id
|
|
description: the id you want to get
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{auth} string'
|
|
/permission/user/{id}:
|
|
get:
|
|
tags:
|
|
- permission
|
|
description: |-
|
|
find permission by user id
|
|
<br>
|
|
operationId: PermissionController.GetByUser
|
|
parameters:
|
|
- in: path
|
|
name: id
|
|
description: the id you want to get
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{auth} string'
|
|
/refresh:
|
|
post:
|
|
tags:
|
|
- oc-auth/controllersOAuthController
|
|
description: |-
|
|
introspect token
|
|
<br>
|
|
operationId: OAuthController.Introspection
|
|
parameters:
|
|
- in: body
|
|
name: body
|
|
description: The token info
|
|
required: true
|
|
schema:
|
|
$ref: '#/definitions/models.Token'
|
|
responses:
|
|
"200":
|
|
description: '{string}'
|
|
/role/:
|
|
get:
|
|
tags:
|
|
- role
|
|
description: |-
|
|
find roles
|
|
<br>
|
|
operationId: RoleController.GetAll
|
|
responses:
|
|
"200":
|
|
description: '{role} string'
|
|
/role/{id}:
|
|
get:
|
|
tags:
|
|
- role
|
|
description: |-
|
|
find role by id
|
|
<br>
|
|
operationId: RoleController.Get
|
|
parameters:
|
|
- in: path
|
|
name: id
|
|
description: the id you want to get
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{role} string'
|
|
post:
|
|
tags:
|
|
- role
|
|
description: |-
|
|
create role
|
|
<br>
|
|
operationId: RoleController.Create
|
|
parameters:
|
|
- in: path
|
|
name: id
|
|
description: the id you want to get
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{auth} create success!'
|
|
delete:
|
|
tags:
|
|
- role
|
|
description: |-
|
|
delete the role
|
|
<br>
|
|
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
|
|
<br>
|
|
operationId: RoleController.Bind
|
|
parameters:
|
|
- in: path
|
|
name: user_id
|
|
description: The user_id you want to bind
|
|
required: true
|
|
type: string
|
|
- 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
|
|
<br>
|
|
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!'
|
|
/role/clear:
|
|
delete:
|
|
tags:
|
|
- role
|
|
description: |-
|
|
clear the role
|
|
<br>
|
|
operationId: RoleController.Clear
|
|
responses:
|
|
"200":
|
|
description: '{string} delete success!'
|
|
/role/user/{id}:
|
|
get:
|
|
tags:
|
|
- role
|
|
description: |-
|
|
find role by user id
|
|
<br>
|
|
operationId: RoleController.GetByUser
|
|
parameters:
|
|
- in: path
|
|
name: id
|
|
description: the id you want to get
|
|
required: true
|
|
type: string
|
|
responses:
|
|
"200":
|
|
description: '{auth} string'
|
|
/version/:
|
|
get:
|
|
tags:
|
|
- version
|
|
description: |-
|
|
get version
|
|
<br>
|
|
operationId: VersionController.GetAll
|
|
responses:
|
|
"200":
|
|
description: ""
|
|
/version/discovery:
|
|
get:
|
|
tags:
|
|
- version
|
|
description: |-
|
|
get version
|
|
<br>
|
|
operationId: VersionController.Get
|
|
responses:
|
|
"200":
|
|
description: ""
|
|
definitions:
|
|
models.Token:
|
|
title: Token
|
|
type: object
|
|
models.workflow:
|
|
title: workflow
|
|
type: object
|
|
tags:
|
|
- name: oc-auth/controllersOAuthController
|
|
description: |
|
|
Operations about auth
|
|
- name: group
|
|
description: |
|
|
Operations about auth
|
|
- name: role
|
|
description: |
|
|
Operations about auth
|
|
- name: permission
|
|
description: |
|
|
Operations about auth
|
|
- name: version
|
|
description: |
|
|
VersionController operations for Version
|