Skip to content

Commit

Permalink
Merge branch 'master' into feature/cls-logger
Browse files Browse the repository at this point in the history
  • Loading branch information
spacewander authored Aug 18, 2022
2 parents c6b6e94 + 86e9a8e commit e3bff97
Show file tree
Hide file tree
Showing 208 changed files with 4,808 additions and 2,130 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- ubuntu-18.04
os_name:
- linux_openresty
- linux_openresty_1_17
- linux_openresty_1_19
test_dir:
- t/plugin
- t/admin t/cli t/config-center-yaml t/control t/core t/debug t/deployment t/discovery t/error_page t/misc
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/fuzzing-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,15 @@ jobs:
- name: install boofuzz
run: |
# Avoid "ERROR: flask has requirement click>=8.0, but you'll have click 7.0 which is incompatible"
sudo apt remove python3-click
pip install -r $PWD/t/fuzzing/requirements.txt
- name: run simpleroute test
- name: run tests
run: |
python $PWD/t/fuzzing/simpleroute_test.py
- name: run serverless route test
run: |
python $PWD/t/fuzzing/serverless_route_test.py
- name: run vars route test
run: |
python $PWD/t/fuzzing/vars_route_test.py
- name: run check leak test
run: |
python $PWD/t/fuzzing/client_abort.py
python $PWD/t/fuzzing/simple_http.py
python $PWD/t/fuzzing/http_upstream.py
2 changes: 1 addition & 1 deletion .github/workflows/kubernetes-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- ubuntu-18.04
os_name:
- linux_openresty
- linux_openresty_1_17
- linux_openresty_1_19

runs-on: ${{ matrix.platform }}
timeout-minutes: 15
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tars-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- ubuntu-18.04
os_name:
- linux_openresty
- linux_openresty_1_17
- linux_openresty_1_19

