From cd38f59e304ea05781e9d183156853b244db249d Mon Sep 17 00:00:00 2001 From: JTrancender Date: Thu, 21 Jan 2021 17:57:20 +0800 Subject: [PATCH] perf: merge upstream (#1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: remote_addrs (#948) * test: fix CI unstable (E2E) (#953) * test: e2e test chash upstream hash on (consumer, header, cookie) (#936) related #908 * fix: hack to fix the checking of `remote_addrs` (#952) * fix: hack to fix the checking of `remote_addrs` * fix: use correct method to get object's length (#957) * fix: use correct method to get object's length * api(conf/conf.yaml): aligned comments (#969) * fix: increase the sleep time to fix e2e test unstable issue (#976) * feat: support disable property for json schema according to APISIX's change (#904) * feat: support disable property for json schema according to APISIX's change * feat: add etcd basic auth support (#951) * add etcd basic auth support * test: e2e test balancer (roundrobin upstream) (#972) close #988 * test: e2e test chash upstream with key (wrong key, vars) (#971) close #993 * fix: fix router name conflict in route_service_upstream_test.go. * fix(Plugin): use codemirror instead of form in plugin module (#898) * feat(plugin): added code mirror * chore: format codes * feat(Plugin): remove a7 plugin * feat(Plugin): remove @api7-dashboard/plugin * feat: added codes format * feat: use local icon files * feat: update ASF Release cfg * feat: update ASF Release cfg * feat(CI): supoort markdown links checker (#981) * fix: English spelling (#1002) * docs: optimize metrics document (#970) * docs: optimize metrics document * docs: modified style * docs: modified style * Update USER_GUIDE.zh-CN.md * Update USER_GUIDE.zh-CN.md * Update USER_GUIDE.md Co-authored-by: 琚致远 * feat: change proxy target to localhost when test (#1001) * feat: change proxy target to localhost when test * Update frontend-e2e-test.yml * Update frontend-e2e-test.yml * docs(contributing): added commit message guidelines (#1007) * chore: enrich error log (#977) * chore: enrich error log * test: add test case for log caller * fix: test error * test * fix: use invalid ip * fix: cli test error * fix: typo * fix: spelling (#1004) * feat: added priority (#1006) * docs: update README's style (#1009) * docs: update README's style * Update README.zh-CN.md * docs: only keep English docs (#1011) related #1009 * feat: add access log for Manager API (#994) * feat: access log * feat: access log * chore: access log format * chore: access log format * test: add test case for access log * chore: add access log example * fix: according to review * test: add unit test for `logging` middleware * fix: license checker CI failed * release: new version 2.1.1 (#959) * docs: update CHANGELOG for v2.1.1 * docs: update CHANGELOG for v2.1.1 * docs: update CHANGELOG for v2.1.1 * docs: update deployment doc for v2.1.1 * docs: update CHANGELOG for v2.1.1 * feat(web): upgrade web version * docs: update README and changelog * feat(docs): update latest version to 2.1.1 * fix(docs): use correct apisix's version Co-authored-by: nic-chen Co-authored-by: 琚致远 * fix(husky): pass the web folder (#1008) * fix(husky): unset git dir * chore: remove private flag * chore: remove useless env * chore(codes): format codes * chore(web): update version * feat: support to show version info when manager-api starting (#900) fix #866 fix #853 * fix: delete POST method in /apisix/admin/consumer (#852) (#868) fix #852 * Revert "fix: delete POST method in /apisix/admin/consumer (#852) (#868)" (#1019) This reverts commit 78db532402a86cbdc4e8d3a58396f126bf313695. * feat: use Swagger to maintain API document for Manager API (#992) * feat: api doc * feat: api doc * feat: api doc * fix: CI failed * fix: remove useless comments * fix: according to review * fix: license * fix: according to review * fix: according to review * chore: remove useless doc file * fix: according to review * fix: typo * feat: remove husky from the web (#1018) * feat: remove husky from the web * chore: remove husky folder * fix: PATCH method bug (#1005) * fix: PATCH method bug * test: use sub path patch in e2e test * fix: lint * fix: naming stype * fix: according to review * fix: style * feat: add a unit test for consumer and remove implicit init (#859) * feat: add a unit test for consumer and remove implicit init * fix: add implict init function to compatible integration tests * chore: add other cosumer unit test and refacotor some code * fix: remove intergration instead of unit test * fix: add EOL for file * chore: use sub test to run table test * chore: test desc * chore: test desc Co-authored-by: Wen Ming * fix: Use JSONSchema to verify the original data submitted by users (#986) * fix: JSONSchema verification should be performed on the original data submitted by the user * fix: remove debug info * test: add test cases * fix: error info * fix: script data type * fix: script data type * fix: error * fix: error message * fix: CI failed * fix: error * fix: according to review * fix: e2e test case * fix: according to review * ci: support dependency bot (#1021) * ci: support dependency bot * Update dependabot.yml * feat: update api's version to 2.2-rc1 (#1025) * fix: remove the dependency on git from the build script (#1024) * fix: remove the dependency on git from the build script * ci: add test for release * ci: add test for release * test * fix error * fix error * ci: support gitleaks to scan hardcoded password (#1022) * ci: support codeql-analysis (#1020) * ci: support codeql-analysis * Update codeql-analysis.yml * Update codeql-analysis.yml * chore(deps): bump actions/setup-node from v1 to v2.1.3 (#1029) Bumps [actions/setup-node](https://github.com/actions/setup-node) from v1 to v2.1.3. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v1...27082cecf3ff7a1742dbd5e12605f0cb59dce2d9) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * ci: fix release test run failed (#1032) fix release test run failed * fix(plugin): Inject the disable property into every plugin's jsonschema, the same as manager-api. (#1031) uses the correct Proxy host fix #1027 fix #1028 * chore(deps): bump wei/wget from v1 to v1.1.1 (#1046) * refactor: 🧹 remove trailing whitespace (#1052) * feat(CI): add a GitHub Action to lint the Markdown (#1053) - Add a Markdownlint config file - Lint Markdown for MD038/no-space-in-code Spaces inside code span elements https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md#md038---spaces-inside-code-span-elements * docs: update CHANGELOG for v2.2 (#1037) * docs: update CHANGELOG for v2.2 Co-authored-by: nic-chen Co-authored-by: 琚致远 * feat(CI): add a GitHub Action to lint the YAML (#1060) - add a `.yamllint` config file - lint some YAML * chore(deps): bump actions/setup-go from v1 to v2.1.3 (#1030) Bumps [actions/setup-go](https://github.com/actions/setup-go) from v1 to v2.1.3. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v1...37335c7bb261b353407cff977110895fa0b4f7d8) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * chore(deps): update actions/setup-node requirement to v2.1.4 (#1062) Updates the requirements on [actions/setup-node](https://github.com/actions/setup-node) to permit the latest version. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/commits/c46424eee26de4078d34105d3de3cc4992202b1e) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * fix: absolute Paths conf.WebDir (#1055) * fix: absolute Paths conf.WebDir * style: use filepath.Join to splicing path, change conf.WebDir to 'html/' * style: use success code to check test return Co-authored-by: fu_changjie <834876355@qq.com> * feat: Refactor frontend e2e (#1056) * feat: remove puppeteer dependency * feat: init cypress * feat: add login logout test case * feat: add crete and delete test case * feat: add e2e test serveUrl * feat: refactor fe e2e ci * feat: update package.json * feat: update package.json * feat: update package.json * docs: add front-end-e2e.md * feat: add ASF licenses * feat: add ASF licenses * fix: not cache cypress error * feat: Remove unuseful files * feat: update frontend-e2e-test.yml * feat: clean code * feat: add login with invalid credentials test case * feat: clean code * feat: Optimization test cases * feat: set english as default language * feat: set login default language * feat: add search route befofe delete * feat: support search route by label (#1061) * feat: support search route by label (#861) * doc: add search by route * feat: add more unit test * update: check the label parameter * fix: unit test * feat: implement API to get apisix instances status (#958) related #849 . * fix: create_and_delete_route wrong way to locate prometheus button (#1069) * feat(plugin): use ajv to validate data (#1047) * feat: use ajv to validate data * style: format codes * style: format codes * style: remove extra ; * style: format codes * docs: update README to remind that the master version should work with the APISIX master version. (#1071) * feat: refactor online debug for backend (#979) * feat: refactor online debug be * fix: update test * fix: upate e2e test * fix: e2e test * fix: e2e test * fix: debug * fix: debug * fix: case 2 * fix: more cases * fix: e2e * fix: e2e * fix: e2e * fix: e2e * fix: e2e * fix: e2e * fix: e2e * fix: e2e * fix: e2e * fix: e2e * fix: typo * fix: add Protocol to on debug rewarding * fix: ci * fix: ci * fix: ci * fix: enhancement refer to code review * fix: define global variable * fix: put route_online_debug into a separate file * fix: typo * fix: add license Co-authored-by: 琚致远 * feat: refactor online debug for frontend (#978) * feat: refactor online debug fe * fix: lint errors * fix: update yarn.lock * fix: url required * fix: update refer to the review * fix: ci error * fix: update refer to view * fix: update yarn.lock * fix: add attr protocol to debug request * fix: update params name * fix: update yarn.lock * fix: update code review * fix: lint errors * fix: typo * fix: codemirror height * fix: update yarn.lock * feat: put server_info under the admin api (#1076) * feat: added info page (#949) * add: Static Info Pages * fix: 代码格式化,使用Select组件 * fix: 优化Select组件和表格联动 * fix: ./Info.less error not found. * fix: Format code * fix: delete console.log() * fix: Optimized code * fix: Optimized code * fix: Modify data, wait for api. * feat: integrate with API * fix: format codes * fix: i18n * fix: link to instructions for use * fix: format codes * fix: format codes * fix: format codes * fix: node type * Update web/src/pages/ServerInfo/List.tsx Co-authored-by: litesun * fix: format codes Co-authored-by: 琚致远 Co-authored-by: litesun * feat(FE): update route e2e (#1074) * Update schema to master (#1080) * debug * fix: sort schema.json * fix: unit test remote_addr validate pattern * fix: update remote_addr validate failed msg Co-authored-by: nic-chen * feat: active check support custom port (#1078) * feat: active check support custom port * fix: omit null value * Update web/src/pages/Upstream/locales/en-US.ts Co-authored-by: litesun Co-authored-by: 琚致远 Co-authored-by: litesun * feat: support to line feed (#1084) * chore: remove Lua dependency (#1083) * chore: remove Lua dependency * feat: use selector to choose methods (#1082) * fix: "method" can be null value * Update RequestConfigView.tsx Co-authored-by: 琚致远 * fix: e2e test cases unstable (#1073) * Refactor publish offline be (#1081) * feat: support patch in route module * fix: add test cases refer to the code review * fix: define status in route struct * fix: set default status for route * test: update test cases * fix: update test cases * fix: test cases failed * fix: add sleep after create route * fix: update sleep * fix: test case * fix: use a same type for status Co-authored-by: nic-chen * feat: added websocket tab for route (#1079) * feat: added websocket tab for route * Update RequestConfigView.tsx Co-authored-by: 琚致远 * feat: refactor publish/offline fe (#991) * feat: refactor online debug fe * fix: use PATCH instead of PUT * fix: bug * fix: code review * fix(FE): delete route error Co-authored-by: 琚致远 Co-authored-by: litesun * feat: upstream support set `pass_host` parameter (#1088) * feat: upstream support set `pass_host` parameter * feat: i18n * feat: support labels list (#1072) * feat: support labels list * feat(FE): allow user write FE e2e by using local manager-api server (#1090) * feat: add local manager-api mode when write FE e2e test case * feat: update package.json * fix: add protocol select (#1092) * fix: error throws when delete all params * fix: add protocol select * fix: add online debug to USER_GUIDE.md (#1091) Co-authored-by: 琚致远 * test: add frontend e2e test (create and delete consumer with key-auth) (#1068) * test: add front e2e test (create and delete consumer with key-auth) * add invaild json check * test: modify indentation, modify method for access consumer page, add JSON.stringify * test : modify indentation * remove useless code, modify JSON.stringify() * chore: modify comment Co-authored-by: 琚致远 * fix: misspelling (#1101) * ci: display more meaningful information when running E2E test cases failed (#1012) * ci: display more meaningful information when running E2E test cases fail * feat: provide the ability to view plugin type and other properties (#1111) * feat: add test cases for rejecting request data if it contains an empty array (#1112) * feat: add test cases for empty array * fix: when enable or disable existing SSL, an error occurred (#1064) * fix: when enable or disable existing SSL, an error occurred * fix: keep the code uniform * fix: lint * fix: keep the code uniform * fix: license * chore: add comment to note that json.Marshal and json.Unmarshal may cause the precision loss Co-authored-by: 琚致远 Co-authored-by: YuanSheng Wang * fix: not allowed to specify `create_time` and `update_time` when create/edit route, service, upstream and consumer (#1110) Related #933 . * feat: add spell checker (#1013) (#1107) Co-authored-by: 琚致远 Co-authored-by: Alex Zhang * fix: delete POST method in /apisix/admin/consumer (#1109) fixed #852 related #868 * chore: introduce corba as the cli scafford (#773) related #739 * feat(FE): add service module (#1089) * feat: init service * feat: add service list page * feat: add service step header * feat: add basic information page * feat: add plugin page * feat: update license * feat: add create service * feat: add list operation * feat: add edit mode * feat: add service edit * feat: remove useless file * feat: clean code * feat: validate upstream form * feat: update codes * feat: update UpstreamForm * feat: add service_id in route step1 page * feat: update code * feat: update comment * feat: update route transform * fix: upstreamForm not update when upstream_id change * feat: add init upstreamFrom default value Co-authored-by: 琚致远 * feat: add route group (#999) * feat: added route label search * fix: react key warning * feat: add label drawer * feat: add save and cancel button in drawer * feat: added edit feature in labelDrawer * fix: lost click event when div child is empty * feat: update route transform with labels * feat: add AutoComplete * feat: use form.list render labels * feat: clean code * fix: warning when click save button * feat: update fetchLabelList * feat: update create route * feat: update typing * Merge branch master into feat-route-group-1 * Update component.ts * feat: update code * feat: update i18n Co-authored-by: 琚致远 * fix: when create a route without ID in request body by Admin API, it can't be displayed in Manager API (#1063) * fix: when the ID in body of a resource is empty, it cannot be displayed in the list * test: add test case * fix: unit test fail * fix: error * test: update test cases * test: update test cases * chore: naming style * test: add test cases for create route by POST * fix: unit test failed * fix: manager api host port for e2e * chore: sleep more time * chore: code refactor * fix: error * fix: unit test failed * fix: be consumer e2e test ci failed in pr#999 (#1118) * fix: be consumer e2e test ci failed in pr#999 * fix: online debug sleep Co-authored-by: 琚致远 * fix: fix some sleep location in e2e test (#1123) Co-authored-by: 琚致远 * chore: adjust directory structure of api (#1108) chore: adjust directory structure of api * fix: can not manual input in upstream (#1124) * fix: can not manual input * feat: update upstream Co-authored-by: 琚致远 * test: add frontend e2e test (smoke test for ssl) (#1096) * test: add frontend e2e test (smoke test for ssl) resolve #641 * fix: add waiting time * more test * fix: modify the delete method * test: used fixture instead of code * test: modify certificate.json to add `sni` * Update certificate.json Co-authored-by: YuanSheng Wang Co-authored-by: 琚致远 Co-authored-by: litesun * fix:value not change when upstream_id change (#1129) * fix: error check to ensure path id doesn't conflict body id (#1067) Co-authored-by: nic-chen * test: add frontend e2e test (smoke test for settings page) (#1105) * feat: support EWMA (#1131) Co-authored-by: 琚致远 * test: enhance frontend e2e test stability (consumer) (#1116) * test: fix frontend e2e test (consumer test unstable) * chore: change comment to lowercase * chore: add ; symbol Co-authored-by: 琚致远 Co-authored-by: YuanSheng Wang * test: add frontend e2e test (smoke test for metrics page) (#1104) * test: add frontend e2e test (smoke test for metrics page) * fixed wrong case title * update the key name Co-authored-by: YuanSheng Wang * test: add frontend e2e test (create_and_delete_upstream) (#1066) * test: add e2e for web-create_and_delete_upstream * move to upstream folder * chore: fix code style * chore: fix code style * chore: fix code style * test: use camelCase, modify upstream name, method to access upstream list page, modify indentation * remove useless code * fixed: CI failed * chore: modify comment * add comment * fixed code style * chore: fixed title * chore: title add `should` Co-authored-by: 琚致远 Co-authored-by: YuanSheng Wang Co-authored-by: litesun * feat: support global rules for Manager API (#1057) * feat: support global rules * feat: improve upstream i18n (#1097) * feat: "upstream" i18n * feat: "menu" i18n * feat: "button" i18n * fix: 'query' button for 'search' * fix: e2e text * fix: i18n * fix: i18n * Update web/src/components/RightContent/AvatarDropdown.tsx * Update web/src/locales/en-US/menu.ts * Update web/src/locales/zh-CN/menu.ts * style: format codes (#1) Co-authored-by: 琚致远 Co-authored-by: liuxiran * fix: click avatarDropdown setting, there will be a loading appeared (#1132) Co-authored-by: 琚致远 * feat(FE): fetch category from manager-api (#1122) * feat: fetch category from manager-api * feat: add category sort * feat: use consumer_schema in consumer module * feat: use local PluginOrchestration components * feat: add  license * feat: pluginOrchestration fetch type from manager-api * feat: remove json-schema * feat: add pluginOrchestration i18n * feat: add showList sort * feat: clean code * feat: update name Co-authored-by: juzhiyuan * fix: minish resync_delay for e2e test (#922) (#1139) Co-authored-by: 琚致远 * test: add frontend e2e test (edit and search route) (#1093) * test: add frontend e2e test (edit and search route) * chore: modify code style * chore: add `should` * chore: add `should` * test: add sleepTime * feat: added useForceIntl hook * feat: improve testcase * feat: added license header * feat: use Search instead of Query * fix: should edit the route case Co-authored-by: 琚致远 Co-authored-by: nic-chen <33000667+nic-chen@users.noreply.github.com> * chore: add goreport card badge in README (#1142) Signed-off-by: imjoey Co-authored-by: 琚致远 Co-authored-by: nic-chen <33000667+nic-chen@users.noreply.github.com> * fix: fetch code from master branch instead of v2.0 in Dockerfile (#1146) Signed-off-by: imjoey * feat(FE): add global plugin (#1106) * feat: init global plugin * feat: init list page * feat: update plugin list page interaction * feat: refactor codeMirror * feat: dont validateData when disable * feat: update * feat: init plugin config * feat: add schemaType in PluginDetail * feat: use drawer to render pluginDetail * global plugin access interface * feat: add plugin sort * fix: license * feat: add scope type * style: format codes * feat: update global plugin * feat: add card background * fix: consumer e2e * fix: lint Co-authored-by: juzhiyuan * fix: conflicted when update global rule (#1152) * fix: conflicted when update global rule * fix: unit test failed Co-authored-by: 琚致远 * fix: protable search&reset button i18n (#1153) * fix: protable search&reset button i18n * fix: markdown lint check error * fix: update refer to code review * fix: update refer to the code review * fix: ssl Co-authored-by: litesun Co-authored-by: 琚致远 * fix: input validate for online debug url (#1164) * fix: input validate for online debug url * fix: update regular expression Co-authored-by: 琚致远 * feat(FE): version manager (#1157) * style: codes-format * feat: use labels form item * style: codes-format * feat: adjust buttons * style: 调整按钮位置 * feat: 增加警告标示 * feat: added version * feat: added version * fix: redirect * style: format codes * fix: style * fix: search labels with the same key (#1151) * fix: search labels with the same key (#1130) * fix: 2020 update to 2021 (#1179) * fix: correct Version and GitHash output for manager-api command (#1162) * bug: fix Version and add GitHash for manager-api command Signed-off-by: imjoey * feat: git hash support generating .githash for apache release Signed-off-by: imjoey * feat: Add testcase for the new githash info Signed-off-by: imjoey * feat: add test case for .githash content validation Signed-off-by: imjoey * feat: Remove git command dependency for getting git hash Signed-off-by: imjoey * fix: allow empty plugins for global rule (#1180) Co-authored-by: 琚致远 * feat: improve upstream e2e testcase (#1187) * fix(cli): support running manager-api cmd in non-default diretory (#1184) * fix: Support version/githash for target api-run (#1200) Signed-off-by: imjoey * fix: well handle with malformed auth token in request header (#1206) * fix: not panic if auth token is invalid Signed-off-by: imjoey * do not record the false in log Signed-off-by: imjoey * feat: sync bugfix PRs with the master branch (#1171) * fix(FE): delete global plugin failed (#1170) * fix: delete global plugin failed * fix: filter disable plugins * fix: update online debug api protocol validation and error msg (#1166) * fix: update validation and msg * Update api/internal/handler/route_online_debug/route_online_debug.go * fix: update refer to code review Co-authored-by: 琚致远 * feat(cli): Show GitHash for manager-api in branch v2.3 (backport #1162) (#1181) * fix: correct Version and GitHash output for manager-api command (#1162) * bug: fix Version and add GitHash for manager-api command Signed-off-by: imjoey * feat: git hash support generating .githash for apache release Signed-off-by: imjoey * feat: Add testcase for the new githash info Signed-off-by: imjoey * feat: add test case for .githash content validation Signed-off-by: imjoey * feat: Remove git command dependency for getting git hash Signed-off-by: imjoey * feat: set VERSION to 2.3 in branch v2.3 Signed-off-by: imjoey * fix(fe): route search with status (#1205) * fix(fe): route search with status * fix: version and status select box allowclear * fix: remove console * fix: set create_time/update_time as omitempty (#1203) Signed-off-by: imjoey * fix(FE): service issues (#1209) * fix: omit checks when empty * fix: desc search * fix: omit checks when empty * feat: remove desc search * feat: add create service e2e test * feat: update code * feat: update code * chore: sync json schema from Apache APISIX 2.2 (#1177) * chore: sync json schema from Apache APISIX 2.2 * fix: remove schema of plugins that not enable by default * fix test cases for plugin skywalking which is not enable by default * chore: expose port for control API * fix: control API config * fix yaml format * fix CI failed * fix: log path * fix: log path Co-authored-by: 琚致远 * fix: well handle with malformed auth token in request header (#1206) (#1210) * fix: not panic if auth token is invalid Signed-off-by: imjoey * do not record the false in log Signed-off-by: imjoey Co-authored-by: Joey * fix: route list search query string (#1197) * fix: route list search qurey string * fix: well handle with malformed auth token in request header (#1206) * fix: not panic if auth token is invalid Signed-off-by: imjoey * do not record the false in log Signed-off-by: imjoey * feat: add search lables e2e * feat: add search route labels testcase * feat: update code * Update selector.json * Update search-route.spec.js Co-authored-by: Joey Co-authored-by: 琚致远 Co-authored-by: litesun Co-authored-by: liuxiran Co-authored-by: Joey Co-authored-by: nic-chen Co-authored-by: nic-chen <33000667+nic-chen@users.noreply.github.com> * feat: Improve consumer for i18n (#1212) Signed-off-by: imjoey * fix(be): change bodyParams to string to accept any content-type (#1202) * fix: change bodyParams to string to accept any content-type * fix: ci error * fix: change bodyparam to type string in e2e test case * fix: ci Co-authored-by: 琚致远 * chore: use the correct API version (#1215) Co-authored-by: litesun * fix: online debug body params support content-type x-www-form-urlencoded (#1201) * fix: online debug body params support content-type x-www-form-urlencoded * fix: body code mirror support different mode * fix: use enum instead of real string * fix: lint error Co-authored-by: 琚致远 * feat: add tips when plugin type is auth and schemaType is not consumer (#1219) Co-authored-by: 琚致远 * fix(be): search by status on the route list page is invalid (#1207) * fix search by status on the route list page is invalid * Fix test cases and references * Update route.go * Update route.go * Format error repair * use strconv.Itoa Method conversion uint8 * chore: use the correct API version (#1215) Co-authored-by: litesun fix: online debug body params support content-type x-www-form-urlencoded (#1201) * fix: online debug body params support content-type x-www-form-urlencoded * fix: body code mirror support different mode * fix: use enum instead of real string * fix: lint error Co-authored-by: 琚致远 feat: add tips when plugin type is auth and schemaType is not consumer (#1219) Co-authored-by: 琚致远 * Fix indent format problem Co-authored-by: 琚致远 * feat: added E2E test for plugins (#1214) * fix(FE): delete global plugin failed (#1170) * fix: delete global plugin failed * fix: filter disable plugins * fix: update online debug api protocol validation and error msg (#1166) * fix: update validation and msg * Update api/internal/handler/route_online_debug/route_online_debug.go * fix: update refer to code review Co-authored-by: 琚致远 * feat(cli): Show GitHash for manager-api in branch v2.3 (backport #1162) (#1181) * fix: correct Version and GitHash output for manager-api command (#1162) * bug: fix Version and add GitHash for manager-api command Signed-off-by: imjoey * feat: git hash support generating .githash for apache release Signed-off-by: imjoey * feat: Add testcase for the new githash info Signed-off-by: imjoey * feat: add test case for .githash content validation Signed-off-by: imjoey * feat: Remove git command dependency for getting git hash Signed-off-by: imjoey * feat: set VERSION to 2.3 in branch v2.3 Signed-off-by: imjoey * fix(fe): route search with status (#1205) * fix(fe): route search with status * fix: version and status select box allowclear * fix: remove console * fix: set create_time/update_time as omitempty (#1203) Signed-off-by: imjoey * fix(FE): service issues (#1209) * fix: omit checks when empty * fix: desc search * fix: omit checks when empty * feat: remove desc search * feat: add create service e2e test * feat: update code * feat: update code * chore: sync json schema from Apache APISIX 2.2 (#1177) * chore: sync json schema from Apache APISIX 2.2 * fix: remove schema of plugins that not enable by default * fix test cases for plugin skywalking which is not enable by default * chore: expose port for control API * fix: control API config * fix yaml format * fix CI failed * fix: log path * fix: log path Co-authored-by: 琚致远 * fix: well handle with malformed auth token in request header (#1206) (#1210) * fix: not panic if auth token is invalid Signed-off-by: imjoey * do not record the false in log Signed-off-by: imjoey Co-authored-by: Joey * fix: route list search query string (#1197) * fix: route list search qurey string * fix: well handle with malformed auth token in request header (#1206) * fix: not panic if auth token is invalid Signed-off-by: imjoey * do not record the false in log Signed-off-by: imjoey * feat: add search lables e2e * feat: add search route labels testcase * feat: update code * Update selector.json * Update search-route.spec.js Co-authored-by: Joey Co-authored-by: 琚致远 * feat: init cypress with plugin * style: codes format * feat: added come testcases * feat: use the correct api version * feat: added tip * feat: added tip * feat: added test cases * feat: added disable * feat: added disable * feat: added disable * style: codes format * feat: added ajv formats * feat: remove useless codes Co-authored-by: litesun Co-authored-by: liuxiran Co-authored-by: Joey Co-authored-by: nic-chen Co-authored-by: nic-chen <33000667+nic-chen@users.noreply.github.com> * fix: sync the preload packages in schema-sync.lua (#1216) (#1221) Co-authored-by: 琚致远 * feat: add plugin icon (#1220) * feat: add default plugin img * feat: add plugin edit drawer tips * feat: change icon opacity to 0.2 * feat: add plugin icon * feat: update style Co-authored-by: 琚致远 * fix: get and head request did not contain bodyparams (#1239) * feat: Add backport type in PR template (#1230) Signed-off-by: imjoey Co-authored-by: 琚致远 * feat(FE): skip Cypress binary install when build (#1248) * fix: incomplete label display #1044 (#1252) * fix: Adjust the grid layout. (#1253) * docs: added back docs for release 2.3 (#1258) * Update deploy.md * doc: add changelog for v2.3 (#1235) * Update CHANGELOG.md Co-authored-by: liuxiran Co-authored-by: Alex Zhang Co-authored-by: liuxiran * feat: enhance plugin schema smoke test (#1261) * feat: add create_time/update_time for global_rule (#1218) * feat: support create_time/update_time for global_rule Signed-off-by: imjoey * Update global_rule schema with new create_time/update_time Signed-off-by: imjoey * Fix backend Unit test failure Signed-off-by: imjoey * fix: use BEJSON to format schema.json * fix style and code conventions Signed-off-by: imjoey Co-authored-by: liuxiran * fix(CI): Update lint workflow so that the Markdown and YAML linters run (#1254) Due to the ASF's policies changing we cannot use the original GitHub Actions for linting as they are not approved Lint some YAML Co-authored-by: 琚致远 * feat: server info page time stamp display. (#1256) * fix: server info page time stamp display. * fix: format codes Co-authored-by: 琚致远 Co-authored-by: litesun * fix: create route display is truncated #1188 (#1266) Co-authored-by: 琚致远 * test: add backend e2e test for service (#1128) * test: add backend e2e test for service * test: remove commented code * test: add service with limit-count plugin test * add service with all options * modify test case Co-authored-by: 琚致远 Co-authored-by: nic-chen <33000667+nic-chen@users.noreply.github.com> * docs: update README and added DockerHub badge (#1264) * docs: update README and added DockerHub badge * Update deploy-with-docker.md * Update deploy-with-docker.md * chore: modify the case's filename (#1272) Co-authored-by: 琚致远 * chore: Improve the http body check in e2e test case (#1250) * chore: improve the http body check in e2e testcase Signed-off-by: imjoey * Restore the test case mistakenly delete Signed-off-by: imjoey Co-authored-by: 琚致远 Co-authored-by: nic-chen <33000667+nic-chen@users.noreply.github.com> * docs: add readme for install Apache APISIX Dashboard with RPM package (#1273) * docs: add readme for install Apache APISIX Dashboard with RPM package. * fixed typo * use a new file to have detailed * fixed typo * Update deploy-with-rpm.md * Update deploy-with-rpm.md * Update docs/deploy-with-rpm.md Co-authored-by: litesun Co-authored-by: 琚致远 Co-authored-by: litesun * chore: fix punctuation problem (#1280) * chore: lint Markdown and remove unneeded rules (#1274) Lint Markdown for rules: - MD009/no-trailing-spaces - MD012/no-multiple-blanks - MD022/blanks-around-headings - MD031/blanks-around-fences * test: backend e2e test for route with jwt (no algorithm) (#1195) * test: backend e2e test for create consumer with jwt * chore: add sleeptime * fixed: test route with jwt-auth plugin * move the new case to route_with_auth_plugin_test.go * chore: modify case desc * chore: modify jwt token name * modify method for get the token of jwt * modify file name Co-authored-by: nic-chen <33000667+nic-chen@users.noreply.github.com> Co-authored-by: YuanSheng Wang Co-authored-by: 琚致远 * docs: Update PULL_REQUEST_TEMPLATE (#1244) * Update PULL_REQUEST_TEMPLATE * Update .github/PULL_REQUEST_TEMPLATE Co-authored-by: liuxiran * Update PULL_REQUEST_TEMPLATE * Update PULL_REQUEST_TEMPLATE Co-authored-by: 琚致远 Co-authored-by: liuxiran * fix: Delete excess content. (#1285) * fix(FE): Redirect plugin should not show in route step3 (#1276) * feat: filter redirect plugin in route step3 * feat: add e2e test case * feat: add comment * feat: update comment * fix: omit taobao mirror (#1283) * fix: remove body type json (#1287) * fix: set get called false in the declaration (#1281) (#1282) * fix: Support string type for the script field in Route (#1289) * Support string type for script field in Route Signed-off-by: imjoey * Add validating lua code when create/update routes also improve the test case in unittest and e2e Signed-off-by: imjoey * typo fix and style format Signed-off-by: imjoey * Improve testcases Signed-off-by: imjoey * Addtional check the Script via log in APISIX Signed-off-by: imjoey * ngx.log print log in error.log, instead of access.log Signed-off-by: imjoey * Use ngx.WARN instead of INFO to enable output Signed-off-by: imjoey * chore: sync the latest JSON Schema (#1301) * fix: Client-side URL redirect (#1284) * fix: Client-side URL redirect * fix: client-side url redirection add else case Co-authored-by: liuxiran * fix: lint error * refactor: format codes inside web directory Co-authored-by: liuxiran * fix: Login page bottom white background. (#1298) * fix: Login page bottom white background. * fix: update * fix: Switch Language doesn't work. (#1306) * chore: move the authentication middleware into droplet framework (#1296) * chore: move the authentication middleware into droplet framework (#1295) * fix: ci test * fix: code style * update: panic if can't get http.Request * fix: fix misspell * fix: fix ci * fix: fix ci * doc: change the translate of consumer. (#1307) * docs: add demo site's infomation (#1309) * fix: document link error for plugins serverless-pre-function and serverless-pre-function (#1297) * fix#1260 * Update PluginDetail.tsx Co-authored-by: 琚致远 * feat: i18n (#1310) * fix: i18n * Update en-US.ts Co-authored-by: 琚致远 * feat: return back the data just created via POST method in manager API (#1277) * return saving object for store.Create Signed-off-by: imjoey * Add backend e2e test for returning from Create-via-POST Signed-off-by: imjoey * Fix incorrect HTTP method Signed-off-by: imjoey * docs: added Good first issue to README (#1320) * fix: ssl config support set labels (#1054) * fix: ssl config support set labels (#1050) * fix: fix e2e test * fix: ssl e2e test * fix: fix e2e test * fix: ssl e2e test Co-authored-by: 琚致远 * feat: implement a way to set etcd client (#1323) * feat: pass context for `Get` and `List` (#1324) * fix: upgrade @umijs/preset-react >= 1.7.11 (#1321) * feat: Add returning value for HTTP PUT and PATCH methods (#1322) * Add returning value for Updating entity (PUT/PATCH) Signed-off-by: imjoey * Fix missing return obj when create-if-not-exist Signed-off-by: imjoey * Fix backend Unit and e2e test Signed-off-by: imjoey * chore: fix spelling (#1327) * chore: add e2e test coverage (#1270) * feat: add domSelector and data (#1339) * align dashboard menu options to the left (#1338) * fix wrong Co-authored-by: litesun Co-authored-by: idbeta Co-authored-by: nic-chen <33000667+nic-chen@users.noreply.github.com> Co-authored-by: 琚致远 Co-authored-by: Radhika <56536997+96RadhikaJadhav@users.noreply.github.com> Co-authored-by: John Bampton Co-authored-by: seven dickens <41516298+dickens7@users.noreply.github.com> Co-authored-by: YuanSheng Wang Co-authored-by: nic-chen Co-authored-by: Peter Zhu Co-authored-by: Vinci Xu <277040271@qq.com> Co-authored-by: Wen Ming Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: fu_changjie <31716848+Fuchange@users.noreply.github.com> Co-authored-by: fu_changjie <834876355@qq.com> Co-authored-by: liuxiran Co-authored-by: guoqqqi <72343596+guoqqqi@users.noreply.github.com> Co-authored-by: Alex Zhang Co-authored-by: Alex Zhang Co-authored-by: kv Co-authored-by: Jinchi Zhou Co-authored-by: Joey Co-authored-by: JinChen <36916582+Jaycean@users.noreply.github.com> Co-authored-by: Kishani Kandasamy <53715187+KishaniKandasamy@users.noreply.github.com> Co-authored-by: Thanoshan MV <48581379+ThanoshanMV@users.noreply.github.com> Co-authored-by: Baoyuan --- .actions/ASF-Release.cfg | 1 + .actions/openwhisk-utilities | 1 - .github/PULL_REQUEST_TEMPLATE | 14 + .github/dependabot.yml | 21 + .github/workflows/backend-e2e-test.yml | 38 +- .github/workflows/backend-unit-test.yml | 9 +- .github/workflows/codeql-analysis.yml | 67 + .github/workflows/frontend-e2e-test.yml | 31 +- .github/workflows/gitleaks.yml | 25 + .github/workflows/lint.yml | 32 + .github/workflows/markdown-link-checker.yml | 14 + .github/workflows/release-test.yml | 71 + .github/workflows/spellchecker.yml | 21 + .../test-frontend-multiple-node-build.yml | 4 +- .gitignore | 1 + .../e2e/README.zh-CN.md => .markdownlint.yml | 35 +- .yamllint | 8 + CHANGELOG.md | 90 +- CHANGELOG.zh-CN.md | 83 - CONTRIBUTING.md | 132 +- Dockerfile | 6 +- Makefile | 10 +- README.md | 35 +- README.zh-CN.md | 84 - api/README.md | 22 + api/VERSION | 1 + api/build-tools/schema-sync.lua | 16 +- api/build.sh | 17 +- api/cmd/manager/main.go | 30 + api/cmd/manager/main_test.go | 54 + api/cmd/managerapi.go | 123 + api/conf/conf.yaml | 37 +- api/conf/schema.json | 1347 +- api/filter/authentication.go | 72 - api/go.mod | 25 +- api/go.sum | 392 +- api/{ => internal}/conf/conf.go | 36 +- api/internal/core/entity/entity.go | 34 +- api/internal/core/entity/format.go | 4 +- api/internal/core/storage/etcd.go | 86 +- api/internal/core/storage/storage.go | 7 +- api/internal/core/storage/storage_mock.go | 26 +- api/internal/core/store/query.go | 2 +- api/internal/core/store/store.go | 89 +- api/internal/core/store/store_mock.go | 65 + api/internal/core/store/store_test.go | 74 +- api/internal/core/store/storehub.go | 55 +- api/internal/core/store/validate.go | 132 +- api/internal/core/store/validate_mock.go | 25 +- api/internal/core/store/validate_test.go | 231 +- api/internal/filter/authentication.go | 94 + api/internal/filter/authentication_test.go | 116 + api/{ => internal}/filter/cors.go | 0 api/internal/filter/logging.go | 68 + api/internal/filter/logging_test.go | 46 + api/{ => internal}/filter/recover.go | 3 +- api/{ => internal}/filter/request_id.go | 0 api/internal/filter/schema.go | 242 + .../handler/authentication/authentication.go | 32 +- api/internal/handler/consumer/consumer.go | 111 +- .../handler/consumer/consumer_test.go | 647 +- .../handler/global_rule/global_rule.go | 194 + .../handler/global_rule/global_rule_test.go | 354 + api/internal/handler/handler.go | 39 +- api/internal/handler/handler_test.go | 86 + api/internal/handler/label/label.go | 264 + api/internal/handler/label/label_test.go | 361 + api/internal/handler/plugin/plugin.go | 27 +- api/internal/handler/plugin/plugin_test.go | 45 +- api/internal/handler/route/route.go | 273 +- api/internal/handler/route/route_test.go | 459 +- .../route_online_debug/route_online_debug.go | 128 + .../handler/server_info/server_info.go | 89 + .../handler/server_info/server_info_test.go | 222 + api/internal/handler/service/service.go | 65 +- api/internal/handler/service/service_test.go | 21 +- api/internal/handler/ssl/ssl.go | 172 +- api/internal/handler/ssl/ssl_test.go | 62 +- api/internal/handler/upstream/upstream.go | 67 +- .../handler/upstream/upstream_test.go | 24 +- api/{ => internal}/log/log.go | 7 + api/{ => internal}/log/zap.go | 45 +- api/internal/route.go | 22 +- api/internal/utils/consts/api_error.go | 35 +- api/internal/utils/consts/api_error_test.go | 62 + api/internal/utils/consts/error.go | 5 +- api/internal/utils/json_patch.go | 75 + api/internal/utils/json_patch_test.go | 211 + api/internal/utils/utils.go | 75 + api/internal/utils/utils_test.go | 86 + api/main.go | 4 +- api/test/docker-deploy/docker-compose.yaml | 6 +- api/test/docker/Dockerfile | 7 +- api/test/docker/apisix_config.yaml | 36 +- api/test/docker/apisix_config2.yaml | 98 + api/test/docker/docker-compose.yaml | 18 +- api/test/docker/manager-api-conf.yaml | 5 +- api/test/docker/upstream.conf | 2 +- api/test/e2e/authentication_test.go | 56 + api/test/e2e/balancer_test.go | 220 + api/test/e2e/base.go | 255 +- api/test/e2e/consumer_test.go | 275 +- api/test/e2e/global_rule_test.go | 401 + api/test/e2e/go.sum | 1 + api/test/e2e/id_compatible_test.go | 290 +- api/test/e2e/json_schema_validate_test.go | 60 + api/test/e2e/label_test.go | 310 + api/test/e2e/route_online_debug_test.go | 849 + api/test/e2e/route_remote_addr_test.go | 38 +- api/test/e2e/route_service_upstream_test.go | 139 +- api/test/e2e/route_test.go | 413 +- .../e2e/route_with_management_fileds_test.go | 268 +- api/test/e2e/route_with_methods_test.go | 80 +- api/test/e2e/route_with_plugin_cors_test.go | 66 +- ... => route_with_plugin_http_logger_test.go} | 73 +- ..._test.go => route_with_plugin_jwt_test.go} | 152 +- ... => route_with_plugin_limit_count_test.go} | 229 +- .../route_with_plugin_orchestration_test.go | 18 +- ...o => route_with_plugin_prometheus_test.go} | 34 +- .../route_with_plugin_proxy_rewrite_test.go | 48 +- api/test/e2e/route_with_priority_test.go | 26 +- .../e2e/route_with_script_luacode_test.go | 156 + api/test/e2e/route_with_uri_uris_test.go | 28 +- .../e2e/route_with_valid_remote_addr_test.go | 56 +- api/test/e2e/route_with_vars_test.go | 76 +- api/test/e2e/server_info_test.go | 140 + api/test/e2e/service_test.go | 271 + .../route_with_trace_plugin_test.go | 70 +- api/test/e2e/ssl_test.go | 104 +- api/test/e2e/upstream_chash_hash_on_test.go | 490 + ...pstream_chash_query_string_arg_xxx_test.go | 38 +- api/test/e2e/upstream_test.go | 205 +- api/test/shell/cli_test.sh | 176 +- api/test/shell/docker_deploy_test.sh | 2 +- docs/FAQ.md | 20 +- docs/FAQ.zh-CN.md | 56 - docs/I18N_USER_GUIDE.md | 2 +- docs/USER_GUIDE.md | 30 + docs/USER_GUIDE.zh-CN.md | 50 - docs/api/api.md | 369 + docs/deploy-with-docker.md | 8 +- docs/deploy-with-docker.zh-CN.md | 84 - .../e2e/README.md => docs/deploy-with-rpm.md | 21 +- docs/deploy.md | 4 +- docs/deploy.zh-CN.md | 86 - docs/develop.md | 4 +- docs/develop.zh-CN.md | 76 - docs/front-end-e2e.md | 48 + docs/images/route-debug-basic-auth.png | Bin 0 -> 329131 bytes docs/images/route-debug-body-params.png | Bin 0 -> 313153 bytes docs/images/route-debug-header-params.png | Bin 0 -> 320262 bytes docs/images/route-debug-offline.png | Bin 0 -> 267466 bytes docs/images/route-debug-published.png | Bin 0 -> 285913 bytes docs/images/route-debug-query-params.png | Bin 0 -> 253434 bytes web/config/config.ts | 2 +- web/config/proxy.ts | 9 +- web/config/routes.ts | 24 + web/cypress.json | 6 + web/cypress/fixtures/certificate.json | 11 + web/cypress/fixtures/plugin-dataset.json | 1347 ++ web/cypress/fixtures/selector.json | 5 + .../create_and_delete_consumer.spec.js | 107 + .../metrics/metrics-smoketest.spec.js | 41 + .../plugin/schema-smocktest.spec.js | 104 + .../route/create-edit-delete-route.spec.js | 125 + .../integration/route/search-route.spec.js | 137 + .../service/create-and-delete-service.spec.js | 54 + .../settings/settings-smoketest.spec.js | 63 + .../integration/ssl/ssl-smoketest.spec.js | 76 + .../create_and_delete_upstream.spec.js | 117 + web/cypress/integration/user/login.spec.js | 47 + web/cypress/integration/user/logout.spec.js | 34 + web/cypress/plugins/index.js | 24 + web/cypress/support/commands.js | 36 + web/cypress/support/index.js | 24 + web/package.json | 41 +- web/public/static/default-plugin.png | Bin 0 -> 2244 bytes web/src/app.tsx | 17 +- web/src/components/ActionBar/ActionBar.tsx | 9 +- web/src/components/Footer/index.tsx | 2 +- web/src/components/HeaderDropdown/index.tsx | 6 +- .../IconFont/IconFont.tsx} | 19 +- .../src/components/IconFont/index.ts | 4 +- web/src/components/NoticeIcon/NoticeList.tsx | 4 +- web/src/components/NoticeIcon/index.tsx | 7 +- web/src/components/Plugin/PluginDetail.tsx | 276 + web/src/components/Plugin/PluginPage.tsx | 201 + web/src/components/Plugin/data.tsx | 33 + web/src/components/Plugin/index.ts | 18 + web/src/components/Plugin/service.ts | 53 + web/src/components/Plugin/typing.d.ts | 32 + .../PluginOrchestration/DrawPluginStyle.ts | 82 + .../PluginOrchestration/components/Page.tsx | 20 + .../components/SidebarItem.tsx | 42 + .../PluginOrchestration/components/index.ts | 18 + .../PluginOrchestration/constants.ts | 62 + .../PluginOrchestration/customConfig.tsx | 77 + .../components/PluginOrchestration/index.tsx | 289 + .../PluginOrchestration/locales/en-US.ts | 30 + .../PluginOrchestration/locales/zh-CN.ts | 30 + .../components/PluginOrchestration/service.ts | 25 + .../PluginOrchestration/transform.ts | 122 + .../PluginOrchestration/typing.d.ts | 26 + .../RightContent/AvatarDropdown.tsx | 16 +- web/src/components/RightContent/index.tsx | 2 +- web/src/components/Upstream/UpstreamForm.tsx | 260 +- web/src/components/Upstream/constant.ts | 1 + web/src/constants.ts | 2 + web/src/e2e/Login.e2e.js | 75 - web/src/e2e/Logout.e2e.js | 56 - web/src/e2e/__mocks__/antd-pro-merge-less.js | 24 - web/src/e2e/baseLayout.e2e.js | 80 - web/src/global.less | 14 + web/src/global.tsx | 2 +- web/src/helpers.tsx | 60 +- web/src/hooks/useForceIntl.ts | 52 + web/src/libs/iconfont.js | 85 + web/src/locales/en-US.ts | 2 + web/src/locales/en-US/component.ts | 9 +- web/src/locales/en-US/globalHeader.ts | 2 +- web/src/locales/en-US/menu.ts | 4 +- web/src/locales/zh-CN.ts | 2 + web/src/locales/zh-CN/component.ts | 5 + web/src/locales/zh-CN/menu.ts | 9 +- web/src/pages/404.tsx | 2 +- web/src/pages/Consumer/Create.tsx | 25 +- web/src/pages/Consumer/List.tsx | 10 +- web/src/pages/Consumer/components/Preview.tsx | 6 +- web/src/pages/Consumer/components/Step1.tsx | 2 +- web/src/pages/Consumer/locales/en-US.ts | 4 +- web/src/pages/Consumer/locales/zh-CN.ts | 4 +- web/src/pages/Consumer/service.ts | 8 +- web/src/pages/Consumer/typing.d.ts | 5 +- web/src/pages/Plugin/List.tsx | 150 + web/src/pages/Plugin/PluginMarket.tsx | 64 + web/src/pages/Plugin/locales/en-US.ts | 17 + web/src/pages/Plugin/locales/zh-CN.ts | 17 + web/src/pages/Plugin/service.ts | 54 + web/src/pages/Plugin/typing.d.ts | 29 + web/src/pages/Route/Create.less | 2 +- web/src/pages/Route/Create.tsx | 11 +- web/src/pages/Route/List.tsx | 215 +- .../components/CreateStep4/CreateStep4.tsx | 9 +- .../DebugViews/AuthenticationView.tsx | 129 + .../components/DebugViews/DebugDrawView.tsx | 342 + .../components/DebugViews/DebugParamsView.tsx | 85 + .../Route/components/DebugViews/index.less | 46 + .../Route/components/DebugViews/index.ts | 19 + .../components/ResultView/ResultView.tsx | 4 +- .../Route/components/Step1/LabelsDrawer.tsx | 181 + .../components/Step1/MatchingRulesView.tsx | 6 +- .../pages/Route/components/Step1/MetaView.tsx | 95 +- .../components/Step1/RequestConfigView.tsx | 76 +- .../pages/Route/components/Step3/index.tsx | 71 +- web/src/pages/Route/constants.ts | 36 +- web/src/pages/Route/locales/en-US.ts | 27 +- web/src/pages/Route/locales/zh-CN.ts | 23 + web/src/pages/Route/service.ts | 35 +- web/src/pages/Route/transform.ts | 82 +- web/src/pages/Route/typing.d.ts | 140 +- web/src/pages/SSL/List.tsx | 7 +- .../SSL/components/CertificateForm/index.tsx | 6 +- .../components/CertificateUploader/index.tsx | 12 +- web/src/pages/SSL/components/Step1/index.tsx | 35 +- web/src/pages/SSL/components/Step2/index.tsx | 2 +- web/src/pages/ServerInfo/List.tsx | 110 + web/src/pages/ServerInfo/index.ts | 17 + web/src/pages/ServerInfo/locales/en-US.ts | 22 + web/src/pages/ServerInfo/locales/zh-CN.ts | 22 + web/src/pages/ServerInfo/service.ts | 23 + web/src/pages/ServerInfo/style.less | 48 + web/src/pages/ServerInfo/typing.d.ts | 27 + web/src/pages/Service/Create.tsx | 151 + web/src/pages/Service/List.tsx | 112 + .../Service/components/Preview.tsx} | 34 +- web/src/pages/Service/components/Step1.tsx | 67 + web/src/pages/Service/locales/en-US.ts | 21 + web/src/pages/Service/locales/zh-CN.ts | 21 + web/src/pages/Service/service.ts | 54 + web/src/pages/Service/typing.d.ts | 44 + web/src/pages/Setting/Setting.tsx | 19 +- web/src/pages/Setting/typingd.d.ts | 4 +- web/src/pages/Upstream/Create.tsx | 12 +- web/src/pages/Upstream/List.tsx | 33 +- web/src/pages/Upstream/components/Step1.tsx | 12 +- web/src/pages/Upstream/locales/en-US.ts | 147 +- web/src/pages/Upstream/locales/zh-CN.ts | 146 +- web/src/pages/Upstream/transform.ts | 8 +- web/src/pages/Upstream/typing.d.ts | 3 +- web/src/pages/User/Login.tsx | 2 +- web/src/pages/User/Logout.tsx | 5 +- .../User/components/LoginMethodExample.tsx | 2 +- .../User/components/LoginMethodPassword.tsx | 4 +- web/src/pages/User/typing.d.ts | 10 +- web/src/services/API.d.ts | 12 +- web/src/typings.d.ts | 9 +- web/tests/PuppeteerEnvironment.js | 57 - web/tests/beforeTest.js | 55 - web/tests/getBrowser.js | 61 - web/tests/run-tests.js | 68 - web/yarn.lock | 13733 ++++++++-------- 301 files changed, 27471 insertions(+), 10413 deletions(-) delete mode 160000 .actions/openwhisk-utilities create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/codeql-analysis.yml create mode 100644 .github/workflows/gitleaks.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/markdown-link-checker.yml create mode 100644 .github/workflows/release-test.yml create mode 100644 .github/workflows/spellchecker.yml rename web/src/e2e/README.zh-CN.md => .markdownlint.yml (67%) create mode 100644 .yamllint delete mode 100644 CHANGELOG.zh-CN.md delete mode 100644 README.zh-CN.md create mode 100644 api/VERSION create mode 100644 api/cmd/manager/main.go create mode 100644 api/cmd/manager/main_test.go create mode 100644 api/cmd/managerapi.go delete mode 100644 api/filter/authentication.go rename api/{ => internal}/conf/conf.go (82%) create mode 100644 api/internal/core/store/store_mock.go create mode 100644 api/internal/filter/authentication.go create mode 100644 api/internal/filter/authentication_test.go rename api/{ => internal}/filter/cors.go (100%) create mode 100644 api/internal/filter/logging.go create mode 100644 api/internal/filter/logging_test.go rename api/{ => internal}/filter/recover.go (98%) rename api/{ => internal}/filter/request_id.go (100%) create mode 100644 api/internal/filter/schema.go create mode 100644 api/internal/handler/global_rule/global_rule.go create mode 100644 api/internal/handler/global_rule/global_rule_test.go create mode 100644 api/internal/handler/handler_test.go create mode 100644 api/internal/handler/label/label.go create mode 100644 api/internal/handler/label/label_test.go create mode 100644 api/internal/handler/route_online_debug/route_online_debug.go create mode 100644 api/internal/handler/server_info/server_info.go create mode 100644 api/internal/handler/server_info/server_info_test.go rename api/{ => internal}/log/log.go (97%) rename api/{ => internal}/log/zap.go (65%) create mode 100644 api/internal/utils/consts/api_error_test.go create mode 100644 api/internal/utils/json_patch.go create mode 100644 api/internal/utils/json_patch_test.go create mode 100644 api/test/docker/apisix_config2.yaml create mode 100644 api/test/e2e/authentication_test.go create mode 100644 api/test/e2e/balancer_test.go create mode 100644 api/test/e2e/global_rule_test.go create mode 100644 api/test/e2e/json_schema_validate_test.go create mode 100644 api/test/e2e/label_test.go create mode 100644 api/test/e2e/route_online_debug_test.go rename api/test/e2e/{route_with_log_plugin_test.go => route_with_plugin_http_logger_test.go} (75%) rename api/test/e2e/{route_with_auth_plugin_test.go => route_with_plugin_jwt_test.go} (52%) rename api/test/e2e/{route_with_limit_plugin_test.go => route_with_plugin_limit_count_test.go} (55%) rename api/test/e2e/{route_with_metric_plugin_test.go => route_with_plugin_prometheus_test.go} (82%) create mode 100644 api/test/e2e/route_with_script_luacode_test.go create mode 100644 api/test/e2e/server_info_test.go create mode 100644 api/test/e2e/service_test.go rename api/test/e2e/{ => skywalking}/route_with_trace_plugin_test.go (67%) create mode 100644 api/test/e2e/upstream_chash_hash_on_test.go delete mode 100644 docs/FAQ.zh-CN.md delete mode 100644 docs/USER_GUIDE.zh-CN.md create mode 100644 docs/api/api.md delete mode 100644 docs/deploy-with-docker.zh-CN.md rename web/src/e2e/README.md => docs/deploy-with-rpm.md (62%) delete mode 100644 docs/deploy.zh-CN.md delete mode 100644 docs/develop.zh-CN.md create mode 100644 docs/front-end-e2e.md create mode 100644 docs/images/route-debug-basic-auth.png create mode 100644 docs/images/route-debug-body-params.png create mode 100644 docs/images/route-debug-header-params.png create mode 100644 docs/images/route-debug-offline.png create mode 100644 docs/images/route-debug-published.png create mode 100644 docs/images/route-debug-query-params.png create mode 100644 web/cypress.json create mode 100644 web/cypress/fixtures/certificate.json create mode 100644 web/cypress/fixtures/plugin-dataset.json create mode 100644 web/cypress/fixtures/selector.json create mode 100644 web/cypress/integration/consumer/create_and_delete_consumer.spec.js create mode 100644 web/cypress/integration/metrics/metrics-smoketest.spec.js create mode 100644 web/cypress/integration/plugin/schema-smocktest.spec.js create mode 100644 web/cypress/integration/route/create-edit-delete-route.spec.js create mode 100644 web/cypress/integration/route/search-route.spec.js create mode 100644 web/cypress/integration/service/create-and-delete-service.spec.js create mode 100644 web/cypress/integration/settings/settings-smoketest.spec.js create mode 100644 web/cypress/integration/ssl/ssl-smoketest.spec.js create mode 100644 web/cypress/integration/upstream/create_and_delete_upstream.spec.js create mode 100644 web/cypress/integration/user/login.spec.js create mode 100644 web/cypress/integration/user/logout.spec.js create mode 100644 web/cypress/plugins/index.js create mode 100644 web/cypress/support/commands.js create mode 100644 web/cypress/support/index.js create mode 100644 web/public/static/default-plugin.png rename web/src/{iconfont.ts => components/IconFont/IconFont.tsx} (74%) rename api/filter/logging.go => web/src/components/IconFont/index.ts (91%) create mode 100644 web/src/components/Plugin/PluginDetail.tsx create mode 100644 web/src/components/Plugin/PluginPage.tsx create mode 100644 web/src/components/Plugin/data.tsx create mode 100644 web/src/components/Plugin/index.ts create mode 100644 web/src/components/Plugin/service.ts create mode 100644 web/src/components/Plugin/typing.d.ts create mode 100644 web/src/components/PluginOrchestration/DrawPluginStyle.ts create mode 100644 web/src/components/PluginOrchestration/components/Page.tsx create mode 100644 web/src/components/PluginOrchestration/components/SidebarItem.tsx create mode 100644 web/src/components/PluginOrchestration/components/index.ts create mode 100644 web/src/components/PluginOrchestration/constants.ts create mode 100644 web/src/components/PluginOrchestration/customConfig.tsx create mode 100644 web/src/components/PluginOrchestration/index.tsx create mode 100644 web/src/components/PluginOrchestration/locales/en-US.ts create mode 100644 web/src/components/PluginOrchestration/locales/zh-CN.ts create mode 100644 web/src/components/PluginOrchestration/service.ts create mode 100644 web/src/components/PluginOrchestration/transform.ts create mode 100644 web/src/components/PluginOrchestration/typing.d.ts delete mode 100644 web/src/e2e/Login.e2e.js delete mode 100644 web/src/e2e/Logout.e2e.js delete mode 100644 web/src/e2e/__mocks__/antd-pro-merge-less.js delete mode 100644 web/src/e2e/baseLayout.e2e.js create mode 100644 web/src/hooks/useForceIntl.ts create mode 100644 web/src/libs/iconfont.js create mode 100644 web/src/pages/Plugin/List.tsx create mode 100644 web/src/pages/Plugin/PluginMarket.tsx create mode 100644 web/src/pages/Plugin/locales/en-US.ts create mode 100644 web/src/pages/Plugin/locales/zh-CN.ts create mode 100644 web/src/pages/Plugin/service.ts create mode 100644 web/src/pages/Plugin/typing.d.ts create mode 100644 web/src/pages/Route/components/DebugViews/AuthenticationView.tsx create mode 100644 web/src/pages/Route/components/DebugViews/DebugDrawView.tsx create mode 100644 web/src/pages/Route/components/DebugViews/DebugParamsView.tsx create mode 100644 web/src/pages/Route/components/DebugViews/index.less create mode 100644 web/src/pages/Route/components/DebugViews/index.ts create mode 100644 web/src/pages/Route/components/Step1/LabelsDrawer.tsx create mode 100644 web/src/pages/ServerInfo/List.tsx create mode 100644 web/src/pages/ServerInfo/index.ts create mode 100644 web/src/pages/ServerInfo/locales/en-US.ts create mode 100644 web/src/pages/ServerInfo/locales/zh-CN.ts create mode 100644 web/src/pages/ServerInfo/service.ts create mode 100644 web/src/pages/ServerInfo/style.less create mode 100644 web/src/pages/ServerInfo/typing.d.ts create mode 100644 web/src/pages/Service/Create.tsx create mode 100644 web/src/pages/Service/List.tsx rename web/src/{e2e/service.js => pages/Service/components/Preview.tsx} (53%) create mode 100644 web/src/pages/Service/components/Step1.tsx create mode 100644 web/src/pages/Service/locales/en-US.ts create mode 100644 web/src/pages/Service/locales/zh-CN.ts create mode 100644 web/src/pages/Service/service.ts create mode 100644 web/src/pages/Service/typing.d.ts delete mode 100644 web/tests/PuppeteerEnvironment.js delete mode 100644 web/tests/beforeTest.js delete mode 100644 web/tests/getBrowser.js delete mode 100644 web/tests/run-tests.js diff --git a/.actions/ASF-Release.cfg b/.actions/ASF-Release.cfg index bed65bf18b..e2828f79fa 100644 --- a/.actions/ASF-Release.cfg +++ b/.actions/ASF-Release.cfg @@ -78,6 +78,7 @@ web/src/e2e/__mocks__/antd-pro-merge-less.js web/src/e2e/baseLayout.e2e.js web/src/pages/404.tsx web/src/service-worker.js +web/src/libs/iconfont.js api/build-tools/json.lua # Skip files containing Apache 2.0 License diff --git a/.actions/openwhisk-utilities b/.actions/openwhisk-utilities deleted file mode 160000 index 8636f9ad3b..0000000000 --- a/.actions/openwhisk-utilities +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8636f9ad3bb7c4ed216f6b9291b0a6bf9a12cb76 diff --git a/.github/PULL_REQUEST_TEMPLATE b/.github/PULL_REQUEST_TEMPLATE index 37c9ccb2da..8576011648 100644 --- a/.github/PULL_REQUEST_TEMPLATE +++ b/.github/PULL_REQUEST_TEMPLATE @@ -4,6 +4,7 @@ Please answer these questions before submitting a pull request - [ ] Bugfix - [ ] New feature provided - [ ] Improve performance +- [ ] Backport patches - Related issues @@ -16,3 +17,16 @@ ___ ___ ### New feature or improvement - Describe the details and related test reports. + +___ +### Please add the corresponding test cases if necessary. + +___ +### Backport patches +- Why need to backport? + +- Source branch + +- Related commits and pull requests + +- Target branch diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..d183b6d0ad --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,21 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + - package-ecosystem: "npm" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" + + - package-ecosystem: "gomod" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" diff --git a/.github/workflows/backend-e2e-test.yml b/.github/workflows/backend-e2e-test.yml index 12d7767268..6bf0fd0fbc 100644 --- a/.github/workflows/backend-e2e-test.yml +++ b/.github/workflows/backend-e2e-test.yml @@ -9,14 +9,14 @@ on: - master jobs: - run-test: + backend-e2e-test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: setup go - uses: actions/setup-go@v1 + uses: actions/setup-go@v2.1.3 with: go-version: '1.13' @@ -29,4 +29,36 @@ jobs: - name: run test working-directory: ./api/test/e2e - run: go test + run: go test -v + + - name: re-generate json schema + working-directory: ./api/ + run: | + curl 127.0.0.1:9090/v1/schema > ./conf/schema.json + + - name: stop docker compose + working-directory: ./api/test/docker + run: | + docker-compose down + sleep 10 + + - name: re-run docker compose + working-directory: ./api/test/docker + run: | + docker-compose up -d --build + sleep 5 + docker logs docker_managerapi_1 + + - name: run test for plugin skywalking + working-directory: ./api/test/e2e/skywalking + run: go test -v + + - name: output test coverage + working-directory: ./api/test/testdata + run: | + go tool cover -func=./integrationcover.out + + - name: upload coverage profile + working-directory: ./api/test/testdata + run: | + bash <(curl -s https://codecov.io/bash) -f ./integrationcover.out diff --git a/.github/workflows/backend-unit-test.yml b/.github/workflows/backend-unit-test.yml index 8357857a3a..40d7dbf0f6 100644 --- a/.github/workflows/backend-unit-test.yml +++ b/.github/workflows/backend-unit-test.yml @@ -32,15 +32,10 @@ jobs: sudo mv ./dag-to-lua-1.1/lib/* ./api/dag-to-lua/ - name: setup go - uses: actions/setup-go@v1 + uses: actions/setup-go@v2.1.3 with: go-version: '1.13' - - name: setup lua - run: | - sudo apt-get update - sudo apt-get install lua5.1 - - name: run test run: | make api-test @@ -56,7 +51,7 @@ jobs: export GO111MOUDULE=on export APISIX_CONF_PATH=$PWD/conf sed -i 's/9000/8088/' conf/conf.yaml - go build -o ./manager-api + go build -o ./manager-api ./cmd/manager ./manager-api > ./api.log 2>&1 & sleep 2 cat ./api.log diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000000..04e2699f01 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,67 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [master] + pull_request: + # The branches below must be a subset of the branches above + branches: [master] + schedule: + - cron: '18 23 * * 0' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + language: ['go', 'javascript'] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + # - run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/frontend-e2e-test.yml b/.github/workflows/frontend-e2e-test.yml index 82d7405775..a785058585 100644 --- a/.github/workflows/frontend-e2e-test.yml +++ b/.github/workflows/frontend-e2e-test.yml @@ -15,24 +15,35 @@ jobs: web-e2e: name: Frontend e2e test runs-on: ubuntu-latest + + services: + etcd: + image: bitnami/etcd:3.4.13 + ports: + - 2379:2379 + - 2380:2380 + env: + ALLOW_NONE_AUTHENTICATION: yes + steps: - name: Checkout uses: actions/checkout@v2 - - name: Cache or restore node_modules - id: node_modules_cache_id - uses: actions/cache@v2 - with: - path: "**/node_modules" - key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }} - - name: Setup Node.js environment - uses: actions/setup-node@v1 + uses: actions/setup-node@v2.1.4 with: node-version: 14.x - - name: Install dependencies - if: steps.node_modules_cache_id.outputs.cache-hit != 'true' + - name: Setup golang environment + uses: actions/setup-go@v2.1.3 + with: + go-version: '1.13' + + - name: Start manager-api + working-directory: ./api + run: nohup go run ./cmd/manager & + + - name: Install front-end dependencies run: yarn install - name: Start frontend then test diff --git a/.github/workflows/gitleaks.yml b/.github/workflows/gitleaks.yml new file mode 100644 index 0000000000..ad9fd414c2 --- /dev/null +++ b/.github/workflows/gitleaks.yml @@ -0,0 +1,25 @@ +# Scan git repos (or files) for secrets using regex and entropy 🔑 + +name: gitLeaks + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + gitleaks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: '1' + - name: wget + uses: wei/wget@v1.1.1 + with: + args: -O .gitleaks.toml https://raw.githubusercontent.com/ycjcl868/gitleaks/master/.gitleaks.toml + - name: gitleaks-action + uses: zricethezav/gitleaks-action@master diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..a7f824dc57 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,32 @@ +name: ❄️ Lint + +on: [pull_request] + +jobs: + markdownlint: + name: 🍇 Markdown + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: 🚀 Use Node.js + uses: actions/setup-node@v2.1.4 + with: + node-version: '12.x' + - run: npm install -g markdownlint-cli@0.25.0 + - run: markdownlint '**/*.md' --ignore node_modules + yamllint: + name: 🍏 YAML + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + with: + python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax + architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install yamllint + - name: 🧹 YAML Lint + run: | + yamllint . diff --git a/.github/workflows/markdown-link-checker.yml b/.github/workflows/markdown-link-checker.yml new file mode 100644 index 0000000000..a1604f3827 --- /dev/null +++ b/.github/workflows/markdown-link-checker.yml @@ -0,0 +1,14 @@ +name: Check markdown links + +on: push + +jobs: + markdown-link-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: gaurav-nelson/github-action-markdown-link-check@v1 + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + check-modified-files-only: 'yes' diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml new file mode 100644 index 0000000000..b821fa26bb --- /dev/null +++ b/.github/workflows/release-test.yml @@ -0,0 +1,71 @@ +name: Release Test + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + run-test: + runs-on: ubuntu-latest + + services: + etcd: + image: bitnami/etcd:3.4.13 + ports: + - 2379:2379 + - 2380:2380 + env: + ALLOW_NONE_AUTHENTICATION: yes + + steps: + - uses: actions/checkout@v2 + + - name: setup go + uses: actions/setup-go@v2.1.3 + with: + go-version: '1.13' + + - name: release and build + run: | + VERSION=$(cat ./api/VERSION) + mkdir release + git clean -Xdf + tar -zcvf release/apache-apisix-dashboard-${VERSION}-src.tgz \ + --exclude .github \ + --exclude .git \ + --exclude .gitattributes \ + --exclude .idea \ + --exclude .vscode \ + --exclude .gitignore \ + --exclude .DS_Store \ + --exclude docs \ + --exclude release \ + --exclude api/internal/core/store/validate_mock.go \ + --exclude api/internal/core/storage/storage_mock.go \ + . + + cd release + tar -zxvf apache-apisix-dashboard-${VERSION}-src.tgz + ls -l + export GO111MOUDULE=on + api/build.sh + mkdir -p ./output/logs + cd output + ./manager-api > ./api.log 2>&1 & + sleep 3 + cat ./api.log + cat ./logs/error.log + cat conf/conf.yaml + + - name: run test + run: | + curl http://127.0.0.1:9000/apisix/admin/user/login -X POST -i -d '{"username":"admin", "password": "admin"}' + code=$(curl -k -i -m 20 -o /dev/null -s -w %{http_code} http://127.0.0.1:9000/apisix/admin/user/login -X POST -i -d '{"username":"admin", "password": "admin"}') + if [ ! $code -eq 200 ]; then + echo "failed: failed to custom port" + exit 1 + fi diff --git a/.github/workflows/spellchecker.yml b/.github/workflows/spellchecker.yml new file mode 100644 index 0000000000..6b246517f8 --- /dev/null +++ b/.github/workflows/spellchecker.yml @@ -0,0 +1,21 @@ +name: spellchecker +on: + pull_request: + branches: + - master +jobs: + misspell: + name: runner/misspell + runs-on: ubuntu-latest + steps: + - name: Check out code. + uses: actions/checkout@v1 + - name: Install + run: | + wget -O - -q https://git.io/misspell | sh -s -- -b . + - name: Misspell + run: | + find . -type f -maxdepth 1 | xargs ./misspell -error + find . -name "*.go" -type f | xargs ./misspell -error + find docs -type f | xargs ./misspell -error + find web/src web/cypress -type f | xargs ./misspell -error diff --git a/.github/workflows/test-frontend-multiple-node-build.yml b/.github/workflows/test-frontend-multiple-node-build.yml index 4a00477afe..e1f78da14f 100644 --- a/.github/workflows/test-frontend-multiple-node-build.yml +++ b/.github/workflows/test-frontend-multiple-node-build.yml @@ -28,14 +28,14 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + uses: actions/setup-node@v2.1.4 with: node-version: ${{ matrix.node-version }} # Install dependencies - name: Install dependencies working-directory: web - run: yarn + run: CYPRESS_INSTALL_BINARY=0 yarn - name: Lint working-directory: web diff --git a/.gitignore b/.gitignore index 06ac7fe39f..c30addcc0a 100644 --- a/.gitignore +++ b/.gitignore @@ -45,3 +45,4 @@ output default.etcd api/build-tools/apisix /*.zip +.githash diff --git a/web/src/e2e/README.zh-CN.md b/.markdownlint.yml similarity index 67% rename from web/src/e2e/README.zh-CN.md rename to .markdownlint.yml index e2f671b132..c0704cd49a 100644 --- a/web/src/e2e/README.zh-CN.md +++ b/.markdownlint.yml @@ -1,4 +1,3 @@ - -### 本地编写测试案例 - -1. 安装依赖并运行本地开发环境 - -```sh -$ yarn install && yarn start -``` - -2. 在 `src/e2e` 文件夹增加新的测试案例文件 -3. 运行测试案例 - -```sh -$ yarn test -``` - -如果你想单独运行某一个测试文件,可以执行如下命令 - -```sh -$ yarn test ${yourFileName}.e2e.js -``` - -测试结果将会在控制台显示。 +MD001: false +MD004: false +MD013: false +MD014: false +MD024: false +MD026: false +MD029: false +MD033: false +MD034: false +MD040: false +MD041: false diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000000..8a9f034306 --- /dev/null +++ b/.yamllint @@ -0,0 +1,8 @@ +--- + +extends: default + +rules: + document-start: false + line-length: false + truthy: false diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a3dc94fb9..0dc33234e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,14 +19,94 @@ # Table of Contents +- [2.3.0](#230) +- [2.2.0](#220) +- [2.1.1](#211) - [2.1.0](#210) - [2.0.0](#200) - [1.5.0](#150) - [1.0.0](#100) +# 2.3.0 + +### Core + +* Support to use absolute path in conf.WebDir. [#1055](https://github.com/apache/apisix-dashboard/pull/1055) +* Support to search route by label. [#1061](https://github.com/apache/apisix-dashboard/pull/1061) +* Support server info preview. [#958](https://github.com/apache/apisix-dashboard/pull/958) [#949](https://github.com/apache/apisix-dashboard/pull/949) +* Support custom port for Upstream module. [#1078](https://github.com/apache/apisix-dashboard/pull/1078) +* Support to show plugin type and other properties [#1111](https://github.com/apache/apisix-dashboard/pull/1111) +* Support websocket for Route module. [#1079](https://github.com/apache/apisix-dashboard/pull/1079) +* Support Service module on the frontend. [#1089](https://github.com/apache/apisix-dashboard/pull/1089) +* Support group for Route module. [#999](https://github.com/apache/apisix-dashboard/pull/999) +* Support Global Plugin. [#1057](https://github.com/apache/apisix-dashboard/pull/1057) [#1106](https://github.com/apache/apisix-dashboard/pull/1106) +* Support Version Manager. [#1157](https://github.com/apache/apisix-dashboard/pull/1157) +* Use Cobra as the cli scaffold. [#773](https://github.com/apache/apisix-dashboard/pull/773) +* Remove Lua dependency. [#1083](https://github.com/apache/apisix-dashboard/pull/1083) +* Improve E2E testcases for the backend. [#1012](https://github.com/apache/apisix-dashboard/pull/1012), [#1123](https://github.com/apache/apisix-dashboard/pull/1123) +* Improve E2E testcases for the frontend. [#1074](https://github.com/apache/apisix-dashboard/pull/1074) +* Improve online debug. [#979](https://github.com/apache/apisix-dashboard/pull/979) +* Improve Route publish/offline. [#1081](https://github.com/apache/apisix-dashboard/pull/1081) [#991](https://github.com/apache/apisix-dashboard/pull/991) +* Improve plugin module for the frontend. [#1047](https://github.com/apache/apisix-dashboard/pull/1047) [#978](https://github.com/apache/apisix-dashboard/pull/978) +* Fix error occurred when enable or disable existing SSL [#1064](https://github.com/apache/apisix-dashboard/pull/1064) +* Fix the problem that route created by Admin API (without ID) cannot be shown in Manager API. [#1063](https://github.com/apache/apisix-dashboard/pull/1063) + +# 2.2.0 + +This release mainly improve basic features, bugfix and adds test cases. + +`Manager API` 2.2 should be used with [Apache APISIX 2.1](https://github.com/apache/apisix/releases/tag/2.1). It is not recommended to use with other Apache APISIX versions. + +### Core + +- Support access log for Manager API. [#994](https://github.com/apache/apisix-dashboard/pull/994) +- Enhance error log for Manager API. [#977](https://github.com/apache/apisix-dashboard/pull/977) +- Integrate with code-mirror to have a fallback to plugins's render issue. [#898](https://github.com/apache/apisix-dashboard/pull/898) +- Support priority field in Route module. [#1006](https://github.com/apache/apisix-dashboard/pull/1006) +- Add etcd basic auth support [#951](https://github.com/apache/apisix-dashboard/pull/951) + +### Test case + +- Enhance e2e test cases for upstream. [#971](https://github.com/apache/apisix-dashboard/pull/971) [#972](https://github.com/apache/apisix-dashboard/pull/972) +- Refactor unit test for consumer handler. [#840](https://github.com/apache/apisix-dashboard/pull/840) + +## Bugfix + +- JSON schema verification should be performed on the original data submitted by the user. [#986](https://github.com/apache/apisix-dashboard/pull/986) +- fix PATCH method bug. [#1005](https://github.com/apache/apisix-dashboard/pull/1005) +- remove husky to resolve Docker Deploy failed. [#1018](https://github.com/apache/apisix-dashboard/pull/1018) + +For more changes, please refer to [Milestone](https://github.com/apache/apisix-dashboard/milestone/5). + +# 2.1.1 + +This release mainly adds test cases and bugfix for `Manager API`. + +`Manager API` 2.1.1 should be used with Apache APISIX 2.1. It is not recommended to use with other Apache APISIX versions. + +### Core + +**The default port of `Manager API` is changed from 8080 to 9000.** [#931](https://github.com/apache/apisix-dashboard/pull/931) + +### Test case + +Add e2e test cases for route, upstream, consumer, SSL, and plugins. + +## Bugfix + +- Fix: when created route by `Admin API`, upstream can not be modified by dashboard. [#847](https://github.com/apache/apisix-dashboard/pull/847) +- Fix: create route with jwt-auth will display an error. [#878](https://github.com/apache/apisix-dashboard/pull/878) +- Fix: create route with error format remote_addrs `Manager API` will return 200, but should return 400. [#899](https://github.com/apache/apisix-dashboard/pull/899) +- Fix: make field ID compatible with both string and int. [#902](https://github.com/apache/apisix-dashboard/pull/902) +- Fix: can't run `Manager API` in intranet env. [#947](https://github.com/apache/apisix-dashboard/pull/947) +- Fix: create a route through the dashboard, without filling in the client address, APISIX reports errors. [#948](https://github.com/apache/apisix-dashboard/pull/948) +- Fix: creates a route and enables redirect HTTPS on dashboard, and the browser reports an error when submitting. [#957](https://github.com/apache/apisix-dashboard/pull/957) + +For more changes, please refer to [Milestone](https://github.com/apache/apisix-dashboard/milestone/8). + # 2.1.0 -This release mainly adds test cases for manager-api. +This release mainly adds test cases for `Manager API`. ### Core @@ -41,8 +121,8 @@ This release mainly refactors the dashboard, omitting MySQL, improve test cases. ### Core -- Refactor frontend with Admin-API. -- Manager-API removes dependency on MySQL. +- Refactor frontend with `Admin API`. +- `Manager API` removes dependency on MySQL. - Support plugin orchestration. - Setting standards for frontend internationalization. - New deployment pattern. @@ -53,7 +133,7 @@ This release mainly refactors the dashboard, omitting MySQL, improve test cases. - Support log save to local file. - Optimize the deployment process. - Add E2E test examples to the frontend. [#619](https://github.com/apache/apisix-dashboard/pull/619) -- Fix the Promethues plugin updating incorrect values when updating routes. [#666](https://github.com/apache/apisix-dashboard/pull/666) +- Fix the Prometheus plugin updating incorrect values when updating routes. [#666](https://github.com/apache/apisix-dashboard/pull/666) - Fix page display exceptions when the Redirect option is selected as Enable HTTPS in the Route page. [#692](https://github.com/apache/apisix-dashboard/pull/692) For more changes, please refer to [Milestone](https://github.com/apache/apisix-dashboard/milestone/4) @@ -65,7 +145,7 @@ This release mainly refactors the dashboard. ### Core - Integrate with Ant Design Pro. [#263](https://github.com/apache/apisix-dashboard/pull/263) -- Added Manager API support to process logics between APISIX and Dashboard. +- Added `Manager API` support to process logics between APISIX and Dashboard. - Added Metrics/Route/SSL/Upstream/Consumer module. ## 1.0.0 diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md deleted file mode 100644 index 5cdfc6c1e7..0000000000 --- a/CHANGELOG.zh-CN.md +++ /dev/null @@ -1,83 +0,0 @@ - - -# 目录 -- [2.1.0](#210) -- [2.0.0](#200) -- [1.5.0](#150) -- [1.0.0](#100) - -# 2.1.0 - -该版本主要提升了 manager-api 的 E2E 测试。 - -### 核心 - -- 支持优雅退出。[#796](https://github.com/apache/apisix-dashboard/pull/796) -- 增加了后端 e2e 测试用例。[#810](https://github.com/apache/apisix-dashboard/pull/810) - -更多的变动可以参考[里程碑](https://github.com/apache/apisix-dashboard/milestone/7)。 - -# 2.0.0 - -该版本主要移除了 MySQL 并增加了 E2E 测试。 - -### 核心 - -- 前端根据新的 admin-api 进行重构。 -- 后端移除对 mysql 的依赖。 -- 支持插件编排模式。 -- 制定前端国际化标准。 -- Dashboard 新的部署方式。 -- 增加更多测试用例。 -- 文档增强。 -- 添加后端 E2E 测试例子。 -- 完善 CI 测试。 -- 支持日志保存到本地文件。 -- 优化部署流程。 -- 前端增加 E2E 测试例子。[#619](https://github.com/apache/apisix-dashboard/pull/619) -- 修复 Promethues 插件在更新路由时更新错误值的问题。[#666](https://github.com/apache/apisix-dashboard/pull/666) -- 修复在路由页面中重定向选项选择为 启用HTTPS 时页面显示异常的问题。[#692](https://github.com/apache/apisix-dashboard/pull/692) - - -更多的变动可以参考[里程碑](https://github.com/apache/apisix-dashboard/milestone/4) - -# 1.5.0 - -该版本主要完成 Dashboard 的重构工作。 - -### 核心 - -- 使用 Ant Design Pro 作为项目脚手架 [#263](https://github.com/apache/apisix-dashboard/pull/263)。 -- 增加了 manager-api 用于处理 APISIX 与 Dashboard 之间的逻辑。 -- 增加了监控、路由、证书、上游、Consumer 模块。 - -## 1.0.0 - -该版本主要增加了基本控制台并解决协议问题。 - -### Core - -- 初始化 Dashboard。 [#1](https://github.com/apache/apisix-dashboard/pull/1) -- 解决 License 问题。 -- 从脚手架内移除无用文件。 -- 为各个模块增加查询列表、创建、编辑、删除功能。 -- 增加了自定义配置插件表单。 - -[返回](#table-of-contents) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bfd8dac155..cc5979103b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,23 +19,30 @@ # Contributing to Apache APISIX Dashboard -Firstly, thanks for your interest in contributing! I hope that this will be a pleasant first experience for you, and that you will return to continue contributing. +We would love for you to contribute to Apache APISIX Dashboard and help make it even better than it is today! As a contributor, here are the guidelines we would like you to follow: -## Code of Conduct +- [Code of Conduct](#coc) +- [How to contribute?](#contribute) +- [How to report a bug?](#bug) +- [How to add a new feature?](#feature) +- [Commit Message Guidelines](#commit) +- [Question or Problem?](#question) + +## Code of Conduct This project and everyone participating in it is governed by the Apache software Foundation's [Code of Conduct](http://www.apache.org/foundation/policies/conduct.html). By participating, you are expected to adhere to this code. If you are aware of unacceptable behavior, please visit the [Reporting Guidelines page](http://www.apache.org/foundation/policies/conduct.html#reporting-guidelines) and follow the instructions there. -## How to contribute? +## How to contribute? Most of the contributions that we receive are code contributions, but you can also contribute to the documentation or simply report solid bugs for us to fix. -## How to report a bug? +## How to report a bug? - **Ensure the bug was not already reported** by searching on GitHub under [Issues](https://github.com/apache/apisix-dashboard/issues). - If you're unable to find an open issue addressing the problem, [open a new one](https://github.com/apache/apisix-dashboard/issues/new). Be sure to include a **title and clear description**, as much relevant information as possible, and a **code sample** or an **executable test case** demonstrating the expected behavior that is not occurring. -## How to add a new feature or change an existing one +## How to add a new feature or change an existing one _Before making any significant changes, please [open an issue](https://github.com/apache/apisix-dashboard/issues)._ Discussing your proposed changes ahead of time will make the contribution process smooth for everyone. @@ -46,6 +53,119 @@ Once we've discussed your changes and you've got your code ready, make sure that - References the original issue in description, e.g. "resolve #123". - Has a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). -## Do you have questions about the source code? +## Commit Message Format + +*This specification is inspired by and supersedes the [AngularJS commit message format][commit-message-format].* + +We have very precise rules over how our Git commit messages must be formatted. +This format leads to **easier to read commit history**. + +Each commit message consists of a **header**, a **body**, and a **footer**. + +``` +
+ + + +