dc3-auth.postman_collection.json 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562
  1. {
  2. "info": {
  3. "_postman_id": "e8b40186-1a1d-4965-be86-67b818c058dd",
  4. "name": "dc3-center-auth",
  5. "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  6. },
  7. "item": [
  8. {
  9. "name": "Token",
  10. "item": [
  11. {
  12. "name": "1.生成 SALT",
  13. "request": {
  14. "method": "GET",
  15. "header": [],
  16. "url": {
  17. "raw": "http://localhost:8300/auth/token/salt?username=pnoker",
  18. "protocol": "http",
  19. "host": [
  20. "localhost"
  21. ],
  22. "port": "8300",
  23. "path": [
  24. "auth",
  25. "token",
  26. "salt"
  27. ],
  28. "query": [
  29. {
  30. "key": "username",
  31. "value": "pnoker",
  32. "description": "用户名,不为空"
  33. }
  34. ]
  35. }
  36. },
  37. "response": []
  38. },
  39. {
  40. "name": "2.生成 TOKEN",
  41. "request": {
  42. "method": "POST",
  43. "header": [],
  44. "body": {
  45. "mode": "raw",
  46. "raw": "{\n \"name\": \"pnoker\",\n \"password\": \"c99fa5218866e5443c7b23ea7ffe62af\"\n}",
  47. "options": {
  48. "raw": {
  49. "language": "json"
  50. }
  51. }
  52. },
  53. "url": {
  54. "raw": "http://localhost:8300/auth/token/generate",
  55. "protocol": "http",
  56. "host": [
  57. "localhost"
  58. ],
  59. "port": "8300",
  60. "path": [
  61. "auth",
  62. "token",
  63. "generate"
  64. ]
  65. },
  66. "description": "**说明:**\n\n - 1.用户名/密码:pnoker/10e339be1130a90dc1b9ff0332abced6\n\n - 2.生成MD5加密之后的密码:DC3Util.md5(\"10e339be1130a90dc1b9ff0332abced6\"+\"salt\"),其中salt是第一步[1.获取SALT]中获取的\n\n---\n\n**例如:**\n\n - 1.salt是:fwl6rojy63jawkfu\n\n - 2.MD5加密之后的密码是:\"eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJwbm9rZXIiLCJpc3MiOiJwbm9rZXIvZGMzLy0xIiwiaWF0IjoxNjIxODQ4MzE3LCJleHAiOjE2MjE4OTE1MTd9.ZfntzrNUtSjTiN81tODM61-2yJWhmiB8scTdD_1nT3U\""
  67. },
  68. "response": []
  69. },
  70. {
  71. "name": "3.校验 TOKEN 是否有效",
  72. "request": {
  73. "method": "GET",
  74. "header": [],
  75. "url": {
  76. "raw": "http://localhost:8300/auth/token/check?username=pnoker&salt=yf08g6on1rkdksdy&token=eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJwbm9rZXIiLCJpc3MiOiJwbm9rZXIvZGMzIiwiaWF0IjoxNjIxODUwMjMxLCJleHAiOjE2MjE4OTM0MzF9.utViU2yM5YpOblpmoh6fh996bdmEfFKg7p55xltp_go",
  77. "protocol": "http",
  78. "host": [
  79. "localhost"
  80. ],
  81. "port": "8300",
  82. "path": [
  83. "auth",
  84. "token",
  85. "check"
  86. ],
  87. "query": [
  88. {
  89. "key": "username",
  90. "value": "pnoker",
  91. "description": "用户名,不为空"
  92. },
  93. {
  94. "key": "salt",
  95. "value": "yf08g6on1rkdksdy",
  96. "description": "salt"
  97. },
  98. {
  99. "key": "token",
  100. "value": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJwbm9rZXIiLCJpc3MiOiJwbm9rZXIvZGMzIiwiaWF0IjoxNjIxODUwMjMxLCJleHAiOjE2MjE4OTM0MzF9.utViU2yM5YpOblpmoh6fh996bdmEfFKg7p55xltp_go",
  101. "description": "token"
  102. }
  103. ]
  104. }
  105. },
  106. "response": []
  107. },
  108. {
  109. "name": "4.注销 TOKE",
  110. "request": {
  111. "method": "GET",
  112. "header": [],
  113. "url": {
  114. "raw": "http://localhost:8300/auth/token/cancel?username=pnoker",
  115. "protocol": "http",
  116. "host": [
  117. "localhost"
  118. ],
  119. "port": "8300",
  120. "path": [
  121. "auth",
  122. "token",
  123. "cancel"
  124. ],
  125. "query": [
  126. {
  127. "key": "username",
  128. "value": "pnoker",
  129. "description": "用户名,不为空"
  130. }
  131. ]
  132. }
  133. },
  134. "response": []
  135. }
  136. ],
  137. "protocolProfileBehavior": {}
  138. },
  139. {
  140. "name": "BlackIp",
  141. "item": [
  142. {
  143. "name": "1.新增 BlackIp",
  144. "request": {
  145. "method": "POST",
  146. "header": [
  147. {
  148. "key": "X-Auth-Tenant-Id",
  149. "value": "-1",
  150. "description": "DC3 租户 ID",
  151. "type": "text"
  152. }
  153. ],
  154. "body": {
  155. "mode": "raw",
  156. "raw": "{\n \"ip\": \"127.0.0.2\",\n \"description\": \"测试黑名单Ip\"\n}",
  157. "options": {
  158. "raw": {
  159. "language": "json"
  160. }
  161. }
  162. },
  163. "url": {
  164. "raw": "http://localhost:8300/auth/black_ip/add",
  165. "protocol": "http",
  166. "host": [
  167. "localhost"
  168. ],
  169. "port": "8300",
  170. "path": [
  171. "auth",
  172. "black_ip",
  173. "add"
  174. ]
  175. }
  176. },
  177. "response": []
  178. },
  179. {
  180. "name": "2.修改 BlackIp",
  181. "request": {
  182. "method": "POST",
  183. "header": [
  184. {
  185. "key": "X-Auth-Tenant-Id",
  186. "value": "-1",
  187. "type": "text"
  188. }
  189. ],
  190. "body": {
  191. "mode": "raw",
  192. "raw": "{\n \"id\": 1396793287667081217,\n \"ip\": \"127.0.0.3\",\n \"enable\": false,\n \"description\": \"测试黑名单Ip\"\n}",
  193. "options": {
  194. "raw": {
  195. "language": "json"
  196. }
  197. }
  198. },
  199. "url": {
  200. "raw": "http://localhost:8300/auth/black_ip/update",
  201. "protocol": "http",
  202. "host": [
  203. "localhost"
  204. ],
  205. "port": "8300",
  206. "path": [
  207. "auth",
  208. "black_ip",
  209. "update"
  210. ]
  211. }
  212. },
  213. "response": []
  214. },
  215. {
  216. "name": "3.根据 ID 查询 BlackIp",
  217. "request": {
  218. "method": "GET",
  219. "header": [],
  220. "url": {
  221. "raw": "http://localhost:8300/auth/black_ip/id/1396793287667081217",
  222. "protocol": "http",
  223. "host": [
  224. "localhost"
  225. ],
  226. "port": "8300",
  227. "path": [
  228. "auth",
  229. "black_ip",
  230. "id",
  231. "1396793287667081217"
  232. ]
  233. }
  234. },
  235. "response": []
  236. },
  237. {
  238. "name": "4.根据 Ip 查询 BlackIp",
  239. "request": {
  240. "method": "GET",
  241. "header": [
  242. {
  243. "key": "X-Auth-Tenant-Id",
  244. "value": "-1",
  245. "type": "text"
  246. }
  247. ],
  248. "url": {
  249. "raw": "http://localhost:8300/auth/black_ip/ip/127.0.0.2",
  250. "protocol": "http",
  251. "host": [
  252. "localhost"
  253. ],
  254. "port": "8300",
  255. "path": [
  256. "auth",
  257. "black_ip",
  258. "ip",
  259. "127.0.0.2"
  260. ]
  261. }
  262. },
  263. "response": []
  264. },
  265. {
  266. "name": "5.分页查询 BlackIp",
  267. "request": {
  268. "method": "POST",
  269. "header": [
  270. {
  271. "key": "X-Auth-Tenant-Id",
  272. "value": "-1",
  273. "type": "text"
  274. }
  275. ],
  276. "body": {
  277. "mode": "raw",
  278. "raw": "{\n \"ip\": \"\",\n \"page\": {\n \"current\": 1,\n \"size\": 500,\n \"orders\": [\n {\n \"column\": \"id\",\n \"asc\": false\n }\n ]\n }\n}",
  279. "options": {
  280. "raw": {
  281. "language": "json"
  282. }
  283. }
  284. },
  285. "url": {
  286. "raw": "http://localhost:8300/auth/black_ip/list",
  287. "protocol": "http",
  288. "host": [
  289. "localhost"
  290. ],
  291. "port": "8300",
  292. "path": [
  293. "auth",
  294. "black_ip",
  295. "list"
  296. ]
  297. }
  298. },
  299. "response": []
  300. },
  301. {
  302. "name": "6.查询 BlackIp 是否存在并有效",
  303. "request": {
  304. "method": "GET",
  305. "header": [
  306. {
  307. "key": "X-Auth-Tenant-Id",
  308. "value": "-1",
  309. "type": "text"
  310. }
  311. ],
  312. "url": {
  313. "raw": "http://localhost:8300/auth/black_ip/check/127.0.0.2",
  314. "protocol": "http",
  315. "host": [
  316. "localhost"
  317. ],
  318. "port": "8300",
  319. "path": [
  320. "auth",
  321. "black_ip",
  322. "check",
  323. "127.0.0.2"
  324. ]
  325. }
  326. },
  327. "response": []
  328. },
  329. {
  330. "name": "7.根据 ID 删除 BlackIp",
  331. "request": {
  332. "method": "POST",
  333. "header": [],
  334. "url": {
  335. "raw": "http://localhost:8300/auth/black_ip/delete/1396793287667081217",
  336. "protocol": "http",
  337. "host": [
  338. "localhost"
  339. ],
  340. "port": "8300",
  341. "path": [
  342. "auth",
  343. "black_ip",
  344. "delete",
  345. "1396793287667081217"
  346. ]
  347. }
  348. },
  349. "response": []
  350. }
  351. ],
  352. "protocolProfileBehavior": {}
  353. },
  354. {
  355. "name": "User",
  356. "item": [
  357. {
  358. "name": "1.新增 User",
  359. "request": {
  360. "method": "POST",
  361. "header": [],
  362. "body": {
  363. "mode": "raw",
  364. "raw": "{\n \"name\": \"dc3\",\n \"password\": \"dc3dc3dc3\",\n \"description\": \"平台开发者账号\"\n}",
  365. "options": {
  366. "raw": {
  367. "language": "json"
  368. }
  369. }
  370. },
  371. "url": {
  372. "raw": "http://localhost:8300/auth/user/add",
  373. "protocol": "http",
  374. "host": [
  375. "localhost"
  376. ],
  377. "port": "8300",
  378. "path": [
  379. "auth",
  380. "user",
  381. "add"
  382. ]
  383. }
  384. },
  385. "response": []
  386. },
  387. {
  388. "name": "2.修改 User",
  389. "request": {
  390. "method": "POST",
  391. "header": [],
  392. "body": {
  393. "mode": "raw",
  394. "raw": "{\n \"id\": 1,\n \"password\": \"dc3dc3dc3\",\n \"enable\": true,\n \"description\": \"平台开发者账号\"\n}",
  395. "options": {
  396. "raw": {
  397. "language": "json"
  398. }
  399. }
  400. },
  401. "url": {
  402. "raw": "http://localhost:8300/auth/user/update",
  403. "protocol": "http",
  404. "host": [
  405. "localhost"
  406. ],
  407. "port": "8300",
  408. "path": [
  409. "auth",
  410. "user",
  411. "update"
  412. ]
  413. }
  414. },
  415. "response": []
  416. },
  417. {
  418. "name": "3.根据 ID 重置 User 密码",
  419. "request": {
  420. "method": "POST",
  421. "header": [],
  422. "url": {
  423. "raw": "http://localhost:8300/auth/user/reset/1397392734298013698",
  424. "protocol": "http",
  425. "host": [
  426. "localhost"
  427. ],
  428. "port": "8300",
  429. "path": [
  430. "auth",
  431. "user",
  432. "reset",
  433. "1397392734298013698"
  434. ]
  435. }
  436. },
  437. "response": []
  438. },
  439. {
  440. "name": "4.根据 ID 查询 User",
  441. "request": {
  442. "method": "GET",
  443. "header": [],
  444. "url": {
  445. "raw": "http://localhost:8300/auth/user/id/1397392734298013698",
  446. "protocol": "http",
  447. "host": [
  448. "localhost"
  449. ],
  450. "port": "8300",
  451. "path": [
  452. "auth",
  453. "user",
  454. "id",
  455. "1397392734298013698"
  456. ]
  457. }
  458. },
  459. "response": []
  460. },
  461. {
  462. "name": "5.根据 Name 查询 User",
  463. "request": {
  464. "method": "GET",
  465. "header": [],
  466. "url": {
  467. "raw": "http://localhost:8300/auth/user/name/dc3",
  468. "protocol": "http",
  469. "host": [
  470. "localhost"
  471. ],
  472. "port": "8300",
  473. "path": [
  474. "auth",
  475. "user",
  476. "name",
  477. "dc3"
  478. ]
  479. }
  480. },
  481. "response": []
  482. },
  483. {
  484. "name": "6.分页查询 User",
  485. "request": {
  486. "method": "POST",
  487. "header": [],
  488. "body": {
  489. "mode": "raw",
  490. "raw": "{\n \"name\": \"\",\n \"page\": {\n \"current\": 1,\n \"size\": 500,\n \"orders\": [\n {\n \"column\": \"id\",\n \"asc\": false\n }\n ]\n }\n}",
  491. "options": {
  492. "raw": {
  493. "language": "json"
  494. }
  495. }
  496. },
  497. "url": {
  498. "raw": "http://localhost:8300/auth/user/list",
  499. "protocol": "http",
  500. "host": [
  501. "localhost"
  502. ],
  503. "port": "8300",
  504. "path": [
  505. "auth",
  506. "user",
  507. "list"
  508. ]
  509. }
  510. },
  511. "response": []
  512. },
  513. {
  514. "name": "7.检测 User 是否存在并有效",
  515. "request": {
  516. "method": "GET",
  517. "header": [],
  518. "url": {
  519. "raw": "http://localhost:8300/auth/user/check/dc3",
  520. "protocol": "http",
  521. "host": [
  522. "localhost"
  523. ],
  524. "port": "8300",
  525. "path": [
  526. "auth",
  527. "user",
  528. "check",
  529. "dc3"
  530. ]
  531. }
  532. },
  533. "response": []
  534. },
  535. {
  536. "name": "8.根据 ID 删除 User",
  537. "request": {
  538. "method": "POST",
  539. "header": [],
  540. "url": {
  541. "raw": "http://localhost:8300/auth/user/delete/1397392734298013698",
  542. "protocol": "http",
  543. "host": [
  544. "localhost"
  545. ],
  546. "port": "8300",
  547. "path": [
  548. "auth",
  549. "user",
  550. "delete",
  551. "1397392734298013698"
  552. ]
  553. }
  554. },
  555. "response": []
  556. }
  557. ],
  558. "protocolProfileBehavior": {}
  559. }
  560. ],
  561. "protocolProfileBehavior": {}
  562. }