runs-on: ${{ matrix.platform }}
timeout-minutes: 15
Expand Down
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,19 @@ install: runtime
$(ENV_INSTALL) conf/debug.yaml /usr/local/apisix/conf/debug.yaml
$(ENV_INSTALL) conf/cert/* /usr/local/apisix/conf/cert/

# Lua directories listed in alphabetical order
# directories listed in alphabetical order
$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix
$(ENV_INSTALL) apisix/*.lua $(ENV_INST_LUADIR)/apisix/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/include/apisix/model
$(ENV_INSTALL) apisix/include/apisix/model/*.proto $(ENV_INST_LUADIR)/apisix/include/apisix/model/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/admin
$(ENV_INSTALL) apisix/admin/*.lua $(ENV_INST_LUADIR)/apisix/admin/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/balancer
$(ENV_INSTALL) apisix/balancer/*.lua $(ENV_INST_LUADIR)/apisix/balancer/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/cli
$(ENV_INSTALL) apisix/cli/*.lua $(ENV_INST_LUADIR)/apisix/cli/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/control
$(ENV_INSTALL) apisix/control/*.lua $(ENV_INST_LUADIR)/apisix/control/

Expand All @@ -281,34 +281,34 @@ install: runtime
$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/core/dns
$(ENV_INSTALL) apisix/core/dns/*.lua $(ENV_INST_LUADIR)/apisix/core/dns

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/cli
$(ENV_INSTALL) apisix/cli/*.lua $(ENV_INST_LUADIR)/apisix/cli/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/discovery
$(ENV_INSTALL) apisix/discovery/*.lua $(ENV_INST_LUADIR)/apisix/discovery/
$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/discovery/{consul_kv,dns,eureka,nacos,kubernetes,tars}
$(ENV_INSTALL) apisix/discovery/consul_kv/*.lua $(ENV_INST_LUADIR)/apisix/discovery/consul_kv
$(ENV_INSTALL) apisix/discovery/dns/*.lua $(ENV_INST_LUADIR)/apisix/discovery/dns
$(ENV_INSTALL) apisix/discovery/eureka/*.lua $(ENV_INST_LUADIR)/apisix/discovery/eureka
$(ENV_INSTALL) apisix/discovery/nacos/*.lua $(ENV_INST_LUADIR)/apisix/discovery/nacos
$(ENV_INSTALL) apisix/discovery/kubernetes/*.lua $(ENV_INST_LUADIR)/apisix/discovery/kubernetes
$(ENV_INSTALL) apisix/discovery/nacos/*.lua $(ENV_INST_LUADIR)/apisix/discovery/nacos
$(ENV_INSTALL) apisix/discovery/tars/*.lua $(ENV_INST_LUADIR)/apisix/discovery/tars

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/pubsub
$(ENV_INSTALL) apisix/pubsub/*.lua $(ENV_INST_LUADIR)/apisix/pubsub/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/http
$(ENV_INSTALL) apisix/http/*.lua $(ENV_INST_LUADIR)/apisix/http/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/http/router
$(ENV_INSTALL) apisix/http/router/*.lua $(ENV_INST_LUADIR)/apisix/http/router/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/include/apisix/model
$(ENV_INSTALL) apisix/include/apisix/model/*.proto $(ENV_INST_LUADIR)/apisix/include/apisix/model/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/plugins
$(ENV_INSTALL) apisix/plugins/*.lua $(ENV_INST_LUADIR)/apisix/plugins/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/plugins/ext-plugin
$(ENV_INSTALL) apisix/plugins/ext-plugin/*.lua $(ENV_INST_LUADIR)/apisix/plugins/ext-plugin/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/plugins/google-cloud-logging
$(ENV_INSTALL) apisix/plugins/google-cloud-logging/*.lua $(ENV_INST_LUADIR)/apisix/plugins/google-cloud-logging/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/plugins/grpc-transcode
$(ENV_INSTALL) apisix/plugins/grpc-transcode/*.lua $(ENV_INST_LUADIR)/apisix/plugins/grpc-transcode/

Expand All @@ -321,9 +321,6 @@ install: runtime
$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/plugins/limit-count
$(ENV_INSTALL) apisix/plugins/limit-count/*.lua $(ENV_INST_LUADIR)/apisix/plugins/limit-count/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/plugins/google-cloud-logging
$(ENV_INSTALL) apisix/plugins/google-cloud-logging/*.lua $(ENV_INST_LUADIR)/apisix/plugins/google-cloud-logging/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/plugins/opa
$(ENV_INSTALL) apisix/plugins/opa/*.lua $(ENV_INST_LUADIR)/apisix/plugins/opa/

Expand All @@ -344,6 +341,9 @@ install: runtime

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/plugins/tencent-cloud-cls
$(ENV_INSTALL) apisix/plugins/tencent-cloud-cls/*.lua $(ENV_INST_LUADIR)/apisix/plugins/tencent-cloud-cls/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/pubsub
$(ENV_INSTALL) apisix/pubsub/*.lua $(ENV_INST_LUADIR)/apisix/pubsub/

$(ENV_INSTALL) -d $(ENV_INST_LUADIR)/apisix/plugins/zipkin
$(ENV_INSTALL) apisix/plugins/zipkin/*.lua $(ENV_INST_LUADIR)/apisix/plugins/zipkin/
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The technical architecture of Apache APISIX:

- Mailing List: Mail to dev-subscribe@apisix.apache.org, follow the reply to subscribe to the mailing list.
- QQ Group - 552030619, 781365357
- Slack Workspace - [invitation link](https://join.slack.com/t/the-asf/shared_invite/zt-vlfbf7ch-HkbNHiU_uDlcH_RvaHv9gQ) (Please open an [issue](https://apisix.apache.org/docs/general/submit-issue) if this link is expired), and then join the #apisix channel (Channels -> Browse channels -> search for "apisix").
- Slack Workspace - [invitation link](https://join.slack.com/t/the-asf/shared_invite/zt-1egxjz7lw-lWl142XNDopj4FlqNMUM5g) (Please open an [issue](https://apisix.apache.org/docs/general/submit-issue) if this link is expired), and then join the #apisix channel (Channels -> Browse channels -> search for "apisix").
- ![Twitter Follow](https://img.shields.io/twitter/follow/ApacheAPISIX?style=social) - follow and interact with us using hashtag `#ApacheAPISIX`
- [Documentation](https://apisix.apache.org/docs/)
- [Discussions](https://github.com/apache/apisix/discussions)
Expand Down Expand Up @@ -199,7 +199,7 @@ Using AWS's eight-core server, APISIX's QPS reaches 140,000 with a latency of on

- [European eFactory Platform: API Security Gateway – Using APISIX in the eFactory Platform](https://www.efactory-project.eu/post/api-security-gateway-using-apisix-in-the-efactory-platform)
- [Copernicus Reference System Software](https://github.com/COPRS/infrastructure/wiki/Networking-trade-off)
- [More Stories](https://apisix.apache.org/blog/tags/user-case)
- [More Stories](https://apisix.apache.org/blog/tags/case-studies/)

## Who Uses APISIX API Gateway?

Expand Down
40 changes: 40 additions & 0 deletions Vision-and-Milestones.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!--
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
-->

### Vision

Apache APISIX is an open source API gateway designed to help developers connect any APIs securely and efficiently in any environment.

Managing thousands or tens of thousands of APIs and microservices in a multi-cloud and hybrid cloud environment is not an easy task.
There will be many challenges as authentication, observability, security, etc.

Apache APISIX, a community-driven project, hopes to help everyone better manage and use APIs through the power of developers.
Every developer's contribution will used by thousands of companies and served by billions of users.

### Milestones

Apache APISIX has relatively complete features for north-south traffic,
and will be iterated around the following directions in the next 6 months (if you have any ideas, feel free to create issue to discuss):

- More complete support for Gateway API on APISIX ingress controller
- Add support for service mesh
- User-friendly documentation
- More plugins for public cloud and SaaS services
- Java/Go plugins and Wasm production-ready
- Add dynamic debugging tools for Apache APISIX
2 changes: 2 additions & 0 deletions apisix/admin/consumers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ local core = require("apisix.core")
local plugins = require("apisix.admin.plugins")
local utils = require("apisix.admin.utils")
local plugin = require("apisix.plugin")
local v3_adapter = require("apisix.admin.v3_adapter")
local pairs = pairs

local _M = {
Expand Down Expand Up @@ -102,6 +103,7 @@ function _M.get(consumer_name)
end

utils.fix_count(res.body, consumer_name)
v3_adapter.filter(res.body)
return res.status, res.body
end

Expand Down
2 changes: 2 additions & 0 deletions apisix/admin/global_rules.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
local core = require("apisix.core")
local utils = require("apisix.admin.utils")
local schema_plugin = require("apisix.admin.plugins").check_schema
local v3_adapter = require("apisix.admin.v3_adapter")
local type = type
local tostring = tostring

Expand Down Expand Up @@ -97,6 +98,7 @@ function _M.get(id)
end

utils.fix_count(res.body, id)
v3_adapter.filter(res.body)
return res.status, res.body
end

Expand Down
10 changes: 8 additions & 2 deletions apisix/admin/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ local require = require
local core = require("apisix.core")
local route = require("apisix.utils.router")
local plugin = require("apisix.plugin")
local v3_adapter = require("apisix.admin.v3_adapter")
local ngx = ngx
local get_method = ngx.req.get_method
local ngx_time = ngx.time
Expand Down Expand Up @@ -46,9 +47,9 @@ local resources = {
upstreams = require("apisix.admin.upstreams"),
consumers = require("apisix.admin.consumers"),
schema = require("apisix.admin.schema"),
ssl = require("apisix.admin.ssl"),
ssls = require("apisix.admin.ssl"),
plugins = require("apisix.admin.plugins"),
proto = require("apisix.admin.proto"),
protos = require("apisix.admin.proto"),
global_rules = require("apisix.admin.global_rules"),
stream_routes = require("apisix.admin.stream_routes"),
plugin_metadata = require("apisix.admin.plugin_metadata"),
Expand Down Expand Up @@ -186,6 +187,11 @@ local function run()
local code, data = resource[method](seg_id, req_body, seg_sub_path,
uri_args)
if code then
if v3_adapter.enable_v3() then
core.response.set_header("X-API-VERSION", "v3")
else
core.response.set_header("X-API-VERSION", "v2")
end
data = strip_etcd_resp(data)
core.response.exit(code, data)
end
Expand Down
2 changes: 2 additions & 0 deletions apisix/admin/plugin_config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ local core = require("apisix.core")
local get_routes = require("apisix.router").http_routes
local utils = require("apisix.admin.utils")
local schema_plugin = require("apisix.admin.plugins").check_schema
local v3_adapter = require("apisix.admin.v3_adapter")
local type = type
local tostring = tostring
local ipairs = ipairs
Expand Down Expand Up @@ -97,6 +98,7 @@ function _M.get(id)
end

utils.fix_count(res.body, id)
v3_adapter.filter(res.body)
return res.status, res.body
end

Expand Down
10 changes: 6 additions & 4 deletions apisix/admin/proto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ local utils = require("apisix.admin.utils")
local get_routes = require("apisix.router").http_routes
local get_services = require("apisix.http.service").services
local compile_proto = require("apisix.plugins.grpc-transcode.proto").compile_proto
local v3_adapter = require("apisix.admin.v3_adapter")
local tostring = tostring


Expand Down Expand Up @@ -69,7 +70,7 @@ function _M.put(id, conf)
return 400, err
end

local key = "/proto/" .. id
local key = "/protos/" .. id

local ok, err = utils.inject_conf_with_prev_conf("proto", key, conf)
if not ok then
Expand All @@ -87,7 +88,7 @@ end


function _M.get(id)
local key = "/proto"
local key = "/protos"
if id then
key = key .. "/" .. id
end
Expand All @@ -99,6 +100,7 @@ function _M.get(id)
end

utils.fix_count(res.body, id)
v3_adapter.filter(res.body)
return res.status, res.body
end

Expand All @@ -109,7 +111,7 @@ function _M.post(id, conf)
return 400, err
end

local key = "/proto"
local key = "/protos"
utils.inject_timestamp(conf)
local res, err = core.etcd.push(key, conf)
if not res then
Expand Down Expand Up @@ -181,7 +183,7 @@ function _M.delete(id)
end
core.log.info("proto delete service ref check pass: ", id)

local key = "/proto/" .. id
local key = "/protos/" .. id
-- core.log.info("key: ", key)
local res, err = core.etcd.delete(key)
if not res then
Expand Down
2 changes: 2 additions & 0 deletions apisix/admin/routes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ local core = require("apisix.core")
local apisix_upstream = require("apisix.upstream")
local schema_plugin = require("apisix.admin.plugins").check_schema
local utils = require("apisix.admin.utils")
local v3_adapter = require("apisix.admin.v3_adapter")
local tostring = tostring
local type = type
local loadstring = loadstring
Expand Down Expand Up @@ -203,6 +204,7 @@ function _M.get(id)
end

utils.fix_count(res.body, id)
v3_adapter.filter(res.body)
return res.status, res.body
end

Expand Down
2 changes: 2 additions & 0 deletions apisix/admin/services.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ local get_routes = require("apisix.router").http_routes
local apisix_upstream = require("apisix.upstream")
local schema_plugin = require("apisix.admin.plugins").check_schema
local utils = require("apisix.admin.utils")
local v3_adapter = require("apisix.admin.v3_adapter")
local tostring = tostring
local ipairs = ipairs
local type = type
Expand Down Expand Up @@ -146,6 +147,7 @@ function _M.get(id)
end

utils.fix_count(res.body, id)
v3_adapter.filter(res.body)
return res.status, res.body
end

Expand Down
Loading

0 comments on commit e3bff97

Please sign in to comment.