You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

283 lines
6.5 KiB

  1. swagger: '2.0'
  2. info:
  3. description: >-
  4. This is a sample JWT authentication service. You can find out more about JWT
  5. at [https://jwt.io/](https://jwt.io/). For this sample, you can use the
  6. `admin` or `client` users (password: admin and client respectively) to test
  7. the authorization filters. Once you have successfully logged in and obtained
  8. the token, you should click on the right top button `Authorize` and
  9. introduce it with the prefix "Bearer ".
  10. version: 1.0.0
  11. title: JSON Web Token Authentication API
  12. contact:
  13. email: mauriurraco@gmail.com
  14. license:
  15. name: MIT License
  16. url: http://opensource.org/licenses/MIT
  17. host: localhost:8080
  18. basePath: /
  19. tags:
  20. - name: users
  21. description: Operations about users
  22. paths:
  23. /users/activate:
  24. post:
  25. tags:
  26. - users
  27. summary: ${UserController.activate}
  28. operationId: activateUsingPOST
  29. consumes:
  30. - application/json
  31. produces:
  32. - '*/*'
  33. parameters:
  34. - name: activationkey
  35. in: path
  36. description: ActivationKey
  37. required: false
  38. type: string
  39. - name: username
  40. in: path
  41. description: Username
  42. required: false
  43. type: string
  44. responses:
  45. '200':
  46. description: OK
  47. schema:
  48. type: string
  49. '400':
  50. description: Something went wrong
  51. '403':
  52. description: Access denied
  53. '404':
  54. description: The user doesn't exist
  55. '500':
  56. description: Expired or invalid JWT token
  57. security:
  58. - Authorization:
  59. - global
  60. - apiKey: []
  61. deprecated: false
  62. /users/me:
  63. get:
  64. tags:
  65. - users
  66. summary: ${UserController.me}
  67. operationId: whoamiUsingGET
  68. produces:
  69. - '*/*'
  70. responses:
  71. '200':
  72. description: OK
  73. schema:
  74. $ref: '#/definitions/UsersResponseDTO'
  75. '400':
  76. description: Something went wrong
  77. '403':
  78. description: Access denied
  79. '500':
  80. description: Expired or invalid JWT token
  81. security:
  82. - Authorization:
  83. - global
  84. - apiKey: []
  85. deprecated: false
  86. /users/refresh:
  87. get:
  88. tags:
  89. - users
  90. summary: refresh
  91. operationId: refreshUsingGET
  92. produces:
  93. - '*/*'
  94. responses:
  95. '200':
  96. description: OK
  97. schema:
  98. type: string
  99. security:
  100. - Authorization:
  101. - global
  102. deprecated: false
  103. /users/signin:
  104. post:
  105. tags:
  106. - users
  107. summary: ${UserController.signin}
  108. operationId: loginUsingPOST
  109. consumes:
  110. - application/json
  111. produces:
  112. - '*/*'
  113. parameters:
  114. - name: password
  115. in: query
  116. description: Password
  117. required: false
  118. type: string
  119. allowEmptyValue: false
  120. - name: username
  121. in: query
  122. description: Username
  123. required: false
  124. type: string
  125. allowEmptyValue: false
  126. responses:
  127. '200':
  128. description: OK
  129. schema:
  130. type: string
  131. '400':
  132. description: Something went wrong
  133. '422':
  134. description: Invalid username/password supplied
  135. security:
  136. - Authorization:
  137. - global
  138. deprecated: false
  139. /users/signup:
  140. post:
  141. tags:
  142. - users
  143. summary: ${UserController.signup}
  144. operationId: signupUsingPOST
  145. consumes:
  146. - application/json
  147. produces:
  148. - '*/*'
  149. parameters:
  150. - in: body
  151. name: user
  152. description: Signup User
  153. required: false
  154. schema:
  155. $ref: '#/definitions/UsersRequestDTO'
  156. responses:
  157. '200':
  158. description: OK
  159. schema:
  160. type: string
  161. '400':
  162. description: Something went wrong
  163. '403':
  164. description: Access denied
  165. '422':
  166. description: Username is already in use
  167. security:
  168. - Authorization:
  169. - global
  170. deprecated: false
  171. /users/{username}:
  172. get:
  173. tags:
  174. - users
  175. summary: ${UserController.search}
  176. operationId: searchUsingGET
  177. produces:
  178. - '*/*'
  179. parameters:
  180. - name: username
  181. in: path
  182. description: Username
  183. required: false
  184. type: string
  185. responses:
  186. '200':
  187. description: OK
  188. schema:
  189. $ref: '#/definitions/UsersResponseDTO'
  190. '400':
  191. description: Something went wrong
  192. '403':
  193. description: Access denied
  194. '404':
  195. description: The user doesn't exist
  196. '500':
  197. description: Expired or invalid JWT token
  198. security:
  199. - Authorization:
  200. - global
  201. - apiKey: []
  202. deprecated: false
  203. securityDefinitions:
  204. Authorization:
  205. type: apiKey
  206. name: Authorization
  207. in: header
  208. definitions:
  209. EduCemadenOrganizations:
  210. type: object
  211. properties:
  212. activationkey:
  213. type: string
  214. active:
  215. type: string
  216. address:
  217. type: string
  218. creation_date:
  219. type: string
  220. id:
  221. type: integer
  222. format: int32
  223. inep_code:
  224. type: string
  225. login:
  226. type: string
  227. name:
  228. type: string
  229. phone:
  230. type: string
  231. responsible:
  232. type: string
  233. type:
  234. type: string
  235. website:
  236. type: string
  237. title: EduCemadenOrganizations
  238. UsersRequestDTO:
  239. type: object
  240. properties:
  241. username:
  242. type: string
  243. password:
  244. type: string
  245. title: UsersRequestDTO
  246. UsersResponseDTO:
  247. type: object
  248. properties:
  249. id:
  250. type: integer
  251. format: int32
  252. username:
  253. type: string
  254. roles:
  255. type: array
  256. items:
  257. type: string
  258. enum:
  259. - ROLE_ADMIN
  260. - ROLE_INSTITUTION
  261. - ROLE_CLIENT
  262. eduCemadenOrganization:
  263. $ref: '#/definitions/EduCemadenOrganizations'
  264. rolesProviderActivationKeys:
  265. type: array
  266. items:
  267. $ref: '#/definitions/UsersRolesproviderActivationKey'
  268. title: UsersResponseDTO
  269. UsersRolesproviderActivationKey:
  270. type: object
  271. properties:
  272. activationkey:
  273. type: string
  274. id:
  275. type: integer
  276. format: int32
  277. rolesid:
  278. type: integer
  279. format: int32
  280. usersid:
  281. type: integer
  282. format: int32
  283. title: UsersRolesproviderActivationKey