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.

489 lines
11 KiB

  1. {
  2. "swagger": "2.0",
  3. "info": {
  4. "title": "proto/users.proto",
  5. "version": "version not set"
  6. },
  7. "tags": [
  8. {
  9. "name": "Users"
  10. }
  11. ],
  12. "consumes": [
  13. "application/json"
  14. ],
  15. "produces": [
  16. "application/json"
  17. ],
  18. "paths": {
  19. "/authorize": {
  20. "post": {
  21. "operationId": "Users_Authorize",
  22. "responses": {
  23. "200": {
  24. "description": "A successful response.",
  25. "schema": {
  26. "$ref": "#/definitions/usersAuthorizeResponse"
  27. }
  28. },
  29. "default": {
  30. "description": "An unexpected error response.",
  31. "schema": {
  32. "$ref": "#/definitions/rpcStatus"
  33. }
  34. }
  35. },
  36. "parameters": [
  37. {
  38. "name": "secret",
  39. "in": "query",
  40. "required": false,
  41. "type": "string"
  42. },
  43. {
  44. "name": "token.token",
  45. "in": "query",
  46. "required": false,
  47. "type": "string"
  48. },
  49. {
  50. "name": "token.expires",
  51. "in": "query",
  52. "required": false,
  53. "type": "string",
  54. "format": "int64"
  55. }
  56. ],
  57. "tags": [
  58. "Users"
  59. ]
  60. }
  61. },
  62. "/login": {
  63. "post": {
  64. "operationId": "Users_Login",
  65. "responses": {
  66. "200": {
  67. "description": "A successful response.",
  68. "schema": {
  69. "$ref": "#/definitions/usersLoginResponse"
  70. }
  71. },
  72. "default": {
  73. "description": "An unexpected error response.",
  74. "schema": {
  75. "$ref": "#/definitions/rpcStatus"
  76. }
  77. }
  78. },
  79. "parameters": [
  80. {
  81. "name": "form.email",
  82. "in": "query",
  83. "required": false,
  84. "type": "string"
  85. },
  86. {
  87. "name": "form.password",
  88. "in": "query",
  89. "required": false,
  90. "type": "string"
  91. },
  92. {
  93. "name": "form.passwordAgain",
  94. "in": "query",
  95. "required": false,
  96. "type": "string"
  97. }
  98. ],
  99. "tags": [
  100. "Users"
  101. ]
  102. }
  103. },
  104. "/logout": {
  105. "post": {
  106. "operationId": "Users_Logout",
  107. "responses": {
  108. "200": {
  109. "description": "A successful response.",
  110. "schema": {
  111. "$ref": "#/definitions/usersLogoutResponse"
  112. }
  113. },
  114. "default": {
  115. "description": "An unexpected error response.",
  116. "schema": {
  117. "$ref": "#/definitions/rpcStatus"
  118. }
  119. }
  120. },
  121. "parameters": [
  122. {
  123. "name": "token.token",
  124. "in": "query",
  125. "required": false,
  126. "type": "string"
  127. },
  128. {
  129. "name": "token.expires",
  130. "in": "query",
  131. "required": false,
  132. "type": "string",
  133. "format": "int64"
  134. }
  135. ],
  136. "tags": [
  137. "Users"
  138. ]
  139. }
  140. },
  141. "/password/forgot": {
  142. "post": {
  143. "operationId": "Users_ResetPassword",
  144. "responses": {
  145. "200": {
  146. "description": "A successful response.",
  147. "schema": {
  148. "$ref": "#/definitions/usersResetPasswordResponse"
  149. }
  150. },
  151. "default": {
  152. "description": "An unexpected error response.",
  153. "schema": {
  154. "$ref": "#/definitions/rpcStatus"
  155. }
  156. }
  157. },
  158. "parameters": [
  159. {
  160. "name": "form.email",
  161. "in": "query",
  162. "required": false,
  163. "type": "string"
  164. },
  165. {
  166. "name": "form.password",
  167. "in": "query",
  168. "required": false,
  169. "type": "string"
  170. },
  171. {
  172. "name": "form.passwordAgain",
  173. "in": "query",
  174. "required": false,
  175. "type": "string"
  176. }
  177. ],
  178. "tags": [
  179. "Users"
  180. ]
  181. }
  182. },
  183. "/password/reset": {
  184. "post": {
  185. "operationId": "Users_ChangePassword",
  186. "responses": {
  187. "200": {
  188. "description": "A successful response.",
  189. "schema": {
  190. "$ref": "#/definitions/usersChangePasswordResponse"
  191. }
  192. },
  193. "default": {
  194. "description": "An unexpected error response.",
  195. "schema": {
  196. "$ref": "#/definitions/rpcStatus"
  197. }
  198. }
  199. },
  200. "parameters": [
  201. {
  202. "name": "token.token",
  203. "in": "query",
  204. "required": false,
  205. "type": "string"
  206. },
  207. {
  208. "name": "token.expires",
  209. "in": "query",
  210. "required": false,
  211. "type": "string",
  212. "format": "int64"
  213. },
  214. {
  215. "name": "form.email",
  216. "in": "query",
  217. "required": false,
  218. "type": "string"
  219. },
  220. {
  221. "name": "form.password",
  222. "in": "query",
  223. "required": false,
  224. "type": "string"
  225. },
  226. {
  227. "name": "form.passwordAgain",
  228. "in": "query",
  229. "required": false,
  230. "type": "string"
  231. }
  232. ],
  233. "tags": [
  234. "Users"
  235. ]
  236. }
  237. },
  238. "/register": {
  239. "post": {
  240. "operationId": "Users_Register",
  241. "responses": {
  242. "200": {
  243. "description": "A successful response.",
  244. "schema": {
  245. "$ref": "#/definitions/usersRegisterResponse"
  246. }
  247. },
  248. "default": {
  249. "description": "An unexpected error response.",
  250. "schema": {
  251. "$ref": "#/definitions/rpcStatus"
  252. }
  253. }
  254. },
  255. "parameters": [
  256. {
  257. "name": "form.email",
  258. "in": "query",
  259. "required": false,
  260. "type": "string"
  261. },
  262. {
  263. "name": "form.password",
  264. "in": "query",
  265. "required": false,
  266. "type": "string"
  267. },
  268. {
  269. "name": "form.passwordAgain",
  270. "in": "query",
  271. "required": false,
  272. "type": "string"
  273. }
  274. ],
  275. "tags": [
  276. "Users"
  277. ]
  278. }
  279. },
  280. "/roles/list": {
  281. "post": {
  282. "operationId": "Users_ListRoles",
  283. "responses": {
  284. "200": {
  285. "description": "A successful response.",
  286. "schema": {
  287. "$ref": "#/definitions/usersListRolesResponse"
  288. }
  289. },
  290. "default": {
  291. "description": "An unexpected error response.",
  292. "schema": {
  293. "$ref": "#/definitions/rpcStatus"
  294. }
  295. }
  296. },
  297. "parameters": [
  298. {
  299. "name": "secret",
  300. "in": "query",
  301. "required": false,
  302. "type": "string"
  303. }
  304. ],
  305. "tags": [
  306. "Users"
  307. ]
  308. }
  309. },
  310. "/roles/set": {
  311. "post": {
  312. "operationId": "Users_SetRoles",
  313. "responses": {
  314. "200": {
  315. "description": "A successful response.",
  316. "schema": {
  317. "$ref": "#/definitions/usersSetRolesResponse"
  318. }
  319. },
  320. "default": {
  321. "description": "An unexpected error response.",
  322. "schema": {
  323. "$ref": "#/definitions/rpcStatus"
  324. }
  325. }
  326. },
  327. "parameters": [
  328. {
  329. "name": "secret",
  330. "in": "query",
  331. "required": false,
  332. "type": "string"
  333. },
  334. {
  335. "name": "user.id",
  336. "in": "query",
  337. "required": false,
  338. "type": "string",
  339. "format": "int64"
  340. },
  341. {
  342. "name": "user.uuid",
  343. "in": "query",
  344. "required": false,
  345. "type": "string"
  346. }
  347. ],
  348. "tags": [
  349. "Users"
  350. ]
  351. }
  352. }
  353. },
  354. "definitions": {
  355. "protobufAny": {
  356. "type": "object",
  357. "properties": {
  358. "@type": {
  359. "type": "string"
  360. }
  361. },
  362. "additionalProperties": {}
  363. },
  364. "rpcStatus": {
  365. "type": "object",
  366. "properties": {
  367. "code": {
  368. "type": "integer",
  369. "format": "int32"
  370. },
  371. "message": {
  372. "type": "string"
  373. },
  374. "details": {
  375. "type": "array",
  376. "items": {
  377. "type": "object",
  378. "$ref": "#/definitions/protobufAny"
  379. }
  380. }
  381. }
  382. },
  383. "usersAuthorizeResponse": {
  384. "type": "object",
  385. "properties": {
  386. "user": {
  387. "$ref": "#/definitions/usersUserInfo"
  388. },
  389. "roles": {
  390. "type": "array",
  391. "items": {
  392. "type": "object",
  393. "$ref": "#/definitions/usersUserRole"
  394. }
  395. }
  396. }
  397. },
  398. "usersChangePasswordResponse": {
  399. "type": "object"
  400. },
  401. "usersListRolesResponse": {
  402. "type": "object",
  403. "properties": {
  404. "roles": {
  405. "type": "array",
  406. "items": {
  407. "type": "object",
  408. "$ref": "#/definitions/usersUserRole"
  409. }
  410. }
  411. }
  412. },
  413. "usersLoginResponse": {
  414. "type": "object",
  415. "properties": {
  416. "token": {
  417. "$ref": "#/definitions/usersUserToken"
  418. }
  419. }
  420. },
  421. "usersLogoutResponse": {
  422. "type": "object"
  423. },
  424. "usersRegisterResponse": {
  425. "type": "object"
  426. },
  427. "usersResetPasswordResponse": {
  428. "type": "object",
  429. "properties": {
  430. "token": {
  431. "$ref": "#/definitions/usersUserToken"
  432. }
  433. }
  434. },
  435. "usersSetRolesResponse": {
  436. "type": "object"
  437. },
  438. "usersUserForm": {
  439. "type": "object",
  440. "properties": {
  441. "email": {
  442. "type": "string"
  443. },
  444. "password": {
  445. "type": "string"
  446. },
  447. "passwordAgain": {
  448. "type": "string"
  449. }
  450. }
  451. },
  452. "usersUserInfo": {
  453. "type": "object",
  454. "properties": {
  455. "id": {
  456. "type": "string",
  457. "format": "int64"
  458. },
  459. "uuid": {
  460. "type": "string"
  461. }
  462. }
  463. },
  464. "usersUserRole": {
  465. "type": "object",
  466. "properties": {
  467. "id": {
  468. "type": "string",
  469. "format": "int64"
  470. },
  471. "name": {
  472. "type": "string"
  473. }
  474. }
  475. },
  476. "usersUserToken": {
  477. "type": "object",
  478. "properties": {
  479. "token": {
  480. "type": "string"
  481. },
  482. "expires": {
  483. "type": "string",
  484. "format": "int64"
  485. }
  486. }
  487. }
  488. }
  489. }