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.

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