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.

430 lines
13 KiB

  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "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 \".",
  5. "version": "1.0.0",
  6. "title": "JSON Web Token Authentication API",
  7. "contact": {
  8. "email": "mauriurraco@gmail.com"
  9. },
  10. "license": {
  11. "name": "MIT License",
  12. "url": "http://opensource.org/licenses/MIT"
  13. }
  14. },
  15. "host": "localhost:8080",
  16. "basePath": "/",
  17. "tags": [
  18. {
  19. "name": "users",
  20. "description": "Operations about users"
  21. }
  22. ],
  23. "paths": {
  24. "/users/activate": {
  25. "post": {
  26. "tags": [
  27. "users"
  28. ],
  29. "summary": "${UserController.activate}",
  30. "operationId": "activateUsingPOST",
  31. "consumes": [
  32. "application/json"
  33. ],
  34. "produces": [
  35. "*/*"
  36. ],
  37. "parameters": [
  38. {
  39. "name": "activationkey",
  40. "in": "path",
  41. "description": "ActivationKey",
  42. "required": false,
  43. "type": "string"
  44. },
  45. {
  46. "name": "username",
  47. "in": "path",
  48. "description": "Username",
  49. "required": false,
  50. "type": "string"
  51. }
  52. ],
  53. "responses": {
  54. "200": {
  55. "description": "OK",
  56. "schema": {
  57. "type": "string"
  58. }
  59. },
  60. "400": {
  61. "description": "Something went wrong"
  62. },
  63. "403": {
  64. "description": "Access denied"
  65. },
  66. "404": {
  67. "description": "The user doesn't exist"
  68. },
  69. "500": {
  70. "description": "Expired or invalid JWT token"
  71. }
  72. },
  73. "security": [
  74. {
  75. "Authorization": [
  76. "global"
  77. ]
  78. },
  79. {
  80. "apiKey": []
  81. }
  82. ],
  83. "deprecated": false
  84. }
  85. },
  86. "/users/me": {
  87. "get": {
  88. "tags": [
  89. "users"
  90. ],
  91. "summary": "${UserController.me}",
  92. "operationId": "whoamiUsingGET",
  93. "produces": [
  94. "*/*"
  95. ],
  96. "responses": {
  97. "200": {
  98. "description": "OK",
  99. "schema": {
  100. "$ref": "#/definitions/UsersResponseDTO"
  101. }
  102. },
  103. "400": {
  104. "description": "Something went wrong"
  105. },
  106. "403": {
  107. "description": "Access denied"
  108. },
  109. "500": {
  110. "description": "Expired or invalid JWT token"
  111. }
  112. },
  113. "security": [
  114. {
  115. "Authorization": [
  116. "global"
  117. ]
  118. },
  119. {
  120. "apiKey": []
  121. }
  122. ],
  123. "deprecated": false
  124. }
  125. },
  126. "/users/refresh": {
  127. "get": {
  128. "tags": [
  129. "users"
  130. ],
  131. "summary": "refresh",
  132. "operationId": "refreshUsingGET",
  133. "produces": [
  134. "*/*"
  135. ],
  136. "responses": {
  137. "200": {
  138. "description": "OK",
  139. "schema": {
  140. "type": "string"
  141. }
  142. }
  143. },
  144. "security": [
  145. {
  146. "Authorization": [
  147. "global"
  148. ]
  149. }
  150. ],
  151. "deprecated": false
  152. }
  153. },
  154. "/users/signin": {
  155. "post": {
  156. "tags": [
  157. "users"
  158. ],
  159. "summary": "${UserController.signin}",
  160. "operationId": "loginUsingPOST",
  161. "consumes": [
  162. "application/json"
  163. ],
  164. "produces": [
  165. "*/*"
  166. ],
  167. "parameters": [
  168. {
  169. "name": "password",
  170. "in": "query",
  171. "description": "Password",
  172. "required": false,
  173. "type": "string",
  174. "allowEmptyValue": false
  175. },
  176. {
  177. "name": "username",
  178. "in": "query",
  179. "description": "Username",
  180. "required": false,
  181. "type": "string",
  182. "allowEmptyValue": false
  183. }
  184. ],
  185. "responses": {
  186. "200": {
  187. "description": "OK",
  188. "schema": {
  189. "type": "string"
  190. }
  191. },
  192. "400": {
  193. "description": "Something went wrong"
  194. },
  195. "422": {
  196. "description": "Invalid username/password supplied"
  197. }
  198. },
  199. "security": [
  200. {
  201. "Authorization": [
  202. "global"
  203. ]
  204. }
  205. ],
  206. "deprecated": false
  207. }
  208. },
  209. "/users/signup": {
  210. "post": {
  211. "tags": [
  212. "users"
  213. ],
  214. "summary": "${UserController.signup}",
  215. "operationId": "signupUsingPOST",
  216. "consumes": [
  217. "application/json"
  218. ],
  219. "produces": [
  220. "*/*"
  221. ],
  222. "parameters": [
  223. {
  224. "in": "body",
  225. "name": "user",
  226. "description": "Signup User",
  227. "required": false,
  228. "schema": {
  229. "$ref": "#/definitions/UsersRequestDTO"
  230. }
  231. }
  232. ],
  233. "responses": {
  234. "200": {
  235. "description": "OK",
  236. "schema": {
  237. "type": "string"
  238. }
  239. },
  240. "400": {
  241. "description": "Something went wrong"
  242. },
  243. "403": {
  244. "description": "Access denied"
  245. },
  246. "422": {
  247. "description": "Username is already in use"
  248. }
  249. },
  250. "security": [
  251. {
  252. "Authorization": [
  253. "global"
  254. ]
  255. }
  256. ],
  257. "deprecated": false
  258. }
  259. },
  260. "/users/{username}": {
  261. "get": {
  262. "tags": [
  263. "users"
  264. ],
  265. "summary": "${UserController.search}",
  266. "operationId": "searchUsingGET",
  267. "produces": [
  268. "*/*"
  269. ],
  270. "parameters": [
  271. {
  272. "name": "username",
  273. "in": "path",
  274. "description": "Username",
  275. "required": false,
  276. "type": "string"
  277. }
  278. ],
  279. "responses": {
  280. "200": {
  281. "description": "OK",
  282. "schema": {
  283. "$ref": "#/definitions/UsersResponseDTO"
  284. }
  285. },
  286. "400": {
  287. "description": "Something went wrong"
  288. },
  289. "403": {
  290. "description": "Access denied"
  291. },
  292. "404": {
  293. "description": "The user doesn't exist"
  294. },
  295. "500": {
  296. "description": "Expired or invalid JWT token"
  297. }
  298. },
  299. "security": [
  300. {
  301. "Authorization": [
  302. "global"
  303. ]
  304. },
  305. {
  306. "apiKey": []
  307. }
  308. ],
  309. "deprecated": false
  310. }
  311. }
  312. },
  313. "securityDefinitions": {
  314. "Authorization": {
  315. "type": "apiKey",
  316. "name": "Authorization",
  317. "in": "header"
  318. }
  319. },
  320. "definitions": {
  321. "EduCemadenOrganizations": {
  322. "type": "object",
  323. "properties": {
  324. "activationkey": {
  325. "type": "string"
  326. },
  327. "active": {
  328. "type": "string"
  329. },
  330. "address": {
  331. "type": "string"
  332. },
  333. "creation_date": {
  334. "type": "string"
  335. },
  336. "id": {
  337. "type": "integer",
  338. "format": "int32"
  339. },
  340. "inep_code": {
  341. "type": "string"
  342. },
  343. "login": {
  344. "type": "string"
  345. },
  346. "name": {
  347. "type": "string"
  348. },
  349. "phone": {
  350. "type": "string"
  351. },
  352. "responsible": {
  353. "type": "string"
  354. },
  355. "type": {
  356. "type": "string"
  357. },
  358. "website": {
  359. "type": "string"
  360. }
  361. },
  362. "title": "EduCemadenOrganizations"
  363. },
  364. "UsersRequestDTO": {
  365. "type": "object",
  366. "properties": {
  367. "username": {
  368. "type": "string"
  369. },
  370. "password": {
  371. "type": "string"
  372. }
  373. },
  374. "title": "UsersRequestDTO"
  375. },
  376. "UsersResponseDTO": {
  377. "type": "object",
  378. "properties": {
  379. "id": {
  380. "type": "integer",
  381. "format": "int32"
  382. },
  383. "username": {
  384. "type": "string"
  385. },
  386. "roles": {
  387. "type": "array",
  388. "items": {
  389. "type": "string",
  390. "enum": [
  391. "ROLE_ADMIN",
  392. "ROLE_INSTITUTION",
  393. "ROLE_CLIENT"
  394. ]
  395. }
  396. },
  397. "eduCemadenOrganization": {
  398. "$ref": "#/definitions/EduCemadenOrganizations"
  399. },
  400. "rolesProviderActivationKeys": {
  401. "type": "array",
  402. "items": {
  403. "$ref": "#/definitions/UsersRolesproviderActivationKey"
  404. }
  405. }
  406. },
  407. "title": "UsersResponseDTO"
  408. },
  409. "UsersRolesproviderActivationKey": {
  410. "type": "object",
  411. "properties": {
  412. "activationkey": {
  413. "type": "string"
  414. },
  415. "id": {
  416. "type": "integer",
  417. "format": "int32"
  418. },
  419. "rolesid": {
  420. "type": "integer",
  421. "format": "int32"
  422. },
  423. "usersid": {
  424. "type": "integer",
  425. "format": "int32"
  426. }
  427. },
  428. "title": "UsersRolesproviderActivationKey"
  429. }
  430. }
  431. }