plugin-dataset.json 30 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501
  1. {
  2. "basic-auth": [
  3. {
  4. "type": "consumer",
  5. "shouldValid": true,
  6. "data": {
  7. "username": "foo",
  8. "password": "bar"
  9. }
  10. },
  11. {
  12. "type": "consumer",
  13. "shouldValid": false,
  14. "data": {
  15. "username": 123,
  16. "password": "bar"
  17. }
  18. },
  19. {
  20. "type": "consumer",
  21. "shouldValid": false,
  22. "data": {
  23. "username": "foo"
  24. }
  25. },
  26. {
  27. "type": "consumer",
  28. "shouldValid": false,
  29. "data": {}
  30. },
  31. {
  32. "type": "consumer",
  33. "shouldValid": false,
  34. "data": "blah"
  35. },
  36. {
  37. "shouldValid": true,
  38. "data": {}
  39. }
  40. ],
  41. "hmac-auth": [
  42. {
  43. "shouldValid": true,
  44. "data": {}
  45. }
  46. ],
  47. "jwt-auth": [
  48. {
  49. "shouldValid": true,
  50. "data": {}
  51. }
  52. ],
  53. "key-auth": [
  54. {
  55. "shouldValid": true,
  56. "data": {}
  57. }
  58. ],
  59. "wolf-rbac": [
  60. {
  61. "shouldValid": true,
  62. "data": {}
  63. }
  64. ],
  65. "api-breaker": [
  66. {
  67. "shouldValid": true,
  68. "data": {
  69. "break_response_code": 502,
  70. "break_response_body": "{\"message\":\"breaker opened.\"}",
  71. "break_response_headers": [
  72. { "key": "Content-Type", "value": "application/json" },
  73. { "key": "Content-Type", "value": "application/json+v1" }
  74. ],
  75. "unhealthy": {
  76. "http_statuses": [500],
  77. "failures": 1
  78. },
  79. "healthy": {
  80. "http_statuses": [200],
  81. "successes": 1
  82. }
  83. }
  84. },
  85. {
  86. "shouldValid": true,
  87. "data": {
  88. "break_response_code": 502
  89. }
  90. },
  91. {
  92. "shouldValid": true,
  93. "data": {
  94. "break_response_code": 502,
  95. "healthy": {}
  96. }
  97. },
  98. {
  99. "shouldValid": true,
  100. "data": {
  101. "break_response_code": 502,
  102. "unhealthy": {}
  103. }
  104. },
  105. {
  106. "shouldValid": false,
  107. "data": {
  108. "break_response_code": 199,
  109. "unhealthy": {
  110. "http_statuses": [500, 503],
  111. "failures": 3
  112. },
  113. "healthy": {
  114. "http_statuses": [200, 206],
  115. "successes": 3
  116. }
  117. }
  118. },
  119. {
  120. "shouldValid": false,
  121. "data": {
  122. "break_response_code": 200,
  123. "max_breaker_sec": -1
  124. }
  125. },
  126. {
  127. "shouldValid": false,
  128. "data": {
  129. "break_response_code": 200,
  130. "max_breaker_sec": 40,
  131. "unhealthy": {
  132. "http_statuses": [500, 603],
  133. "failures": 3
  134. },
  135. "healthy": {
  136. "http_statuses": [200, 206],
  137. "successes": 3
  138. }
  139. }
  140. },
  141. {
  142. "shouldValid": false,
  143. "data": {
  144. "break_response_code": 500,
  145. "unhealthy": {
  146. "http_statuses": [500, 503],
  147. "failures": 3
  148. },
  149. "healthy": {
  150. "http_statuses": [206, 206],
  151. "successes": 3
  152. }
  153. }
  154. },
  155. {
  156. "shouldValid": true,
  157. "data": {
  158. "break_response_code": 599,
  159. "unhealthy": {
  160. "http_statuses": [500, 503],
  161. "failures": 3
  162. },
  163. "healthy": {
  164. "http_statuses": [200, 206],
  165. "successes": 3
  166. }
  167. }
  168. },
  169. {
  170. "shouldValid": true,
  171. "data": {
  172. "break_response_code": 502,
  173. "unhealthy": {
  174. "failures": 3
  175. },
  176. "healthy": {
  177. "successes": 3
  178. }
  179. }
  180. },
  181. {
  182. "shouldValid": true,
  183. "data": {
  184. "break_response_code": 502,
  185. "max_breaker_sec": 10,
  186. "unhealthy": {
  187. "http_statuses": [500, 503],
  188. "failures": 1
  189. },
  190. "healthy": {
  191. "successes": 3
  192. }
  193. }
  194. }
  195. ],
  196. "authz-keycloak": [
  197. {
  198. "shouldValid": true,
  199. "data": {
  200. "client_id": "foo",
  201. "token_endpoint": "https://host.domain/auth/realms/foo/protocol/openid-connect/token"
  202. }
  203. },
  204. {
  205. "shouldValid": true,
  206. "data": {
  207. "client_id": "foo",
  208. "discovery": "https://host.domain/auth/realms/foo/.well-known/uma2-configuration"
  209. }
  210. },
  211. {
  212. "shouldValid": true,
  213. "data": {
  214. "client_id": "foo",
  215. "lazy_load_paths": true,
  216. "token_endpoint": "https://host.domain/auth/realms/foo/protocol/openid-connect/token",
  217. "resource_registration_endpoint": "https://host.domain/auth/realms/foo/authz/protection/resource_set"
  218. }
  219. },
  220. {
  221. "shouldValid": true,
  222. "data": {
  223. "client_id": "foo",
  224. "lazy_load_paths": true,
  225. "discovery": "https://host.domain/auth/realms/foo/.well-known/uma2-configuration"
  226. }
  227. },
  228. {
  229. "shouldValid": true,
  230. "data": {
  231. "discovery": "https://host.domain/auth/realms/foo/.well-known/uma2-configuration",
  232. "token_endpoint": "https://host.domain/auth/realms/foo/protocol/openid-connect/token",
  233. "resource_registration_endpoint": "https://host.domain/auth/realms/foo/authz/protection/resource_set",
  234. "client_id": "University",
  235. "audience": "University",
  236. "client_secret": "secret",
  237. "grant_type": "urn:ietf:params:oauth:grant-type:uma-ticket",
  238. "policy_enforcement_mode": "ENFORCING",
  239. "permissions": ["res:customer#scopes:view"],
  240. "lazy_load_paths": false,
  241. "http_method_as_scope": false,
  242. "timeout": 1000,
  243. "ssl_verify": false,
  244. "cache_ttl_seconds": 1000,
  245. "keepalive": true,
  246. "keepalive_timeout": 10000,
  247. "keepalive_pool": 5
  248. }
  249. },
  250. {
  251. "shouldValid": false,
  252. "data": {
  253. "client_id": "foo"
  254. }
  255. },
  256. {
  257. "shouldValid": false,
  258. "data": {
  259. "discovery": "https://host.domain/auth/realms/foo/.well-known/uma2-configuration"
  260. }
  261. },
  262. {
  263. "shouldValid": false,
  264. "data": {
  265. "client_id": "foo",
  266. "token_endpoint": "https://host.domain/auth/realms/foo/protocol/openid-connect/token",
  267. "lazy_load_paths": true
  268. }
  269. }
  270. ],
  271. "batch-requests": [],
  272. "consumer-restriction": [
  273. {
  274. "shouldValid": true,
  275. "data": {
  276. "title": "whitelist",
  277. "whitelist": ["jack1", "jack2"]
  278. }
  279. },
  280. {
  281. "shouldValid": true,
  282. "data": {
  283. "whitelist": ["jack1"],
  284. "blacklist": ["jack2"]
  285. }
  286. }
  287. ],
  288. "cors": [
  289. {
  290. "shouldValid": true,
  291. "data": {
  292. "allow_origins": "*",
  293. "allow_methods": "*",
  294. "allow_headers": "*",
  295. "expose_headers": "*",
  296. "max_age": 5,
  297. "allow_credential": false
  298. }
  299. },
  300. {
  301. "shouldValid": false,
  302. "data": {
  303. "allow_origins": "",
  304. "allow_methods": "",
  305. "allow_headers": "",
  306. "expose_headers": "",
  307. "max_age": "600",
  308. "allow_credential": true
  309. }
  310. }
  311. ],
  312. "echo": [],
  313. "fault-injection": [
  314. {
  315. "shouldValid": false,
  316. "data": {
  317. "abort": {
  318. "http_status": 100,
  319. "body": "Fault Injection!\n"
  320. }
  321. }
  322. },
  323. {
  324. "shouldValid": false,
  325. "data": {
  326. "abort": {}
  327. }
  328. },
  329. {
  330. "shouldValid": false,
  331. "data": {}
  332. },
  333. {
  334. "shouldValid": false,
  335. "data": {
  336. "delay": {}
  337. }
  338. },
  339. {
  340. "shouldValid": false,
  341. "data": {
  342. "delay": {
  343. "duration": "test"
  344. }
  345. }
  346. }
  347. ],
  348. "grpc-transcode": [],
  349. "http-logger": [
  350. {
  351. "shouldValid": true,
  352. "data": {
  353. "uri": "http://127.0.0.1"
  354. }
  355. },
  356. {
  357. "shouldValid": true,
  358. "data": {
  359. "uri": "http://127.0.0.1",
  360. "auth_header": "Basic 123",
  361. "timeout": 3,
  362. "name": "http-logger",
  363. "max_retry_count": 2,
  364. "retry_delay": 2,
  365. "buffer_duration": 2,
  366. "inactive_timeout": 2,
  367. "batch_max_size": 500
  368. }
  369. },
  370. {
  371. "shouldValid": false,
  372. "data": {
  373. "auth_header": "Basic 123",
  374. "timeout": 3,
  375. "name": "http-logger",
  376. "max_retry_count": 2,
  377. "retry_delay": 2,
  378. "buffer_duration": 2,
  379. "inactive_timeout": 2,
  380. "batch_max_size": 500
  381. }
  382. }
  383. ],
  384. "ip-restriction": [
  385. {
  386. "shouldValid": true,
  387. "data": {
  388. "whitelist": ["10.255.254.0/24", "192.168.0.0/16"]
  389. }
  390. },
  391. {
  392. "shouldValid": false,
  393. "data": {
  394. "whitelist": ["10.255.256.0/24", "192.168.0.0/16"]
  395. }
  396. },
  397. {
  398. "shouldValid": false,
  399. "data": {
  400. "whitelist": ["10.255.254.0/38", "192.168.0.0/16"]
  401. }
  402. },
  403. {
  404. "shouldValid": false,
  405. "data": {}
  406. },
  407. {
  408. "shouldValid": false,
  409. "data": {
  410. "blacklist": []
  411. }
  412. },
  413. {
  414. "shouldValid": false,
  415. "data": {
  416. "whitelist": ["172.17.40.0/24"],
  417. "blacklist": ["10.255.0.0/16"]
  418. }
  419. },
  420. {
  421. "shouldValid": true,
  422. "data": {
  423. "blacklist": ["::1", "fe80::/32"]
  424. }
  425. }
  426. ],
  427. "kafka-logger": [
  428. {
  429. "shouldValid": true,
  430. "data": {
  431. "kafka_topic": "test",
  432. "key": "key1",
  433. "broker_list": {
  434. "127.0.0.1": 3
  435. }
  436. }
  437. },
  438. {
  439. "shouldValid": false,
  440. "data": {
  441. "kafka_topic": "test",
  442. "key": "key1"
  443. }
  444. },
  445. {
  446. "shouldValid": false,
  447. "data": {
  448. "kafka_topic": "test",
  449. "key": "key1",
  450. "broker_list": {
  451. "127.0.0.1": 3000
  452. },
  453. "timeout": "10"
  454. }
  455. }
  456. ],
  457. "limit-conn": [
  458. {
  459. "shouldValid": true,
  460. "data": {
  461. "conn": 1,
  462. "burst": 0,
  463. "default_conn_delay": 0.1,
  464. "key": "remote_addr"
  465. }
  466. },
  467. {
  468. "shouldValid": false,
  469. "data": {
  470. "conn": 1,
  471. "default_conn_delay": 0.1,
  472. "key": "remote_addr"
  473. }
  474. },
  475. {
  476. "shouldValid": false,
  477. "data": {
  478. "conn": 1,
  479. "burst": -1,
  480. "default_conn_delay": 0.1,
  481. "key": "remote_addr"
  482. }
  483. },
  484. {
  485. "shouldValid": false,
  486. "data": {
  487. "conn": -1,
  488. "burst": 1,
  489. "default_conn_delay": 0.1,
  490. "key": "remote_addr"
  491. }
  492. },
  493. {
  494. "shouldValid": false,
  495. "data": {
  496. "conn": 100,
  497. "burst": 50,
  498. "default_conn_delay": -1,
  499. "key": "server_addr"
  500. }
  501. },
  502. {
  503. "shouldValid": true,
  504. "data": {
  505. "conn": 5,
  506. "burst": 1,
  507. "default_conn_delay": 0.1,
  508. "key": "consumer_name"
  509. }
  510. },
  511. {
  512. "shouldValid": true,
  513. "data": {
  514. "conn": 5,
  515. "burst": 1,
  516. "default_conn_delay": 0.1,
  517. "rejected_code": 503,
  518. "key": "http_x_real_ip"
  519. }
  520. },
  521. {
  522. "shouldValid": true,
  523. "data": {
  524. "conn": 5,
  525. "burst": 1,
  526. "default_conn_delay": 0.1,
  527. "rejected_code": 503,
  528. "key": "http_x_forwarded_for"
  529. }
  530. },
  531. {
  532. "shouldValid": true,
  533. "data": {
  534. "conn": 5,
  535. "burst": 1,
  536. "default_conn_delay": 0.1,
  537. "key": "remote_addr"
  538. }
  539. },
  540. {
  541. "shouldValid": true,
  542. "data": {
  543. "conn": 5,
  544. "burst": 1,
  545. "default_conn_delay": 0.1,
  546. "key": "server_addr"
  547. }
  548. },
  549. {
  550. "shouldValid": true,
  551. "data": {
  552. "conn": 5,
  553. "burst": 1,
  554. "default_conn_delay": 0.1,
  555. "key": "server_addr",
  556. "rejected_code": 503,
  557. "rejected_msg": "test"
  558. }
  559. },
  560. {
  561. "shouldValid": false,
  562. "data": {
  563. "conn": 5,
  564. "burst": 1,
  565. "default_conn_delay": 0.1,
  566. "key": "server_addr",
  567. "rejected_code": 600
  568. }
  569. },
  570. {
  571. "shouldValid": false,
  572. "data": {
  573. "conn": 5,
  574. "burst": 1,
  575. "default_conn_delay": 0.1,
  576. "key": "server_addr",
  577. "rejected_msg": ""
  578. }
  579. },
  580. {
  581. "shouldValid": false,
  582. "data": {
  583. "conn": 5,
  584. "burst": 1,
  585. "default_conn_delay": 0.1,
  586. "key": "server_addr",
  587. "allow_degradation": 1
  588. }
  589. }
  590. ],
  591. "limit-count": [
  592. {
  593. "shouldValid": true,
  594. "data": {
  595. "count": 2,
  596. "time_window": 60,
  597. "rejected_code": 503,
  598. "key": "remote_addr",
  599. "policy": "local"
  600. }
  601. },
  602. {
  603. "shouldValid": true,
  604. "data": {
  605. "count": 2,
  606. "time_window": 60,
  607. "rejected_code": 503,
  608. "key": "host",
  609. "policy": "local"
  610. }
  611. },
  612. {
  613. "shouldValid": false,
  614. "data": {
  615. "time_window": 60,
  616. "rejected_code": 503,
  617. "policy": "local"
  618. }
  619. },
  620. {
  621. "shouldValid": false,
  622. "data": {
  623. "count": -100,
  624. "time_window": 60,
  625. "rejected_code": 503,
  626. "key": "remote_addr",
  627. "policy": "local"
  628. }
  629. },
  630. {
  631. "shouldValid": true,
  632. "data": {
  633. "count": 2,
  634. "time_window": 60,
  635. "rejected_code": 503,
  636. "key": "server_addr",
  637. "policy": "local"
  638. }
  639. },
  640. {
  641. "shouldValid": true,
  642. "data": {
  643. "count": 2,
  644. "time_window": 60,
  645. "key": "remote_addr",
  646. "policy": "local"
  647. }
  648. }
  649. ],
  650. "limit-req": [
  651. {
  652. "shouldValid": true,
  653. "data": {
  654. "rate": 1,
  655. "burst": 0,
  656. "rejected_code": 503,
  657. "key": "remote_addr"
  658. }
  659. },
  660. {
  661. "shouldValid": false,
  662. "data": {
  663. "burst": 0,
  664. "rejected_code": 503,
  665. "key": "remote_addr"
  666. }
  667. },
  668. {
  669. "shouldValid": false,
  670. "data": {
  671. "rate": -1,
  672. "burst": 0.1,
  673. "rejected_code": 503,
  674. "key": "remote_addr"
  675. }
  676. },
  677. {
  678. "shouldValid": true,
  679. "data": {
  680. "rate": 1,
  681. "burst": 0,
  682. "key": "remote_addr"
  683. }
  684. }
  685. ],
  686. "openid-connect": [
  687. {
  688. "shouldValid": true,
  689. "data": {
  690. "client_id": "a",
  691. "client_secret": "b",
  692. "discovery": "c"
  693. }
  694. },
  695. {
  696. "shouldValid": false,
  697. "data": {
  698. "client_secret": "b",
  699. "discovery": "c"
  700. }
  701. },
  702. {
  703. "shouldValid": false,
  704. "data": {
  705. "client_id": 123,
  706. "client_secret": "b",
  707. "discovery": "c"
  708. }
  709. },
  710. {
  711. "shouldValid": true,
  712. "data": {
  713. "client_id": "kbyuFDidLLm280LIwVFiazOqjO3ty8KH",
  714. "client_secret": "60Op4HFM0I8ajz0WdiStAbziZ-VFQttXuxixHHs2R7r7-CW8GR79l-mmLqMhc-Sa",
  715. "discovery": "http://127.0.0.1:1980/.well-known/openid-configuration",
  716. "redirect_uri": "https://iresty.com",
  717. "ssl_verify": false,
  718. "timeout": 10,
  719. "scope": "apisix"
  720. }
  721. },
  722. {
  723. "shouldValid": true,
  724. "data": {
  725. "discovery": "http://127.0.0.1:8090/auth/realms/University/.well-known/openid-configuration",
  726. "realm": "University",
  727. "client_id": "course_management",
  728. "client_secret": "d1ec69e9-55d2-4109-a3ea-befa071579d5",
  729. "redirect_uri": "http://127.0.0.1:]] .. ngx.var.server_port .. [[/authenticated",
  730. "ssl_verify": false,
  731. "timeout": 10,
  732. "introspection_endpoint_auth_method": "client_secret_post",
  733. "introspection_endpoint": "http://127.0.0.1:8090/auth/realms/University/protocol/openid-connect/token/introspect",
  734. "set_access_token_header": true,
  735. "access_token_in_authorization_header": false,
  736. "set_id_token_header": true,
  737. "set_userinfo_header": true
  738. }
  739. },
  740. {
  741. "shouldValid": true,
  742. "data": {
  743. "client_id": "kbyuFDidLLm280LIwVFiazOqjO3ty8KH",
  744. "client_secret": "60Op4HFM0I8ajz0WdiStAbziZ-VFQttXuxixHHs2R7r7-CW8GR79l-mmLqMhc-Sa",
  745. "discovery": "https://samples.auth0.com/.well-known/openid-configuration",
  746. "redirect_uri": "https://iresty.com",
  747. "ssl_verify": false,
  748. "timeout": 10,
  749. "bearer_only": true,
  750. "scope": "apisix"
  751. }
  752. }
  753. ],
  754. "prometheus": [
  755. {
  756. "shouldValid": true,
  757. "data": {}
  758. },
  759. {
  760. "shouldValid": true,
  761. "data": {
  762. "invalid": "invalid"
  763. }
  764. },
  765. {
  766. "shouldValid": true,
  767. "data": {
  768. "invalid_property": 1
  769. }
  770. }
  771. ],
  772. "proxy-cache": [
  773. {
  774. "shouldValid": true,
  775. "data": {
  776. "cache_bypass": ["$arg_bypass"],
  777. "cache_method": ["GET"],
  778. "cache_http_status": [200],
  779. "hide_cache_headers": true,
  780. "no_cache": ["$arg_no_cache"]
  781. }
  782. },
  783. {
  784. "shouldValid": false,
  785. "data": {
  786. "cache_zone": "disk_cache_one",
  787. "cache_bypass": ["$arg_bypass"],
  788. "cache_method": "GET",
  789. "cache_http_status": [200],
  790. "hide_cache_headers": true,
  791. "no_cache": ["$arg_no_cache"]
  792. }
  793. },
  794. {
  795. "shouldValid": false,
  796. "data": {
  797. "cache_zone": "disk_cache_one",
  798. "cache_key": "${uri}-cache-key",
  799. "cache_bypass": ["$arg_bypass"],
  800. "cache_method": ["GET"],
  801. "cache_http_status": [200],
  802. "hide_cache_headers": true,
  803. "no_cache": ["$arg_no_cache"]
  804. }
  805. },
  806. {
  807. "shouldValid": false,
  808. "data": {
  809. "cache_zone": "disk_cache_one",
  810. "cache_bypass": "$arg_bypass",
  811. "cache_method": ["GET"],
  812. "cache_http_status": [200],
  813. "hide_cache_headers": true,
  814. "no_cache": ["$arg_no_cache"]
  815. }
  816. },
  817. {
  818. "shouldValid": false,
  819. "data": {
  820. "cache_zone": "disk_cache_one",
  821. "cache_bypass": ["$arg_bypass"],
  822. "cache_method": ["GET"],
  823. "cache_http_status": [200],
  824. "hide_cache_headers": true,
  825. "no_cache": "$arg_no_cache"
  826. }
  827. },
  828. {
  829. "shouldValid": false,
  830. "data": {
  831. "cache_zone": "disk_cache_one",
  832. "cache_key": ["$uri-", "-cache-id"],
  833. "cache_bypass": ["$arg_bypass"],
  834. "cache_method": ["GET"],
  835. "cache_http_status": [200],
  836. "hide_cache_headers": true,
  837. "no_cache": ["$arg_no_cache"]
  838. }
  839. },
  840. {
  841. "shouldValid": true,
  842. "data": {
  843. "cache_zone": "disk_cache_one",
  844. "cache_bypass": ["$arg_bypass"],
  845. "cache_method": ["GET"],
  846. "cache_http_status": [200],
  847. "hide_cache_headers": true,
  848. "no_cache": ["$arg_no_cache"]
  849. }
  850. },
  851. {
  852. "shouldValid": true,
  853. "data": {
  854. "cache_zone": "disk_cache_one",
  855. "cache_bypass": ["$arg_bypass"],
  856. "cache_method": ["GET"],
  857. "cache_http_status": [200],
  858. "hide_cache_headers": false,
  859. "no_cache": ["$arg_no_cache"]
  860. }
  861. }
  862. ],
  863. "proxy-mirror": [
  864. {
  865. "shouldValid": true,
  866. "data": {
  867. "host": "http://127.0.0.1"
  868. }
  869. },
  870. {
  871. "shouldValid": false,
  872. "data": {
  873. "host": "127.0.0.1:1999"
  874. }
  875. },
  876. {
  877. "shouldValid": false,
  878. "data": {
  879. "host": "http://127.0.0.1:1999/invalid_uri"
  880. }
  881. },
  882. {
  883. "shouldValid": true,
  884. "data": {
  885. "host": "http://127.0.0.1",
  886. "sample_ratio": 0.1
  887. }
  888. },
  889. {
  890. "shouldValid": false,
  891. "data": {
  892. "host": "http://127.0.0.1",
  893. "sample_ratio": 2
  894. }
  895. }
  896. ],
  897. "proxy-rewrite": [
  898. {
  899. "shouldValid": true,
  900. "data": {
  901. "uri": "/apisix/home",
  902. "host": "apisix.apache.org"
  903. }
  904. },
  905. {
  906. "shouldValid": true,
  907. "data": {
  908. "uri": "/uri/plugin_proxy_rewrite",
  909. "headers": {
  910. "X-Api-Version": "v2"
  911. }
  912. }
  913. },
  914. {
  915. "shouldValid": true,
  916. "data": {
  917. "regex_uri": ["^/test/(.*)/(.*)/(.*)", "/$1_$2_$3"]
  918. }
  919. },
  920. {
  921. "shouldValid": true,
  922. "data": {
  923. "uri": "/hello",
  924. "regex_uri": ["^/test/(.*)", "/${1}1"]
  925. }
  926. },
  927. {
  928. "shouldValid": false,
  929. "data": {
  930. "uri": "home"
  931. }
  932. },
  933. {
  934. "shouldValid": true,
  935. "data": {
  936. "uri": "/apisix/home",
  937. "host": "apisix.apache.org",
  938. "scheme": "http",
  939. "invalid_att": "invalid"
  940. }
  941. },
  942. {
  943. "shouldValid": true,
  944. "data": {
  945. "uri": "/uri",
  946. "headers": {
  947. "x-api": "$remote_addr",
  948. "name": "$arg_name",
  949. "x-key": "$http_key"
  950. }
  951. }
  952. }
  953. ],
  954. "redirect": [
  955. {
  956. "shouldValid": true,
  957. "data": {
  958. "ret_code": 302,
  959. "uri": "/foo"
  960. }
  961. },
  962. {
  963. "shouldValid": true,
  964. "data": {
  965. "uri": "/foo"
  966. }
  967. },
  968. {
  969. "shouldValid": true,
  970. "data": {
  971. "uri": "$uri/test/a${arg_name}c",
  972. "ret_code": 302
  973. }
  974. },
  975. {
  976. "shouldValid": true,
  977. "data": {
  978. "uri": "/foo$$uri",
  979. "ret_code": 302
  980. }
  981. },
  982. {
  983. "shouldValid": true,
  984. "data": {
  985. "uri": "\\$uri/foo$uri\\$uri/bar",
  986. "ret_code": 301
  987. }
  988. },
  989. {
  990. "shouldValid": true,
  991. "data": {
  992. "uri": "https://$host$request_uri",
  993. "ret_code": 301
  994. }
  995. },
  996. {
  997. "shouldValid": true,
  998. "data": {
  999. "http_to_https": true
  1000. }
  1001. },
  1002. {
  1003. "shouldValid": true,
  1004. "data": {
  1005. "http_to_https": true,
  1006. "ret_code": 302
  1007. }
  1008. }
  1009. ],
  1010. "referer-restriction": [
  1011. {
  1012. "shouldValid": true,
  1013. "data": {
  1014. "whitelist": ["*.xx.com", "yy.com"]
  1015. }
  1016. },
  1017. {
  1018. "shouldValid": true,
  1019. "data": {
  1020. "bypass_missing": true,
  1021. "whitelist": ["*.xx.com", "yy.com"]
  1022. }
  1023. },
  1024. {
  1025. "shouldValid": false,
  1026. "data": {
  1027. "whitelist": ["*.xx.com", "yy.com"],
  1028. "message": ""
  1029. }
  1030. },
  1031. {
  1032. "shouldValid": false,
  1033. "data": {
  1034. "whitelist": ["*.xx.com", "yy.com"],
  1035. "blacklist": ["*.xx.com", "yy.com"]
  1036. }
  1037. }
  1038. ],
  1039. "request-id": [
  1040. {
  1041. "shouldValid": true,
  1042. "data": {}
  1043. },
  1044. {
  1045. "shouldValid": false,
  1046. "data": {
  1047. "include_in_response": "bad_type"
  1048. }
  1049. },
  1050. {
  1051. "shouldValid": true,
  1052. "data": {
  1053. "header_name": "Custom-Header-Name"
  1054. }
  1055. },
  1056. {
  1057. "shouldValid": true,
  1058. "data": {
  1059. "include_in_response": true
  1060. }
  1061. }
  1062. ],
  1063. "response-rewrite": [
  1064. {
  1065. "shouldValid": true,
  1066. "data": {
  1067. "body": "Hello world",
  1068. "headers": {
  1069. "X-Server-id": 3
  1070. }
  1071. }
  1072. },
  1073. {
  1074. "shouldValid": false,
  1075. "data": {
  1076. "status_code": 599
  1077. }
  1078. },
  1079. {
  1080. "shouldValid": false,
  1081. "data": {
  1082. "body": 2,
  1083. "headers": {
  1084. "X-Server-id": "3"
  1085. }
  1086. }
  1087. },
  1088. {
  1089. "shouldValid": true,
  1090. "data": {
  1091. "headers": {
  1092. "X-Server-id": 3,
  1093. "X-Server-status": "on",
  1094. "Content-Type": ""
  1095. },
  1096. "body": "new body\n"
  1097. }
  1098. },
  1099. {
  1100. "shouldValid": true,
  1101. "data": {
  1102. "body": "new body2\n"
  1103. }
  1104. },
  1105. {
  1106. "shouldValid": true,
  1107. "data": {
  1108. "headers": {
  1109. "Location": "https://www.apache.org"
  1110. },
  1111. "status_code": 302
  1112. }
  1113. },
  1114. {
  1115. "shouldValid": true,
  1116. "data": {
  1117. "body": "SGVsbG8K",
  1118. "body_base64": true
  1119. }
  1120. },
  1121. {
  1122. "shouldValid": true,
  1123. "data": {
  1124. "body": "1",
  1125. "body_base64": true
  1126. }
  1127. },
  1128. {
  1129. "shouldValid": true,
  1130. "data": {
  1131. "headers": {
  1132. "X-Server-id": 3,
  1133. "X-Server-status": "on",
  1134. "Content-Type": ""
  1135. },
  1136. "body": "new body\n"
  1137. }
  1138. },
  1139. {
  1140. "shouldValid": true,
  1141. "data": {
  1142. "body": "Hello world",
  1143. "headers": {
  1144. "X-Server-id": 3
  1145. },
  1146. "invalid_att": "invalid"
  1147. }
  1148. }
  1149. ],
  1150. "serverless-post-function": [],
  1151. "serverless-pre-function": [],
  1152. "sls-logger": [
  1153. {
  1154. "shouldValid": true,
  1155. "data": {
  1156. "host": "cn-zhangjiakou-intranet.log.aliyuncs.com",
  1157. "port": 10009,
  1158. "project": "your-project",
  1159. "logstore": "your-logstore",
  1160. "access_key_id": "your_access_key",
  1161. "access_key_secret": "your_access_secret"
  1162. }
  1163. },
  1164. {
  1165. "shouldValid": false,
  1166. "data": {
  1167. "host": "cn-zhangjiakou-intranet.log.aliyuncs.com",
  1168. "port": 10009,
  1169. "project": "your-project",
  1170. "logstore": "your-logstore",
  1171. "access_key_id": "your_access_key",
  1172. "access_key_secret": "your_access_secret",
  1173. "timeout": "10"
  1174. }
  1175. },
  1176. {
  1177. "shouldValid": true,
  1178. "data": {
  1179. "host": "100.100.99.135",
  1180. "port": 10009,
  1181. "project": "your_project",
  1182. "logstore": "your_logstore",
  1183. "access_key_id": "your_access_key_id",
  1184. "access_key_secret": "your_access_key_secret",
  1185. "timeout": 30000
  1186. }
  1187. }
  1188. ],
  1189. "syslog": [
  1190. {
  1191. "shouldValid": true,
  1192. "data": {
  1193. "host": "127.0.0.1",
  1194. "port": 3000
  1195. }
  1196. },
  1197. {
  1198. "shouldValid": false,
  1199. "data": { "host": "127.0.0.1" }
  1200. },
  1201. {
  1202. "shouldValid": false,
  1203. "data": {
  1204. "host": "127.0.0.1",
  1205. "port": "3000"
  1206. }
  1207. },
  1208. {
  1209. "shouldValid": true,
  1210. "data": {
  1211. "host": "127.0.0.1",
  1212. "port": 5044
  1213. }
  1214. },
  1215. {
  1216. "shouldValid": true,
  1217. "data": {
  1218. "host": "127.0.0.1",
  1219. "port": 5044,
  1220. "flush_limit": 1,
  1221. "timeout": 1
  1222. }
  1223. },
  1224. {
  1225. "shouldValid": true,
  1226. "data": {
  1227. "host": "127.0.0.1",
  1228. "port": 5044,
  1229. "batch_max_size": 1
  1230. }
  1231. }
  1232. ],
  1233. "tcp-logger": [
  1234. {
  1235. "shouldValid": true,
  1236. "data": { "host": "127.0.0.1", "port": 3000 }
  1237. },
  1238. {
  1239. "shouldValid": false,
  1240. "data": { "port": 3000 }
  1241. },
  1242. {
  1243. "shouldValid": false,
  1244. "data": {
  1245. "host": "127.0.0.1",
  1246. "port": 2000,
  1247. "timeout": "10",
  1248. "tls": false,
  1249. "tls_options": "tls options"
  1250. }
  1251. },
  1252. {
  1253. "shouldValid": true,
  1254. "data": {
  1255. "host": "127.0.0.1",
  1256. "port": 5044,
  1257. "tls": false
  1258. }
  1259. },
  1260. {
  1261. "shouldValid": true,
  1262. "data": {
  1263. "host": "312.0.0.1",
  1264. "port": 2000,
  1265. "batch_max_size": 1,
  1266. "max_retry_count": 2,
  1267. "retry_delay": 0
  1268. }
  1269. },
  1270. {
  1271. "shouldValid": true,
  1272. "data": {
  1273. "host": "127.0.0.1",
  1274. "port": 5044,
  1275. "tls": false,
  1276. "batch_max_size": 1
  1277. }
  1278. }
  1279. ],
  1280. "traffic-split": [
  1281. {
  1282. "shouldValid": true,
  1283. "data": {
  1284. "rules": [
  1285. {
  1286. "match": [
  1287. {
  1288. "vars": [
  1289. ["arg_name", "==", "jack"],
  1290. ["arg_age", "!", "<", "16"]
  1291. ]
  1292. },
  1293. {
  1294. "vars": [
  1295. ["arg_name", "==", "rose"],
  1296. ["arg_age", "!", ">", "32"]
  1297. ]
  1298. }
  1299. ],
  1300. "weighted_upstreams": [
  1301. {
  1302. "upstream": {
  1303. "name": "upstream_A",
  1304. "type": "roundrobin",
  1305. "nodes": { "127.0.0.1:1981": 2 },
  1306. "timeout": { "connect": 15, "send": 15, "read": 15 }
  1307. },
  1308. "weight": 2
  1309. },
  1310. {
  1311. "upstream": {
  1312. "name": "upstream_B",
  1313. "type": "roundrobin",
  1314. "nodes": { "127.0.0.1:1982": 2 },
  1315. "timeout": { "connect": 15, "send": 15, "read": 15 }
  1316. },
  1317. "weight": 2
  1318. },
  1319. {
  1320. "weight": 1
  1321. }
  1322. ]
  1323. }
  1324. ]
  1325. }
  1326. },
  1327. {
  1328. "shouldValid": true,
  1329. "data": {
  1330. "rules": [
  1331. {
  1332. "weighted_upstreams": [
  1333. {
  1334. "upstream": {
  1335. "name": "upstream_A",
  1336. "type": "roundrobin",
  1337. "nodes": { "127.0.0.1:1981": 2 },
  1338. "timeout": { "connect": 15, "send": 15, "read": 15 }
  1339. },
  1340. "weight": 2
  1341. },
  1342. {
  1343. "weight": 1
  1344. }
  1345. ]
  1346. }
  1347. ]
  1348. }
  1349. },
  1350. {
  1351. "shouldValid": true,
  1352. "data": {
  1353. "rules": [
  1354. {
  1355. "match": [
  1356. {
  1357. "vars": ["arg_name", 123, "jack"]
  1358. }
  1359. ],
  1360. "weighted_upstreams": [
  1361. {
  1362. "upstream": {
  1363. "name": "upstream_A",
  1364. "type": "roundrobin",
  1365. "nodes": {
  1366. "127.0.0.1:1981": 2
  1367. },
  1368. "timeout": { "connect": 15, "send": 15, "read": 15 }
  1369. },
  1370. "weight": 2
  1371. },
  1372. {
  1373. "weight": 1
  1374. }
  1375. ]
  1376. }
  1377. ]
  1378. }
  1379. }
  1380. ],
  1381. "udp-logger": [
  1382. {
  1383. "shouldValid": true,
  1384. "data": { "host": "127.0.0.1", "port": 3000 }
  1385. },
  1386. {
  1387. "shouldValid": false,
  1388. "data": { "port": 3000 }
  1389. },
  1390. {
  1391. "shouldValid": false,
  1392. "data": { "host": "127.0.0.1", "port": 3000, "timeout": "10" }
  1393. }
  1394. ],
  1395. "uri-blocker": [
  1396. {
  1397. "shouldValid": true,
  1398. "data": {
  1399. "block_rules": [".+("]
  1400. }
  1401. },
  1402. {
  1403. "shouldValid": true,
  1404. "data": {
  1405. "block_rules": ["^a", "^b"]
  1406. }
  1407. },
  1408. {
  1409. "shouldValid": true,
  1410. "data": {
  1411. "block_rules": ["aa"]
  1412. }
  1413. },
  1414. {
  1415. "shouldValid": true,
  1416. "data": {
  1417. "block_rules": ["aa"],
  1418. "case_insensitive": true
  1419. }
  1420. }
  1421. ],
  1422. "zipkin": [
  1423. {
  1424. "shouldValid": true,
  1425. "data": {
  1426. "endpoint": "http://127.0.0.1",
  1427. "sample_ratio": 0.001
  1428. }
  1429. },
  1430. {
  1431. "shouldValid": false,
  1432. "data": {
  1433. "endpoint": "http://127.0.0.1",
  1434. "sample_ratio": -0.1
  1435. }
  1436. },
  1437. {
  1438. "shouldValid": false,
  1439. "data": {
  1440. "endpoint": "http://127.0.0.1",
  1441. "sample_ratio": 2
  1442. }
  1443. }
  1444. ],
  1445. "request-validation": [
  1446. {
  1447. "shouldValid": true,
  1448. "data": {
  1449. "body_schema": {}
  1450. }
  1451. },
  1452. {
  1453. "shouldValid": false,
  1454. "data": {}
  1455. },
  1456. {
  1457. "shouldValid": true,
  1458. "data": {
  1459. "body_schema": {
  1460. "type": "object",
  1461. "required": ["required_payload"],
  1462. "properties": {
  1463. "required_payload": { "type": "string" },
  1464. "boolean_payload": { "type": "boolean" },
  1465. "timeouts": {
  1466. "type": "integer",
  1467. "minimum": 1,
  1468. "maximum": 254,
  1469. "default": 3
  1470. },
  1471. "req_headers": {
  1472. "type": "array",
  1473. "minItems": 1,
  1474. "items": {
  1475. "type": "string"
  1476. }
  1477. }
  1478. }
  1479. }
  1480. }
  1481. }
  1482. ],
  1483. "mqtt-proxy": [],
  1484. "dubbo-proxy": [
  1485. {
  1486. "shouldValid": true,
  1487. "data": {
  1488. "service_name": "org.apache.dubbo.backend.DemoService",
  1489. "service_version": "0.0.0",
  1490. "method": "hello"
  1491. }
  1492. },
  1493. {
  1494. "shouldValid": false,
  1495. "data": {
  1496. "service_name": "org.apache.dubbo.backend.DemoService",
  1497. "method": "hello"
  1498. }
  1499. }
  1500. ]
  1501. }