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.

501 lines
12 KiB

  1. swagger: '2.0'
  2. info:
  3. description: 'This is a sample JWT authentication service. You can find out more about JWT at [https://jwt.io/](https://jwt.io/). For this sample, you can use the `admin` or `client` users (password: admin and client respectively) to test the authorization filters. Once you have successfully logged in and obtained the token, you should click on the right top button `Authorize` and introduce it with the prefix "Bearer ".'
  4. version: 1.0.0
  5. title: The authenticator for the Waterproofing Data (WPD) Work Packages
  6. contact:
  7. email: igsd@warwick.ac.uk
  8. license:
  9. name: Apache-2.0 License
  10. url: https://opensource.org/licenses/Apache-2.0
  11. host: localhost:8080
  12. basePath: /
  13. tags:
  14. - name: forgotpasswords
  15. description: Forgot Passwords Controller
  16. - name: users
  17. description: Operations about users
  18. paths:
  19. /forgotpasswords/findallforgotpasswordquestions:
  20. get:
  21. tags:
  22. - forgotpasswords
  23. summary: ${ForgotPasswordsController.findallforgotpasswordquestions}
  24. operationId: findallforgotpasswordquestionsUsingGET
  25. produces:
  26. - '*/*'
  27. responses:
  28. '200':
  29. description: OK
  30. schema:
  31. type: array
  32. items:
  33. $ref: '#/definitions/ForgotPasswordsQuestionsResponseDTO'
  34. '400':
  35. description: Something went wrong
  36. security:
  37. - Authorization:
  38. - global
  39. deprecated: false
  40. /forgotpasswords/loginbyemailandanswers:
  41. post:
  42. tags:
  43. - forgotpasswords
  44. summary: ${ForgotPasswordsController.loginbyemailandanswers}
  45. operationId: loginbyemailandanswersUsingPOST
  46. consumes:
  47. - application/json
  48. produces:
  49. - '*/*'
  50. parameters:
  51. - name: answers
  52. in: query
  53. description: Answers
  54. required: false
  55. type: string
  56. allowEmptyValue: false
  57. - name: email
  58. in: query
  59. description: Email
  60. required: false
  61. type: string
  62. allowEmptyValue: false
  63. responses:
  64. '200':
  65. description: OK
  66. schema:
  67. type: string
  68. '400':
  69. description: Something went wrong
  70. '404':
  71. description: The user or answer don't exist
  72. '422':
  73. description: Invalid answers supplied to login. Must have at least 2 correct ones.
  74. security:
  75. - Authorization:
  76. - global
  77. deprecated: false
  78. /forgotpasswords/loginbyemailandkey:
  79. post:
  80. tags:
  81. - forgotpasswords
  82. summary: ${ForgotPasswordsController.loginbyemailandkey}
  83. operationId: loginbyemailandkeyUsingPOST
  84. consumes:
  85. - application/json
  86. produces:
  87. - '*/*'
  88. parameters:
  89. - name: email
  90. in: query
  91. description: Email
  92. required: false
  93. type: string
  94. allowEmptyValue: false
  95. - name: key
  96. in: query
  97. description: Key
  98. required: false
  99. type: string
  100. allowEmptyValue: false
  101. responses:
  102. '200':
  103. description: OK
  104. schema:
  105. type: string
  106. '400':
  107. description: Something went wrong
  108. '422':
  109. description: Invalid username/password supplied
  110. security:
  111. - Authorization:
  112. - global
  113. deprecated: false
  114. /forgotpasswords/passwordupdatebyemail:
  115. post:
  116. tags:
  117. - forgotpasswords
  118. summary: ${ForgotPasswordsController.passwordupdatebyemail}
  119. operationId: passwordupdatebyemailUsingPOST
  120. consumes:
  121. - application/json
  122. produces:
  123. - '*/*'
  124. parameters:
  125. - name: email
  126. in: query
  127. description: Email
  128. required: false
  129. type: string
  130. allowEmptyValue: false
  131. - name: newPassword
  132. in: query
  133. description: NewPassword
  134. required: false
  135. type: string
  136. allowEmptyValue: false
  137. responses:
  138. '200':
  139. description: OK
  140. '400':
  141. description: Something went wrong
  142. '403':
  143. description: Access denied
  144. '404':
  145. description: The user doesn't exist
  146. '500':
  147. description: Expired or invalid JWT token
  148. security:
  149. - Authorization:
  150. - global
  151. - apiKey: []
  152. deprecated: false
  153. /forgotpasswords/saveforgotpasswordquestionsusersanswers:
  154. post:
  155. tags:
  156. - forgotpasswords
  157. summary: ${ForgotPasswordsController.saveforgotpasswordquestionsusersanswers}
  158. operationId: saveforgotpasswordquestionsusersanswersUsingPOST
  159. consumes:
  160. - application/json
  161. produces:
  162. - '*/*'
  163. parameters:
  164. - in: body
  165. name: answer
  166. description: Forgot Password Questions Users Answers
  167. required: false
  168. schema:
  169. $ref: '#/definitions/ForgotPasswordsQuestionsUsersAnswersRequestDTO'
  170. responses:
  171. '200':
  172. description: OK
  173. '400':
  174. description: Something went wrong
  175. '403':
  176. description: Access denied
  177. '404':
  178. description: The user or forgot password questions don't exist
  179. '500':
  180. description: Expired or invalid JWT token
  181. security:
  182. - Authorization:
  183. - global
  184. - apiKey: []
  185. deprecated: false
  186. /forgotpasswords/sendkeybyemail:
  187. post:
  188. tags:
  189. - forgotpasswords
  190. summary: ${ForgotPasswordsController.sendkeybyemail}
  191. operationId: sendkeybyemailUsingPOST
  192. consumes:
  193. - application/json
  194. produces:
  195. - '*/*'
  196. parameters:
  197. - name: email
  198. in: query
  199. description: Email
  200. required: false
  201. type: string
  202. allowEmptyValue: false
  203. responses:
  204. '200':
  205. description: OK
  206. '400':
  207. description: Something went wrong
  208. '422':
  209. description: Invalid email supplied
  210. security:
  211. - Authorization:
  212. - global
  213. deprecated: false
  214. /users/activate:
  215. post:
  216. tags:
  217. - users
  218. summary: ${UserController.activate}
  219. operationId: activateUsingPOST
  220. consumes:
  221. - application/json
  222. produces:
  223. - '*/*'
  224. parameters:
  225. - name: activationkey
  226. in: path
  227. description: ActivationKey
  228. required: false
  229. type: string
  230. - name: username
  231. in: path
  232. description: Username
  233. required: false
  234. type: string
  235. responses:
  236. '200':
  237. description: OK
  238. schema:
  239. type: string
  240. '400':
  241. description: Something went wrong
  242. '403':
  243. description: Access denied
  244. '404':
  245. description: The user doesn't exist
  246. '500':
  247. description: Expired or invalid JWT token
  248. security:
  249. - Authorization:
  250. - global
  251. - apiKey: []
  252. deprecated: false
  253. /users/login:
  254. post:
  255. tags:
  256. - users
  257. summary: ${UserController.login}
  258. operationId: loginUsingPOST
  259. consumes:
  260. - application/json
  261. produces:
  262. - '*/*'
  263. parameters:
  264. - name: password
  265. in: query
  266. description: Password
  267. required: false
  268. type: string
  269. allowEmptyValue: false
  270. - name: username
  271. in: query
  272. description: Username
  273. required: false
  274. type: string
  275. allowEmptyValue: false
  276. responses:
  277. '200':
  278. description: OK
  279. schema:
  280. type: string
  281. '400':
  282. description: Something went wrong
  283. '422':
  284. description: Invalid username/password supplied
  285. security:
  286. - Authorization:
  287. - global
  288. deprecated: false
  289. /users/me:
  290. get:
  291. tags:
  292. - users
  293. summary: ${UserController.me}
  294. operationId: whoamiUsingGET
  295. produces:
  296. - '*/*'
  297. responses:
  298. '200':
  299. description: OK
  300. schema:
  301. $ref: '#/definitions/UsersResponseDTO'
  302. '400':
  303. description: Something went wrong
  304. '403':
  305. description: Access denied
  306. '500':
  307. description: Expired or invalid JWT token
  308. security:
  309. - Authorization:
  310. - global
  311. - apiKey: []
  312. deprecated: false
  313. /users/refresh:
  314. get:
  315. tags:
  316. - users
  317. summary: refresh
  318. operationId: refreshUsingGET
  319. produces:
  320. - '*/*'
  321. responses:
  322. '200':
  323. description: OK
  324. schema:
  325. type: string
  326. security:
  327. - Authorization:
  328. - global
  329. deprecated: false
  330. /users/signup:
  331. post:
  332. tags:
  333. - users
  334. summary: ${UserController.signup}
  335. operationId: signupUsingPOST
  336. consumes:
  337. - application/json
  338. produces:
  339. - '*/*'
  340. parameters:
  341. - in: body
  342. name: user
  343. description: Signup User
  344. required: false
  345. schema:
  346. $ref: '#/definitions/UsersRequestDTO'
  347. responses:
  348. '200':
  349. description: OK
  350. schema:
  351. type: string
  352. '400':
  353. description: Something went wrong
  354. '403':
  355. description: Access denied
  356. '422':
  357. description: Username is already in use
  358. security:
  359. - Authorization:
  360. - global
  361. deprecated: false
  362. /users/{username}:
  363. get:
  364. tags:
  365. - users
  366. summary: ${UserController.search}
  367. operationId: searchUsingGET
  368. produces:
  369. - '*/*'
  370. parameters:
  371. - name: username
  372. in: path
  373. description: Username
  374. required: false
  375. type: string
  376. responses:
  377. '200':
  378. description: OK
  379. schema:
  380. $ref: '#/definitions/UsersResponseDTO'
  381. '400':
  382. description: Something went wrong
  383. '403':
  384. description: Access denied
  385. '404':
  386. description: The user doesn't exist
  387. '500':
  388. description: Expired or invalid JWT token
  389. security:
  390. - Authorization:
  391. - global
  392. - apiKey: []
  393. deprecated: false
  394. securityDefinitions:
  395. Authorization:
  396. type: apiKey
  397. name: Authorization
  398. in: header
  399. definitions:
  400. EduCemadenOrganizations:
  401. type: object
  402. properties:
  403. activationkey:
  404. type: string
  405. active:
  406. type: string
  407. address:
  408. type: string
  409. creation_date:
  410. type: string
  411. id:
  412. type: integer
  413. format: int32
  414. inep_code:
  415. type: string
  416. login:
  417. type: string
  418. name:
  419. type: string
  420. phone:
  421. type: string
  422. responsible:
  423. type: string
  424. type:
  425. type: string
  426. website:
  427. type: string
  428. title: EduCemadenOrganizations
  429. ForgotPasswordsQuestionsResponseDTO:
  430. type: object
  431. properties:
  432. id:
  433. type: integer
  434. format: int32
  435. question:
  436. type: string
  437. active:
  438. type: integer
  439. format: int32
  440. title: ForgotPasswordsQuestionsResponseDTO
  441. ForgotPasswordsQuestionsUsersAnswersRequestDTO:
  442. type: object
  443. properties:
  444. id:
  445. type: integer
  446. format: int32
  447. forgotpasswordquestionsid:
  448. type: integer
  449. format: int32
  450. usersid:
  451. type: integer
  452. format: int32
  453. answer:
  454. type: string
  455. title: ForgotPasswordsQuestionsUsersAnswersRequestDTO
  456. UsersRequestDTO:
  457. type: object
  458. properties:
  459. username:
  460. type: string
  461. password:
  462. type: string
  463. title: UsersRequestDTO
  464. UsersResponseDTO:
  465. type: object
  466. properties:
  467. id:
  468. type: integer
  469. format: int32
  470. username:
  471. type: string
  472. roles:
  473. type: array
  474. items:
  475. type: string
  476. enum:
  477. - ROLE_ADMIN
  478. - ROLE_INSTITUTION
  479. - ROLE_CLIENT
  480. eduCemadenOrganization:
  481. $ref: '#/definitions/EduCemadenOrganizations'
  482. rolesProviderActivationKeys:
  483. type: array
  484. items:
  485. $ref: '#/definitions/UsersRolesproviderActivationKey'
  486. title: UsersResponseDTO
  487. UsersRolesproviderActivationKey:
  488. type: object
  489. properties:
  490. activationkey:
  491. type: string
  492. id:
  493. type: integer
  494. format: int32
  495. rolesid:
  496. type: integer
  497. format: int32
  498. usersid:
  499. type: integer
  500. format: int32
  501. title: UsersRolesproviderActivationKey