[GitHub] [apisix] 123liubao opened a new pull request #6275: fix: correct the 'article' to 'documentation' in Getting started.
123liubao opened a new pull request #6275: URL: https://github.com/apache/apisix/pull/6275 ### What this PR does / why we need it: Correct the 'article' to 'documentation' in Getting started. fix: https://github.com/apache/apisix-website/issues/866 ### Pre-submission checklist: * [x] Did you explain what problem does this PR solve? Or what new features have been added? * [ ] Have you added corresponding test cases? * [x] Have you modified the corresponding document? * [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first** -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 opened a new issue #856: bug: when some features in APISIX are disabled, the shared context will cause some exceptions
tao12345666333 opened a new issue #856: URL: https://github.com/apache/apisix-ingress-controller/issues/856 * When the APISIX Ingress controller synchronizes data, it is expected that all resources can be successfully synchronized (in this issue, resources such as stream_routes will inevitably fail because stream_proxy is not configured, but APISIX Ingress congtroller does not handle this situation. It's a bug. _Originally posted by @tao12345666333 in https://github.com/apache/apisix-ingress-controller/issues/851#issuecomment-1026944206_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tokers commented on issue #6268: request help: Could it be interesting to implement cookie/session management in APISIX?
tokers commented on issue #6268: URL: https://github.com/apache/apisix/issues/6268#issuecomment-1033544993 @WeiWANG0118 By saying "cookie/session management", could you describe it in more detail? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] membphis merged pull request #6274: chore: enable new QQ group
membphis merged pull request #6274: URL: https://github.com/apache/apisix/pull/6274 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[apisix] branch master updated: doc: add new QQ group (#6274)
This is an automated email from the ASF dual-hosted git repository. membphis pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/apisix.git The following commit(s) were added to refs/heads/master by this push: new ba50e79 doc: add new QQ group (#6274) ba50e79 is described below commit ba50e79bfbed1427b0dc98a097a6990407c20b6a Author: tzssangglass AuthorDate: Wed Feb 9 18:19:35 2022 +0800 doc: add new QQ group (#6274) --- CONTRIBUTING.md | 2 +- README.md| 2 +- docs/zh/latest/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d528a60..152d590 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -137,5 +137,5 @@ If you have contributed to Apache APISIX, no matter it is a code contribution to ## Do you have questions about the source code? -- **QQ Group**: 578997126(recommended), 552030619 +- **QQ Group**: 781365357(recommended), 578997126, 552030619 - Join in `apisix` channel at [Apache Slack](http://s.apache.org/slack-invite). If the link is not working, find the latest one at [Apache INFRA WIKI](https://cwiki.apache.org/confluence/display/INFRA/Slack+Guest+Invites). diff --git a/README.md b/README.md index 951bbb9..27a0d08 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ The technical architecture of Apache APISIX: ## Community - Mailing List: Mail to dev-subscr...@apisix.apache.org, follow the reply to subscribe to the mailing list. -- QQ Group - 578997126 +- QQ Group - 781365357 - Slack Workspace - Please [subscribe the mailing list](https://apisix.apache.org/docs/general/subscribe-guide) then ask for invitation link - ![Twitter Follow](https://img.shields.io/twitter/follow/ApacheAPISIX?style=social) - follow and interact with us using hashtag `#ApacheAPISIX` - [bilibili video](https://space.bilibili.com/551921247) diff --git a/docs/zh/latest/README.md b/docs/zh/latest/README.md index 98f33c9..7e446bd 100644 --- a/docs/zh/latest/README.md +++ b/docs/zh/latest/README.md @@ -39,7 +39,7 @@ Apache APISIX 的技术架构如下图所示: ## 社区 - 邮件列表 - 发送任意内容到 dev-subscr...@apisix.apache.org 后,根据回复以订阅邮件列表。 -- QQ 群 - 578997126 +- QQ 群 - 781365357 - Slack - 请 [订阅邮件列表](https://apisix.apache.org/docs/general/subscribe-guide) 后发送邮件获取邀请链接 - ![Twitter Follow](https://img.shields.io/twitter/follow/ApacheAPISIX?style=social) - 使用标签 `#ApacheAPISIX` 关注我们并与我们互动。 - [哔哩哔哩](https://space.bilibili.com/551921247)
[apisix] branch master updated (ba50e79 -> fec4714)
This is an automated email from the ASF dual-hosted git repository. spacewander pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/apisix.git. from ba50e79 doc: add new QQ group (#6274) add fec4714 feat(oidc): make it possible to validate tokens against provider host… (#5449) No new revisions were added by this update. Summary of changes: apisix/plugins/openid-connect.lua| 7 +- docs/en/latest/plugins/openid-connect.md | 15 +-- t/plugin/openid-connect.t| 178 +++ 3 files changed, 192 insertions(+), 8 deletions(-)
[GitHub] [apisix] spacewander closed issue #5425: request help: How to best handle oidc providers that do not support introspection endpoints?
spacewander closed issue #5425: URL: https://github.com/apache/apisix/issues/5425 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander merged pull request #5449: feat(oidc): make it possible to validate tokens against provider host…
spacewander merged pull request #5449: URL: https://github.com/apache/apisix/pull/5449 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[apisix] branch master updated: feat(grpc-transcode): support .pb file (#6264)
This is an automated email from the ASF dual-hosted git repository. spacewander pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/apisix.git The following commit(s) were added to refs/heads/master by this push: new 6558ba5 feat(grpc-transcode): support .pb file (#6264) 6558ba5 is described below commit 6558ba519c304324b84a6364ac4f5fd6be79ffa9 Author: 罗泽轩 AuthorDate: Wed Feb 9 19:53:19 2022 +0800 feat(grpc-transcode): support .pb file (#6264) --- apisix/plugins/grpc-transcode/proto.lua | 70 +++--- apisix/plugins/grpc-transcode/util.lua | 13 ++- docs/en/latest/plugins/grpc-transcode.md | 63 - docs/zh/latest/plugins/grpc-transcode.md | 63 - rockspec/apisix-master-0.rockspec| 2 +- t/grpc_server_example| 2 +- t/plugin/grpc-transcode2.t | 152 +++ 7 files changed, 343 insertions(+), 22 deletions(-) diff --git a/apisix/plugins/grpc-transcode/proto.lua b/apisix/plugins/grpc-transcode/proto.lua index de19be2..e997b55 100644 --- a/apisix/plugins/grpc-transcode/proto.lua +++ b/apisix/plugins/grpc-transcode/proto.lua @@ -14,25 +14,23 @@ -- See the License for the specific language governing permissions and -- limitations under the License. -- -local core= require("apisix.core") -local config_util = require("apisix.core.config_util") -local pb = require("pb") -local protoc = require("protoc") -local pcall = pcall -local ipairs = ipairs -local protos +local core = require("apisix.core") +local config_util = require("apisix.core.config_util") +local pb= require("pb") +local protoc= require("protoc") +local pcall = pcall +local ipairs= ipairs +local decode_base64 = ngx.decode_base64 +local protos local lrucache_proto = core.lrucache.new({ ttl = 300, count = 100 }) local proto_fake_file = "filename for loaded" -local function compile_proto(content) --- clear pb state -pb.state(nil) - +local function compile_proto_text(content) protoc.reload() local _p = protoc.new() -- the loaded proto won't appears in _p.loaded without a file name after lua-protobuf=0.3.2, @@ -50,8 +48,6 @@ local function compile_proto(content) end local compiled = _p.loaded --- fetch pb state -compiled.pb_state = pb.state(nil) local index = {} for _, s in ipairs(compiled[proto_fake_file].service or {}) do @@ -69,6 +65,54 @@ local function compile_proto(content) end +local function compile_proto_bin(content) +content = decode_base64(content) +if not content then +return nil +end + +-- pb.load doesn't return err +local ok = pb.load(content) +if not ok then +return nil +end + +local index = {} +for name, _, methods in pb.services() do +local method_index = {} +for _, m in ipairs(methods) do +method_index[m.name] = m +end +-- remove the prefix '.' +index[name:sub(2)] = method_index +end + +local compiled = {} +compiled[proto_fake_file] = {} +compiled[proto_fake_file].index = index + +return compiled +end + + +local function compile_proto(content) +-- clear pb state +pb.state(nil) + +local compiled, err = compile_proto_text(content) +if not compiled then +compiled = compile_proto_bin(content) +if not compiled then +return nil, err +end +end + +-- fetch pb state +compiled.pb_state = pb.state(nil) +return compiled +end + + local _M = { version = 0.1, compile_proto = compile_proto, diff --git a/apisix/plugins/grpc-transcode/util.lua b/apisix/plugins/grpc-transcode/util.lua index 18c9f78..2a7bfb6 100644 --- a/apisix/plugins/grpc-transcode/util.lua +++ b/apisix/plugins/grpc-transcode/util.lua @@ -27,23 +27,26 @@ local type = type local _M = {version = 0.1} -function _M.find_method(protos, service, method) -local loaded = protos[proto_fake_file] -if not loaded or type(loaded) ~= "table" then +function _M.find_method(proto, service, method) +local loaded = proto[proto_fake_file] +if type(loaded) ~= "table" then +core.log.error("compiled proto not found") return nil end -if not loaded.index[service] or type(loaded.index[service]) ~= "table" then +if type(loaded.index[service]) ~= "table" then +core.log.error("compiled proto service not found") return nil end local res = loaded.index[service][method] if not res then +core.log.error("compiled proto method not found") return nil end -- restore pb state -pb.state(protos.pb_state) +pb.state(proto.pb_state) return res end diff --git a/docs/en/latest/plugins/grpc-transcode.md b/docs/en/latest/plugins/grpc-transcode.md index 2f576ef..206169e 100644 --- a/d
[GitHub] [apisix] spacewander merged pull request #6264: feat(grpc-transcode): support .pb file
spacewander merged pull request #6264: URL: https://github.com/apache/apisix/pull/6264 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[apisix] branch master updated (6558ba5 -> 03324ee)
This is an automated email from the ASF dual-hosted git repository. spacewander pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/apisix.git. from 6558ba5 feat(grpc-transcode): support .pb file (#6264) add 03324ee fix(config_etcd): skip resync_delay while etcd watch timeout (#6259) No new revisions were added by this update. Summary of changes: apisix/core/config_etcd.lua | 5 - t/core/etcd-sync.t | 1 - 2 files changed, 4 insertions(+), 2 deletions(-)
[GitHub] [apisix] spacewander merged pull request #6259: fix(config_etcd): skip resync_delay while etcd watch timeout
spacewander merged pull request #6259: URL: https://github.com/apache/apisix/pull/6259 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander merged pull request #6241: refactor: mv the var mqtt_client_id to plugin level
spacewander merged pull request #6241: URL: https://github.com/apache/apisix/pull/6241 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[apisix] branch master updated (03324ee -> e9e53e8)
This is an automated email from the ASF dual-hosted git repository. spacewander pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/apisix.git. from 03324ee fix(config_etcd): skip resync_delay while etcd watch timeout (#6259) add e9e53e8 refactor: mv the var mqtt_client_id to plugin level (#6241) No new revisions were added by this update. Summary of changes: apisix/core/ctx.lua | 5 - apisix/stream/plugins/mqtt-proxy.lua | 5 + docs/en/latest/apisix-variable.md| 26 +- 3 files changed, 18 insertions(+), 18 deletions(-)
[apisix] branch master updated (e9e53e8 -> defafb1)
This is an automated email from the ASF dual-hosted git repository. spacewander pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/apisix.git. from e9e53e8 refactor: mv the var mqtt_client_id to plugin level (#6241) add defafb1 fix(nacos): add complex password support for nacos `host_pattern` match rule (#6261) No new revisions were added by this update. Summary of changes: apisix/discovery/nacos/schema.lua | 2 +- t/discovery/nacos2.t | 30 ++ 2 files changed, 31 insertions(+), 1 deletion(-)
[GitHub] [apisix] spacewander merged pull request #6261: fix(nacos): add complex password support for nacos `host_pattern` match rule
spacewander merged pull request #6261: URL: https://github.com/apache/apisix/pull/6261 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander closed issue #6206: bug: nacos discovery config valid error when using special character password symbol in config.yaml
spacewander closed issue #6206: URL: https://github.com/apache/apisix/issues/6206 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] HelloBug0 commented on issue #6197: request help: How to current limit both in minutes and day by using plugin limit-count
HelloBug0 commented on issue #6197: URL: https://github.com/apache/apisix/issues/6197#issuecomment-1033689645 @123libohan -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #856: bug: when some features in APISIX are disabled, the shared context will cause some exceptions
tao12345666333 commented on issue #856: URL: https://github.com/apache/apisix-ingress-controller/issues/856#issuecomment-1033692432 cc @lingsamuel -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander commented on a change in pull request #5940: feat: mocking plugin
spacewander commented on a change in pull request #5940: URL: https://github.com/apache/apisix/pull/5940#discussion_r802590061 ## File path: apisix/plugins/mocking.lua ## @@ -0,0 +1,230 @@ +-- +-- 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. +-- +local core = require("apisix.core") +local ngx = ngx +local xml2lua = require("xml2lua") +local string = string +local type = type +local table = table +local math = math +local pairs = pairs +local ngx_re = ngx.re +local json = core.json + +local schema = { +type = "object", +properties = { +-- specify response delay time,default 0ms +delay = { type = "integer", default = 0 }, +-- specify response status,default 200 +response_status = { type = "integer", default = 200, minimum = 100 }, +-- specify response content type, support application/xml, text/plain +-- and application/json, default application/json +content_type = { type = "string", default = "application/json;charset=utf8" }, +-- specify response body. +response_example = { type = "string" }, +-- specify response json schema, if response_example is not nil, this conf will be ignore. +-- generate random response by json schema. +response_schema = { type = "object" }, +with_mock_header = { type = "boolean", default = true } +}, +anyOf = { +{ required = { "response_example" } }, +{ required = { "response_schema" } } +} +} + +local _M = { +version = 0.1, +priority = 9900, +name = "mocking", +schema = schema, +} + +local function parse_content_type(content_type) +if not content_type then +return "" +end +local m = ngx_re.match(content_type, "([ -~]*);([ -~]*)") +if m and #m == 2 then +return m[1], m[2] +end +return content_type +end + + +function _M.check_schema(conf) +local ok, err = core.schema.check(schema, conf) +if not ok then +return false, err +end + +local typ = parse_content_type(conf.content_type) +local support_content_type = { +["application/xml"] = true, +["application/json"] = true, +["text/plain"] = true, +["text/html"] = true, +["text/xml"] = true +} +if not support_content_type[typ] then +return false, "unsupported content type!" +end +return true +end + + +local function gen_string(example) +if example and type(example) == "string" then +return example +end +local n = math.random(1, 10) +local list = {} +for i = 1, n do +table.insert(list, string.char(math.random(97, 122))) +end +return table.concat(list) +end + + +local function gen_number(example) +if example and type(example) == "number" then +return example +end +return math.random() * 1 +end + + +local function gen_integer(example) +if example and type(example) == "number" then +return math.floor(example) +end +return math.random(1, 1) +end + + +local function gen_boolean(example) +if example and type(example) == "boolean" then +return example +end +local r = math.random(0, 1) +if r == 0 then +return false +end +return true +end + + +local function gen_base(property) +local typ = string.lower(property.type) +local example = property.example +if typ == "string" then +return gen_string(example) +end + +if typ == "number" then +return gen_number(example) +end + +if typ == "integer" then +return gen_integer(example) +end + +if typ == "boolean" then +return gen_boolean(example) +end +return nil +end + + +local gen_array, gen_object + +function gen_array(property) +local output = {} +if property.items == nil then +return nil +end +local v = property.items +local n = math.random(1, 3) +local typ = string.lower(v.type) +for i = 1, n do +if typ == "array" then +table.insert(output, gen_array(v)) Review comment: We can refactor this part and use a function that turns typ into the generated data. ## File path: conf/config
[GitHub] [apisix] spacewander commented on a change in pull request #6213: docs: added cpanm installation commands and remove $ sign
spacewander commented on a change in pull request #6213: URL: https://github.com/apache/apisix/pull/6213#discussion_r802598291 ## File path: docs/en/latest/how-to-build.md ## @@ -185,23 +185,29 @@ Run the `apisix help` command to see the returned results and get commands and d ```shell # more actions find by `help` -$ apisix help +apisix help ``` ## Step 4: Run Test Cases 1. Install `cpanminus`, the package manager for `perl`. +```shell +cd /bin +curl -L https://cpanmin.us/ -o cpanm Review comment: Don't we need sudo to write a file under `/bin`? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] HelloBug0 commented on issue #5966: doc: benchmark results is not so good,what is the problem,help
HelloBug0 commented on issue #5966: URL: https://github.com/apache/apisix/issues/5966#issuecomment-1033698209 Does this PR mean apisix can generate flame diagrm audomatically? How can I trigger it? @tzssangglass -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tzssangglass commented on issue #5966: doc: benchmark results is not so good,what is the problem,help
tzssangglass commented on issue #5966: URL: https://github.com/apache/apisix/issues/5966#issuecomment-1033709498 > Does this PR mean apisix can generate flame diagrm audomatically? How can I trigger it? @tzssangglass this PR is in progress -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 opened a new issue #857: e2e test: ApisixClusterConfig enable prometheus failed
tao12345666333 opened a new issue #857: URL: https://github.com/apache/apisix-ingress-controller/issues/857 ``` • Failure [33.545 seconds] ApisixClusterConfig /home/runner/work/apisix-ingress-controller/apisix-ingress-controller/test/e2e/features/global_rule.go:27 enable prometheus [It] /home/runner/work/apisix-ingress-controller/apisix-ingress-controller/test/e2e/features/global_rule.go:37 Error Trace:reporter.go:23 reporter.go:23 chain.go:21 response.go:585 response.go:151 global_rule.go:68 runner.go:113 runner.go:64 it_node.go:26 spec.go:215 spec.go:138 spec_runner.go:200 spec_runner.go:170 spec_runner.go:66 suite.go:79 ginkgo_dsl.go:238 ginkgo_dsl.go:213 e2e_test.go:26 Error: Error Trace:reporter.go:23 chain.go:21 response.go:585 response.go:151 global_rule.go:68 runner.go:113 runner.go:64 it_node.go:26 spec.go:215 spec.go:138 spec_runner.go:200 spec_runner.go:170 spec_runner.go:66 suite.go:79 ginkgo_dsl.go:238 ginkgo_dsl.go:213 e2e_test.go:26 Error: expected status equal to: "200 OK" but got: "404 Not Found" Test: ApisixClusterConfig enable prometheus /home/runner/go/pkg/mod/github.com/gavv/httpexpect/v2@v2.2.0/reporter.go:23 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-ingress-controller] tutuV opened a new issue #858: bug: there are error logs for stream_routes
tutuV opened a new issue #858: URL: https://github.com/apache/apisix-ingress-controller/issues/858 ### Issue description apisix pod: [warn] 45#45: *18736 [lua] init.lua:144: handler(): stream mode is disabled, can not add any stream routes, client: 10.1.11.197, server: , request: "GET /apisix/admin/stream_routes HTTP/1.1", host: "apisix-admin.apisix.svc.cluster.local:9180" ingress-controller pod: error apisix/cluster.go:223 failed to list stream_routes in APISIX: unexpected status code 400; error message: {"error_msg":"stream mode is disabled, can not add stream routes"} ### Environment apisix-helm-chart 0.8.1 eks 1.21.1 ### Minimal test code / Steps to reproduce Apisix installation command: helm install apisix apisix \ -f apisix/values.yaml \ --set apisix.replicaCount=2 \ --set gateway.type=LoadBalancer \ --set gateway.tls.enabled=true \ --set gateway.stream.enabled=false \ --set admin.allow.ipList="{0.0.0.0/0}" \ --set etcd.enabled=true \ --set etcd.persistence.enabled=false \ --set ingress-controller.enabled=true \ --set ingress-controller.config.apisix.serviceNamespace=apisix \ --set ingress-controller.config.kubernetes.apisixRouteVersion="apisix.apache.org/v2beta1" \ --set dashboard.enabled=true \ --namespace apisix ### Actual result the logs always have error ### Error log apisix pod: [warn] 45#45: *18736 [lua] init.lua:144: handler(): stream mode is disabled, can not add any stream routes, client: 10.1.11.197, server: , request: "GET /apisix/admin/stream_routes HTTP/1.1", host: "apisix-admin.apisix.svc.cluster.local:9180" ingress-controller pod: error apisix/cluster.go:223 failed to list stream_routes in APISIX: unexpected status code 400; error message: {"error_msg":"stream mode is disabled, can not add stream routes"} ### Expected result _No response_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] bisakhmondal commented on a change in pull request #5940: feat: mocking plugin
bisakhmondal commented on a change in pull request #5940: URL: https://github.com/apache/apisix/pull/5940#discussion_r802626941 ## File path: t/plugin/mocking.t ## @@ -0,0 +1,402 @@ +# +# 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. +# +BEGIN { +if ($ENV{TEST_NGINX_CHECK_LEAK}) { +$SkipReason = "unavailable for the hup tests"; + +} else { +$ENV{TEST_NGINX_USE_HUP} = 1; +undef $ENV{TEST_NGINX_USE_STAP}; +} +} + +use t::APISIX 'no_plan'; + +repeat_each(1); +no_long_string(); +no_shuffle(); +no_root_location(); +log_level('info'); +run_tests; + +__DATA__ + +=== TEST 1: set route(return response example:"hello world") +--- config + location /t { + content_by_lua_block { + local t = require("lib.test_admin").test + local code, body = t('/apisix/admin/routes/1', +ngx.HTTP_PUT, +[[{ + "plugins": { + "mocking": { + "delay": 1, + "content_type": "text/plain", + "response_status": 200, + "response_example": "hello world" + } + }, + "uri": "/hello" + }]] + ) + + if code >= 300 then + ngx.status = code + end + ngx.say(body) + } + } +--- request +GET /t +--- error_code: 200 +--- response_body +passed +--- no_error_log Review comment: Hi @Drery, It seems I somehow missed your ping, really sorry for that. It's really simple. Do give it a try, I can guide you. A bit of context: here we are using Perl scripting (a [fork](https://github.com/iresty/test-nginx) of test-nginx framework). As you can see the location path for each test is `/t` - we don't need to define `--- request` block for every unit tests. Instead we can manually inject it at the very beginning. What the block actually does (see my inline comments)? ```perl add_block_preprocessor(sub { my ($block) = @_; # this snippet sets the `request` field if not set from an unit test. also it gives you the flexibility to override in certain tests (say POST, PUT etc) if (!$block->request) { $block->set_value("request", "GET /t"); } # here also, you don't have to manually put `--- no_error_log` block for each unit tests. It will inject it automatically. if (!$block->error_log && !$block->no_error_log) { $block->set_value("no_error_log", "[error]\n[alert]"); } }); ``` If you are really interested to understand how the whole thing works you can run a test file and side by side compare `t/servroot/conf/nginx.conf` with https://github.com/apache/apisix/blob/master/t/APISIX.pm An extra example: If you notice, the test config is written inside `--- config` block. But you may wonder, how we are bridging the gap between writing the tests (in Perl) and running those tests in a test environment (requires an nginx.conf with some Lua blocks). This is where the Perl scripting helps - before running any tests we generate a new nginx.conf from the `--- config` set inside the test case, please take a look https://github.com/apache/apisix/blob/defafb1e426c4ffe4aa740c9bb9ad26992fa2c2e/t/APISIX.pm#L641-L650 Hope this helps. Thank you. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] starsz commented on a change in pull request #6247: Add the de duplication function of Nacos service discovery
starsz commented on a change in pull request #6247: URL: https://github.com/apache/apisix/pull/6247#discussion_r802638533 ## File path: apisix/discovery/nacos/init.lua ## @@ -236,7 +236,18 @@ local function is_grpc(scheme) return false end - +local function compareService(last_service_info,service_info) Review comment: ```suggestion local function compare_service(last_service_info, service_info) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] starsz commented on a change in pull request #6215: feat: clickhouse logger
starsz commented on a change in pull request #6215: URL: https://github.com/apache/apisix/pull/6215#discussion_r802645783 ## File path: apisix/plugins/clickhouse-logger.lua ## @@ -0,0 +1,179 @@ +-- +-- 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. +-- + +local bp_manager_mod = require("apisix.utils.batch-processor-manager") +local log_util= require("apisix.utils.log-util") +local core= require("apisix.core") +local http= require("resty.http") +local url = require("net.url") +local plugin = require("apisix.plugin") + +local ngx = ngx +local tostring = tostring + +local plugin_name = "clickhouse-logger" +local batch_processor_manager = bp_manager_mod.new(plugin_name) + +local schema = { +type = "object", +properties = { +endpoint_addr = core.schema.uri_def, +user = {type = "string", default = ""}, +password = {type = "string", default = ""}, +database = {type = "string", default = ""}, +logtable = {type = "string", default = ""}, +timeout = {type = "integer", minimum = 1, default = 3}, +name = {type = "string", default = "clickhouse logger"}, +ssl_verify = {type = "boolean", default = true}, +}, +required = {"endpoint_addr", "user", "password", "database", "logtable"} +} + + +local metadata_schema = { +type = "object", +properties = { +log_format = log_util.metadata_schema_log_format, +}, +} + + +local _M = { +version = 0.1, +priority = 398, +name = plugin_name, +schema = batch_processor_manager:wrap_schema(schema), +metadata_schema = metadata_schema, +} + + +function _M.check_schema(conf, schema_type) +if schema_type == core.schema.TYPE_METADATA then +return core.schema.check(metadata_schema, conf) +end +return core.schema.check(schema, conf) +end + + +local function send_http_data(conf, log_message) +local err_msg +local res = true +local url_decoded = url.parse(conf.endpoint_addr) +local host = url_decoded.host +local port = url_decoded.port + +core.log.info("sending a batch logs to ", conf.endpoint_addr) + +if not port then +if url_decoded.scheme == "https" then +port = 443 +else +port = 80 +end +end + +local httpc = http.new() +httpc:set_timeout(conf.timeout * 1000) +local ok, err = httpc:connect(host, port) + +if not ok then +return false, "failed to connect to host[" .. host .. "] port[" +.. tostring(port) .. "] " .. err +end + +if url_decoded.scheme == "https" and conf.ssl_verify then +ok, err = httpc:ssl_handshake(true, host, false) Review comment: You can check the third arg of this function. ![image](https://user-images.githubusercontent.com/25628854/153207820-254191e4-8a04-4d25-8a17-812c7835b80d.png) https://github.com/ledgetech/lua-resty-http#ssl_handshake Maybe you mistake the `ssl verify` with `use SSL` ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] soham4abc commented on pull request #6242: fix(redirect-plugin): redirection loop behind a proxy or lb
soham4abc commented on pull request #6242: URL: https://github.com/apache/apisix/pull/6242#issuecomment-1033774171 Thanks a lot @tzssangglass and @bisakhmondal For guiding me in this issue! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-website] guoqqqi commented on pull request #870: chore:add the LTS download button of 'apisix'
guoqqqi commented on pull request #870: URL: https://github.com/apache/apisix-website/pull/870#issuecomment-1033784867 cc @CP3cham ping -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-website] guoqqqi edited a comment on pull request #870: chore:add the LTS download button of 'apisix'
guoqqqi edited a comment on pull request #870: URL: https://github.com/apache/apisix-website/pull/870#issuecomment-1033784867 @CP3cham ping -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] zhendongcmss commented on a change in pull request #6215: feat: clickhouse logger
zhendongcmss commented on a change in pull request #6215: URL: https://github.com/apache/apisix/pull/6215#discussion_r802694478 ## File path: apisix/plugins/clickhouse-logger.lua ## @@ -0,0 +1,179 @@ +-- +-- 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. +-- + +local bp_manager_mod = require("apisix.utils.batch-processor-manager") +local log_util= require("apisix.utils.log-util") +local core= require("apisix.core") +local http= require("resty.http") +local url = require("net.url") +local plugin = require("apisix.plugin") + +local ngx = ngx +local tostring = tostring + +local plugin_name = "clickhouse-logger" +local batch_processor_manager = bp_manager_mod.new(plugin_name) + +local schema = { +type = "object", +properties = { +endpoint_addr = core.schema.uri_def, +user = {type = "string", default = ""}, +password = {type = "string", default = ""}, +database = {type = "string", default = ""}, +logtable = {type = "string", default = ""}, +timeout = {type = "integer", minimum = 1, default = 3}, +name = {type = "string", default = "clickhouse logger"}, +ssl_verify = {type = "boolean", default = true}, +}, +required = {"endpoint_addr", "user", "password", "database", "logtable"} +} + + +local metadata_schema = { +type = "object", +properties = { +log_format = log_util.metadata_schema_log_format, +}, +} + + +local _M = { +version = 0.1, +priority = 398, +name = plugin_name, +schema = batch_processor_manager:wrap_schema(schema), +metadata_schema = metadata_schema, +} + + +function _M.check_schema(conf, schema_type) +if schema_type == core.schema.TYPE_METADATA then +return core.schema.check(metadata_schema, conf) +end +return core.schema.check(schema, conf) +end + + +local function send_http_data(conf, log_message) +local err_msg +local res = true +local url_decoded = url.parse(conf.endpoint_addr) +local host = url_decoded.host +local port = url_decoded.port + +core.log.info("sending a batch logs to ", conf.endpoint_addr) + +if not port then +if url_decoded.scheme == "https" then +port = 443 +else +port = 80 +end +end + +local httpc = http.new() +httpc:set_timeout(conf.timeout * 1000) +local ok, err = httpc:connect(host, port) + +if not ok then +return false, "failed to connect to host[" .. host .. "] port[" +.. tostring(port) .. "] " .. err +end + +if url_decoded.scheme == "https" and conf.ssl_verify then +ok, err = httpc:ssl_handshake(true, host, false) Review comment: sorry, my fault. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-website] 1502shivam-singh commented on issue #872: UI problem of switching color mode in mobile browser
1502shivam-singh commented on issue #872: URL: https://github.com/apache/apisix-website/issues/872#issuecomment-1033831539 For anyone who would want to work on this - - The intended working from my side was to keep the dark mode only for documentation section of the site, not the homepage (reason for this is related to maintaining a better visual design). This is why dark mode swatch disappears on desktop devices. So, the work that needs to be done to actually resolve this, is to make the dark mode swatch disappear on mobile (which is not happening now, a miss from my side 😅) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #858: bug: there are error logs for stream_routes
tao12345666333 commented on issue #858: URL: https://github.com/apache/apisix-ingress-controller/issues/858#issuecomment-1033835307 Thanks for your report. This is a known issue due to stream_route mode being disabled by default when using the APISIX v2.12.0 image. You can change the configmap to add stream_route configuration. I'm already working on this issue and will fix it this week. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #858: bug: there are error logs for stream_routes
tao12345666333 commented on issue #858: URL: https://github.com/apache/apisix-ingress-controller/issues/858#issuecomment-1033836626 Refer to https://github.com/apache/apisix-ingress-controller/issues/851#issuecomment-1026306420 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-website] 1502shivam-singh commented on issue #871: A strange problem caused by switching color modes in multiple tabs
1502shivam-singh commented on issue #871: URL: https://github.com/apache/apisix-website/issues/871#issuecomment-1033837549 > I noticed that after switching to dark mode on other pages, it automatically changes back to the light mode when I return to the home page of the site. It is intended, please check this - https://github.com/apache/apisix-website/issues/872#issuecomment-1033831539 > It's also good if the homepage has a good dark mode. Sure could be, but will need some time to decide color palettes for keeping a consistent visual design. So, based on prioritizing I think if one has time can take up this, or we could delegate this. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-website] 1502shivam-singh commented on issue #667: feat: add Apache APISIX dashboard playground on website
1502shivam-singh commented on issue #667: URL: https://github.com/apache/apisix-website/issues/667#issuecomment-1033846171 > can I get an insight of the feature wanted? For now, I guess change `go to docs` to `preview` and adjust the href to the dashboard demo URL. What say, @juzhiyuan. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-website] 1502shivam-singh edited a comment on issue #667: feat: add Apache APISIX dashboard playground on website
1502shivam-singh edited a comment on issue #667: URL: https://github.com/apache/apisix-website/issues/667#issuecomment-1033846171 > can I get an insight of the feature wanted? For now, I guess change `go to docs` to `preview`/`demo` and adjust the href to the dashboard demo URL. What say, @juzhiyuan. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] moonming commented on pull request #6202: feat: use keepalive in server-info plugin
moonming commented on pull request #6202: URL: https://github.com/apache/apisix/pull/6202#issuecomment-1033851864 @zaunist any update? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-website] CP3cham commented on a change in pull request #870: chore:add the LTS download button of 'apisix'
CP3cham commented on a change in pull request #870: URL: https://github.com/apache/apisix-website/pull/870#discussion_r802757739 ## File path: website/src/pages/downloads/ProjectCard.js ## @@ -112,12 +156,47 @@ const ProjectCard = (props) => { Release Date ·{" "} {releaseDate} - + + + + + +https://www.apache.org/dyn/closer.cgi/apisix/2.10.3/apache-apisix-2.10.3-src.tgz`} Review comment: Yep,maybe the version info can be put in the json file which include all version info -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-helm-chart] tao12345666333 closed issue #231: request help: Prometheus Apisix
tao12345666333 closed issue #231: URL: https://github.com/apache/apisix-helm-chart/issues/231 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-helm-chart] tao12345666333 commented on issue #231: request help: Prometheus Apisix
tao12345666333 commented on issue #231: URL: https://github.com/apache/apisix-helm-chart/issues/231#issuecomment-1033863858 Starting from https://github.com/apache/apisix-helm-chart/pull/192, we have provided ServiceMonitor, if you are using Prometheus operator you can use it directly. Feel free to reopen this issue, if you still have questions. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-dashboard] hongbinhsu closed issue #2306: web build in node 16 rjsf/core version to lower
hongbinhsu closed issue #2306: URL: https://github.com/apache/apisix-dashboard/issues/2306 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-website] 1502shivam-singh commented on issue #871: A strange problem caused by switching color modes in multiple tabs
1502shivam-singh commented on issue #871: URL: https://github.com/apache/apisix-website/issues/871#issuecomment-1033864478 > If you open the docs in another tab and switch to dark mode, when you return to the home page in the original tab, the home page will also switch to dark mode What I observe is that the dark mode is switching to light mode, as is programmed (only not fast, surprisingly). Reason for this I guess is that the dark mode context of the documentation section (in other tab) is stored in localstorage of browser and the site opening on other tab picks it up as theme. But, to maintain light mode on homepage, the code resets the theme using the docusaurus's useThemeContext(), https://github.com/apache/apisix-website/blob/2b43e5aeff92c2aabac14a540426de555cef238d/website/src/pages/index.js#L28-L41 Only issue, is that this switch is slow on your system, but seems smooth on mine 🤔 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] zaunist commented on pull request #6202: feat: use keepalive in server-info plugin
zaunist commented on pull request #6202: URL: https://github.com/apache/apisix/pull/6202#issuecomment-1033893890 > @zaunist any update? I have update the plugin code, still need to update test case. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-ingress-controller] MirtoBusico commented on issue #853: question: How to use Service IP as upstream instead of Pod IP
MirtoBusico commented on issue #853: URL: https://github.com/apache/apisix-ingress-controller/issues/853#issuecomment-1034071790 Hi @tao12345666333 I don't know if it is related, but if you delete an apisixroute, it results deleted for kubernetes but is still alive in apisix-dashboard. First I deleted the route and waited for one hour and half https://user-images.githubusercontent.com/11090934/153266401-18853ea6-a881-4e21-ae1f-418b29520891.png";> Then I looked at upstream list in apisix-dashboard and the upstream (and route) is still there https://user-images.githubusercontent.com/11090934/153266547-1cc5d03d-31fe-4626-a00b-5d6f11bee80d.png";> Seems that kubernetes and apisix will never be synced. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] seanleblanc commented on issue #6260: request help: JWT Auth
seanleblanc commented on issue #6260: URL: https://github.com/apache/apisix/issues/6260#issuecomment-1034182182 Sure, this is our most recent config, which kind of works. I see that adding the public key works, but without that, it seems to try to do something like POSTing to introspection_endpoint? It seems the scope value is not used to inspect the scope(s) in the token, but instead is used somehow with these endpoints? So basically any valid token gets through. { "access_token_in_authorization_header": true, "bearer_only": true, "client_id": "unconfigured", "client_secret": "unconfigured", "disable": false, "discovery": "https://KEYCLOAKHOST/auth/realms/REALM/.well-known/openid-configuration";, "public_key": "-BEGIN PUBLIC KEY-\KEY\n-END PUBLIC KEY-" } The samples you are showing seem to be from authz-keycloak? We are using keycloak for testing, but are likely to be using something else in other envs/projects. Will authz-keycloak interop only with Keycloak, or can it be used with any JWT token provider, assuming it has endpoints for certs? Also, in that sample up above for authz-keycloak, it has a client_id value, how is that used? Is it expecting the jwt token to have that client_id as a value, or is it somehow using that to authenticate to Keycloak for some reason? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] yaule commented on pull request #6270: feat(oidc): add set_userinfo_detail_header
yaule commented on pull request #6270: URL: https://github.com/apache/apisix/pull/6270#issuecomment-1034309783 > hi @yaule , thanks for submitting the PR, can you explain the background of this PR? The service behind APISIX can directly obtain user information from the header, without using base64 to encode the data, like grafana -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tao12345666333 opened a new issue #6276: bug: prometheus plugin `enable_export_server=false` not working as expected
tao12345666333 opened a new issue #6276: URL: https://github.com/apache/apisix/issues/6276 ### Issue description In the recent Apache APISIX Ingress controller CI, we found that the Prometheus plugin does not take effect when set via global_rules. (we using apache/apisix:dev docker image) **If we fallback this image to `apache/apisix:2.11.0-alpine` then it works fine.** Below is our configuration: ```yaml apisix: enable_control: true enable_reuseport: true # Enable nginx SO_REUSEPORT switch if set to true. allow_admin: - 127.0.0.0/24 - 0.0.0.0/0 port_admin: 9180 stream_proxy: # TCP/UDP proxy only: false tcp:# TCP proxy port list - 9100 udp: - 9200 etcd: host: # it's possible to define multiple etcd hosts addresses of the same etcd cluster. - "http://{{ .EtcdServiceFQDN }}:2379" # multiple etcd address prefix: "/apisix" # apisix configurations prefix timeout: 30 # 30 seconds plugin_attr: prometheus: enable_export_server: false ``` xref: https://github.com/apache/apisix-ingress-controller/issues/857 ### Environment - apisix version (cmd: `apisix version`): using dev image. `apache/apisix@sha256:6e6b8999a981ab00e1a1373fbebf049d08e15aeddfec8e5945910eba134e66c7` - OS (cmd: `uname -a`): - OpenResty / Nginx version (cmd: `nginx -V` or `openresty -V`): - etcd version, if have (cmd: run `curl http://127.0.0.1:9090/v1/server_info` to get the info from server-info API): - apisix-dashboard version, if have: - the plugin runner version, if the issue is about a plugin runner (cmd: depended on the kind of runner): - luarocks version, if the issue is about installation (cmd: `luarocks --version`): ### Steps to reproduce 1. `git clone https://github.com/apache/apisix-ingress-controller.git` 2. `make push-images-to-kind` 3. `kubectl apply -k samples/deploy/crd` 4. ` cd test/e2e/` 5. `ginkgo --focus='enable prometheus'` ### Actual result `/apisix/prometheus/metrics` return 404 ### Error log ``` 127.0.0.1 - - [09/Feb/2022:15:32:54 +] localhost:32150 "GET /apisix/admin/global_rules HTTP/1.1" 200 303 0.005 "-" "Go-http-client/1.1" - - - "http://localhost:32150"; 127.0.0.1 - - [09/Feb/2022:15:32:54 +] localhost:31883 "GET /apisix/prometheus/metrics HTTP/1.1" 404 47 0.000 "-" "Go-http-client/1.1" - - - "http://localhost:31883"; ``` ### Expected result `/apisix/prometheus/metrics` return 200 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tao12345666333 commented on issue #6276: bug: prometheus plugin `enable_export_server=false` not working as expected
tao12345666333 commented on issue #6276: URL: https://github.com/apache/apisix/issues/6276#issuecomment-1034329542 I see some test cases here https://github.com/apache/apisix/blob/defafb1e426c4ffe4aa740c9bb9ad26992fa2c2e/t/cli/test_prometheus.sh#L67-L105 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on issue #857: e2e test: ApisixClusterConfig enable prometheus failed
tao12345666333 commented on issue #857: URL: https://github.com/apache/apisix-ingress-controller/issues/857#issuecomment-1034330791 If we rollback the APISIX docker image used by the e2e test then it works fine. Created an issue https://github.com/apache/apisix/issues/6276 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 opened a new pull request #859: fix: ApisixClusterConfig e2e test case
tao12345666333 opened a new pull request #859: URL: https://github.com/apache/apisix-ingress-controller/pull/859 * pin the image of APISIX to stable version * using the new plugin list API * fix ApisixClusterConfig status logic Signed-off-by: Jintao Zhang ### Type of change: - [x] Bugfix - [ ] New feature provided - [ ] Improve performance - [ ] Backport patches ### What this PR does / why we need it: fix: #857 ### Pre-submission checklist: * [ ] Did you explain what problem does this PR solve? Or what new features have been added? * [ ] Have you added corresponding test cases? * [ ] Have you modified the corresponding document? * [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix-ingress-controller#community) first** -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on a change in pull request #859: fix: ApisixClusterConfig e2e test case
tao12345666333 commented on a change in pull request #859: URL: https://github.com/apache/apisix-ingress-controller/pull/859#discussion_r803200015 ## File path: Makefile ## @@ -87,8 +87,8 @@ endif .PHONY: push-images-to-kind push-images-to-kind: kind-up ifeq ($(E2E_SKIP_BUILD), 0) - docker pull apache/apisix:dev - docker tag apache/apisix:dev $(LOCAL_REGISTRY)/apache/apisix:dev + docker pull apache/apisix:2.12.0-alpine + docker tag apache/apisix:2.12.0-alpine $(LOCAL_REGISTRY)/apache/apisix:dev Review comment: Will rollback to stable version before confirming that dev is available. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-ingress-controller] tao12345666333 commented on pull request #845: fix: aviod create pluginconfig in the tranlsation of route (#836)
tao12345666333 commented on pull request #845: URL: https://github.com/apache/apisix-ingress-controller/pull/845#issuecomment-1034350042 Wait for #859 to fix CI. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-website] Baoyuantop commented on issue #871: A strange problem caused by switching color modes in multiple tabs
Baoyuantop commented on issue #871: URL: https://github.com/apache/apisix-website/issues/871#issuecomment-1034382051 OK, I found the point @1502shivam-singh. Following exactly the steps in the gif provided by SkyeYoung, the site's homepage ended up in the dark mode. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-website] SkyeYoung commented on issue #871: A strange problem caused by switching color modes in multiple tabs
SkyeYoung commented on issue #871: URL: https://github.com/apache/apisix-website/issues/871#issuecomment-1034389287 @1502shivam-singh Sorry, my English is very poor. Maybe my description misled you. I mean, first open the home page in a tab, and open the document navigation page in this tab, then right-click to open the document of apisix in the new tab, switch to the dark mode, then click the first tab, and click back to the home page, You will find that the home page is not reset to light mode as expected. (yes, I know there are some codes in the program to reset back to light mode) I reproduced this behavior on different devices (maybe not because my system is too slow) :D -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-go-plugin-runner] spacewander commented on issue #34: request help: Introduce context to run plugin
spacewander commented on issue #34: URL: https://github.com/apache/apisix-go-plugin-runner/issues/34#issuecomment-1034391781 Thanks for your design. My original thought is simpler: we can add a method in the Request to return a Context. It works like the one from the standard library: https://pkg.go.dev/net/http#Request.Context. People can fetch it only when they need the Context. And the timeout of Context is slightly smaller than 60s so people can still break the execution with a custom response before the actual timeout. There is a tricky place: the timeout of Nginx is per-operation, so when we communicate with Nginx again in https://github.com/apache/apisix-go-plugin-runner/blob/6bb1c4bd98ec374638af7ed02931e0efb2604044/internal/http/request.go#L326 the timer will be reset. Maybe we can handle this in a separate PR. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tzssangglass commented on a change in pull request #6136: ci: support for generating flame graph
tzssangglass commented on a change in pull request #6136: URL: https://github.com/apache/apisix/pull/6136#discussion_r803229254 ## File path: .github/workflows/performance.yml ## @@ -0,0 +1,56 @@ +name: Performance Test + +on: + pull_request: +branches: [master, 'release/**'] +paths-ignore: + - 'docs/**' + - '**/*.md' + +jobs: + performance: +if: github.event_name == 'pull_request' || github.event.label.name == 'performance' +runs-on: ubuntu-18.04 +timeout-minutes: 45 + +steps: + - name: Check out code +uses: actions/checkout@v2.4.0 +with: + submodules: recursive + + - name: Cache deps +uses: actions/cache@v2.1.7 +env: + cache-name: cache-deps +with: + path: deps + key: ${{ runner.os }}-${{ env.cache-name }}-${{ matrix.os_name }}-${{ hashFiles('rockspec/apisix-master-0.rockspec') }} + + - name: Install Dependencies +run: sudo ./ci/performance_test.sh install_dependencies + + - name: Install wrk2 +run: sudo ./ci/performance_test.sh install_wrk2 + + - name: Install SystemTap Tools +run: sudo ./ci/performance_test.sh install_stap_tools + + - name: Perf Test +run: ./ci/performance_test.sh run_performance_test Review comment: Tried it before and it didn't fit -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tzssangglass commented on pull request #6270: feat(oidc): add set_userinfo_detail_header
tzssangglass commented on pull request #6270: URL: https://github.com/apache/apisix/pull/6270#issuecomment-1034395905 Can you show the relevant docs or issue, I don't understand its usefulness. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander commented on issue #6276: bug: prometheus plugin `enable_export_server=false` not working as expected
spacewander commented on issue #6276: URL: https://github.com/apache/apisix/issues/6276#issuecomment-1034398011 This is caused by the break change: https://github.com/apache/apisix/pull/6196 The change is introduced to reduce attack vector. Let's add a new route with public-api plugin to work around it: https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/public-api.md -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[apisix] branch master updated: docs: added installation mode for LTS version (#6269)
This is an automated email from the ASF dual-hosted git repository. spacewander pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/apisix.git The following commit(s) were added to refs/heads/master by this push: new 04a4cf1 docs: added installation mode for LTS version (#6269) 04a4cf1 is described below commit 04a4cf18d083d4940ad88bdc87b255dd18cfaab3 Author: John Chever AuthorDate: Thu Feb 10 09:44:01 2022 +0800 docs: added installation mode for LTS version (#6269) --- docs/en/latest/how-to-build.md | 6 +- docs/zh/latest/how-to-build.md | 6 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/en/latest/how-to-build.md b/docs/en/latest/how-to-build.md index 2eb830b..e02f362 100644 --- a/docs/en/latest/how-to-build.md +++ b/docs/en/latest/how-to-build.md @@ -23,7 +23,7 @@ title: How to build Apache APISIX ## Step 1: Install Apache APISIX -You can install Apache APISIX via RPM Repository, Docker, Helm Chart, and source release package. Please choose one from the following options. +You can install Apache APISIX via RPM Repository, Docker, Helm Chart, source release package, and source release package ( LTS version ). Please choose one from the following options. ### Installation via RPM Repository(CentOS 7) @@ -128,6 +128,10 @@ Please refer to: [Installing Apache APISIX with Helm Chart](https://github.com/a Attention please, this operation will totally **remove** the related files. +### LTS version Installation via Source Release Package + +The current LTS VERSION of Apache APISIX is `2.10.3`. Set `APISIX VERSION` in [install by source package](# Install by source package) to `2.10.3` and follow the other steps. + ## Step 2: Install ETCD This step is required if you have installed only Apache APISIX via RPM, Docker or source code but not ETCD. diff --git a/docs/zh/latest/how-to-build.md b/docs/zh/latest/how-to-build.md index 10a0f39..5fe544e 100644 --- a/docs/zh/latest/how-to-build.md +++ b/docs/zh/latest/how-to-build.md @@ -23,7 +23,7 @@ title: 如何构建 Apache APISIX ## 步骤1:安装 Apache APISIX -你可以通过 RPM 仓库、Docker、Helm Chart、源码包等多种方式来安装 Apache APISIX。请在以下选项中选择其中一种执行。 +你可以通过 RPM 仓库、Docker、Helm Chart、源码包、源码包(LTS 版本)等多种方式来安装 Apache APISIX。请在以下选项中选择其中一种执行。 ### 通过 RPM 仓库安装(CentOS 7) @@ -128,6 +128,10 @@ $ sudo yum install ./apisix/*.rpm 请注意,该操作将完整**删除**相关文件。 +### 通过源码包安装 LTS 版本 + +目前 Apache APISIX 的 LTS 版本为 `2.10.3`,将“[通过源码包安装](#通过源码包安装)”中的 `APISIX_VERSION` 设置成 `2.10.3` ,其他步骤按顺序进行即可。 + ## 步骤2:安装 ETCD 如果你只通过 RPM、Docker 或源代码安装了 Apache APISIX,而没有安装 ETCD,则需要这一步。
[GitHub] [apisix] spacewander merged pull request #6269: docs: added installation mode for LTS version
spacewander merged pull request #6269: URL: https://github.com/apache/apisix/pull/6269 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander commented on a change in pull request #6267: docs: add forward-auth zh document
spacewander commented on a change in pull request #6267: URL: https://github.com/apache/apisix/pull/6267#discussion_r803235618 ## File path: docs/zh/latest/plugins/forward-auth.md ## @@ -0,0 +1,140 @@ +--- +title: forward-auth +--- + + + +## 目录 + +- [**名字**](#名字) +- [**属性**](#属性) +- [**数据定义**](#数据定义) +- [**示例**](#示例) +- [**测试插件**](#测试插件) +- [**禁用插件**](#禁用插件) + +## 名字 + +`forward-auth` 插件使用的是经典外部认证。在认证失败的时候,我们可以实现自定义错误或者重定向到认证页面。 + +Forward Auth 巧妙地将认证和授权逻辑移到了一个专门的外部服务中,网关将用户的请求转发给认证服务并阻塞原始请求,并在认证服务以非 2xx 状态响应时替换结果。 + +## 属性 + +| 名称 | 类型 | 必选项 | 默认值 | 有效值 | 描述 | +| -- | -- | -- | -- | -- | -- | +| host | string | 必须 | | | 设置 `authorization` 服务的地址 (eg. https://localhost:9188) | +| ssl_verify | boolean | 可选 | true | | 是否验证证书 | +| request_headers | array[string] | 可选 | | | 设置需要由 `client` 转发到 `authorization` 服务的请求头。未设置时,只有 Apache APISIX 的(X-Forwarded-XXX)会被转发到 `authorization` 服务。 | +| upstream_headers | array[string] | 可选 | | | 认证通过时,设置 `authorization` 服务转发至 `upstream` 的请求头。如果不设置则不转发任何请求头。 +| client_headers | array[string] | 可选 | | | 认证失败时,由 `authorization` 服务向 `client` 发送的响应头。如果不设置则不转发任何响应头。 | +| timeout | integer | 可选 | 3000ms | [1, 6]ms | `authorization` 服务请求超时时间 | +| keepalive | boolean | 可选 | true | | HTTP 长连接 | +| keepalive_timeout | integer | 可选 | 6ms | [1000, ...]ms | 长连接空闲时间 | +| keepalive_pool | integer | 可选 | 5 | [1, ...]ms | 连接池大小 | + +## 数据定义 + +request_headers 属性中转发到 `authorization` 服务中的 Apache APISIX 内容清单 +| Scheme | HTTP Method | Host | URI | Source IP | +| -- | -- | -- | -- | -- | +| X-Forwarded-Proto | X-Forwarded-Method | X-Forwarded-Host | X-Forwarded-Uri | X-Forwarded-For | + +## 示例 + +首先, 你需要设置一个认证服务。这里使用的是 Apache APISIX 无服务器插件模拟的示例。 + +```shell +curl -X PUT 'http://127.0.0.1:9080/apisix/admin/routes/auth' \ +-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \ +-H 'Content-Type: application/json' \ +-d '{ +"uri": "/auth", +"plugins": { +"serverless-pre-function": { +"phase": "rewrite", +"functions": [ +"return function (conf, ctx) local core = require(\"apisix.core\"); local authorization = core.request.header(ctx, \"Authorization\"); if authorization == \"123\" then core.response.exit(200); elseif authorization == \"321\" then core.response.set_header(\"X-User-ID\", \"i-am-user\"); core.response.exit(200); else core.response.set_header(\"Location\", \"http://example.com/auth\";); core.response.exit(403); end end" +] +} +} +}' +``` + +下一步, 我们创建一个测试路由。 + +```shell +curl -X PUT http://127.0.0.1:9080/apisix/admin/routes/1 +-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' +-d '{ +"uri": "/headers", +"plugins": { +"forward-auth": { +"host": "http://127.0.0.1:9080/auth";, +"request_headers": ["Authorization"], +"upstream_headers": ["X-User-ID"], +"client_headers": ["Location"] +} +}, +"upstream": { +"nodes": { +"httpbin.org:80": 1 +}, +"type": "roundrobin" +} +}' +``` + +我们可以进行下面三个测试: + +1. **request_headers** 从 `client` 转发请求头到 `authorization` 服务 + +```shell +curl http://127.0.0.1:9080/headers -H 'Authorization: 123' +{ +"headers": { +"Authorization": "123", +"Next": "More-headers" +} +} +``` + +2. **upstream_headers** 转发 `authorization` 服务响应头到 `upstream` + +```shell +curl http://127.0.0.1:9080/headers -H 'Authorization: 321' +{ +"headers": { +"Authorization": "321", +"X-User-ID": "i-am-user", +"Next": "More-headers" +} +} +``` + +3. **client_headers** 当授权失败时转发 `authorization` 服务响应头到 `client` + +```shell +curl -i http://127.0.0.1:9080/headers +HTTP/1.1 403 Forbidden +Location: http://example.com/auth +``` + +最后,你可以通过在路由中移除的方式禁用 `forward-auth` 插件。 Review comment: ```suggestion 最后,你可以通过在路由中移除的方式禁用 `forward-auth` 插件。 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander commented on a change in pull request #6228: feat(loggly): support HTTP response code to SYSLOG severity mapping
spacewander commented on a change in pull request #6228: URL: https://github.com/apache/apisix/pull/6228#discussion_r803238141 ## File path: apisix/plugins/loggly.lua ## @@ -145,6 +157,18 @@ function _M.check_schema(conf, schema_type) if not ok then return nil, err end + +if conf.severity_map then +local cache = {} +for k, v in pairs(conf.severity_map) do +local rcode = tonumber(k) +if not rcode or rcode < 100 or rcode >= 600 then +return nil, "expecting severity_map with http response code([100,599]) as keys" +end +cache[k] = severity[v:upper()] Review comment: OK -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander commented on a change in pull request #6228: feat(loggly): support HTTP response code to SYSLOG severity mapping
spacewander commented on a change in pull request #6228: URL: https://github.com/apache/apisix/pull/6228#discussion_r803238364 ## File path: apisix/plugins/loggly.lua ## @@ -85,6 +86,17 @@ local schema = { type = "boolean", default = true }, +severity_map = { +type = "object", +description = "upstream response code vs syslog severity mapping", +patternProperties = { +[".*"] = { Review comment: Does `["^[1-5][0-9]{2}$"] = {...}` work for it? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-website] netlify[bot] edited a comment on pull request #870: chore: add the LTS download button of 'apisix'
netlify[bot] edited a comment on pull request #870: URL: https://github.com/apache/apisix-website/pull/870#issuecomment-1032163360 👷 Deploy Preview for *apache-apisix* processing. 🔨 Explore the source changes: 138685d28d83d0e3887efecbaf33f9df23378bc9 🔍 Inspect the deploy log: [https://app.netlify.com/sites/apache-apisix/deploys/620470e751d9180008f87069](https://app.netlify.com/sites/apache-apisix/deploys/620470e751d9180008f87069) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander merged pull request #6267: docs: add forward-auth zh document
spacewander merged pull request #6267: URL: https://github.com/apache/apisix/pull/6267 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[apisix] branch master updated: docs: add forward-auth zh document (#6267)
This is an automated email from the ASF dual-hosted git repository. spacewander pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/apisix.git The following commit(s) were added to refs/heads/master by this push: new 862c604 docs: add forward-auth zh document (#6267) 862c604 is described below commit 862c604a4a85244de2f143aeca71db9046ef5433 Author: biubiue AuthorDate: Thu Feb 10 09:57:31 2022 +0800 docs: add forward-auth zh document (#6267) Co-authored-by: 罗泽轩 --- docs/zh/latest/config.json | 3 +- docs/zh/latest/plugins/forward-auth.md | 140 + 2 files changed, 142 insertions(+), 1 deletion(-) diff --git a/docs/zh/latest/config.json b/docs/zh/latest/config.json index a56d177..c6f2ac9 100644 --- a/docs/zh/latest/config.json +++ b/docs/zh/latest/config.json @@ -66,7 +66,8 @@ "plugins/basic-auth", "plugins/openid-connect", "plugins/hmac-auth", -"plugins/authz-casbin" +"plugins/authz-casbin", +"plugins/forward-auth" ] }, { diff --git a/docs/zh/latest/plugins/forward-auth.md b/docs/zh/latest/plugins/forward-auth.md new file mode 100644 index 000..8cd7bb6 --- /dev/null +++ b/docs/zh/latest/plugins/forward-auth.md @@ -0,0 +1,140 @@ +--- +title: forward-auth +--- + + + +## 目录 + +- [**名字**](#名字) +- [**属性**](#属性) +- [**数据定义**](#数据定义) +- [**示例**](#示例) +- [**测试插件**](#测试插件) +- [**禁用插件**](#禁用插件) + +## 名字 + +`forward-auth` 插件使用的是经典外部认证。在认证失败的时候,我们可以实现自定义错误或者重定向到认证页面。 + +Forward Auth 巧妙地将认证和授权逻辑移到了一个专门的外部服务中,网关将用户的请求转发给认证服务并阻塞原始请求,并在认证服务以非 2xx 状态响应时替换结果。 + +## 属性 + +| 名称 | 类型 | 必选项 | 默认值 | 有效值 | 描述 | +| -- | -- | -- | -- | -- | -- | +| host | string | 必须 | | | 设置 `authorization` 服务的地址 (eg. https://localhost:9188) | +| ssl_verify | boolean | 可选 | true | | 是否验证证书 | +| request_headers | array[string] | 可选 | | | 设置需要由 `client` 转发到 `authorization` 服务的请求头。未设置时,只有 Apache APISIX 的(X-Forwarded-XXX)会被转发到 `authorization` 服务。 | +| upstream_headers | array[string] | 可选 | | | 认证通过时,设置 `authorization` 服务转发至 `upstream` 的请求头。如果不设置则不转发任何请求头。 +| client_headers | array[string] | 可选 | | | 认证失败时,由 `authorization` 服务向 `client` 发送的响应头。如果不设置则不转发任何响应头。 | +| timeout | integer | 可选 | 3000ms | [1, 6]ms | `authorization` 服务请求超时时间 | +| keepalive | boolean | 可选 | true | | HTTP 长连接 | +| keepalive_timeout | integer | 可选 | 6ms | [1000, ...]ms | 长连接空闲时间 | +| keepalive_pool | integer | 可选 | 5 | [1, ...]ms | 连接池大小 | + +## 数据定义 + +request_headers 属性中转发到 `authorization` 服务中的 Apache APISIX 内容清单 +| Scheme | HTTP Method | Host | URI | Source IP | +| -- | -- | -- | -- | -- | +| X-Forwarded-Proto | X-Forwarded-Method | X-Forwarded-Host | X-Forwarded-Uri | X-Forwarded-For | + +## 示例 + +首先, 你需要设置一个认证服务。这里使用的是 Apache APISIX 无服务器插件模拟的示例。 + +```shell +curl -X PUT 'http://127.0.0.1:9080/apisix/admin/routes/auth' \ +-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \ +-H 'Content-Type: application/json' \ +-d '{ +"uri": "/auth", +"plugins": { +"serverless-pre-function": { +"phase": "rewrite", +"functions": [ +"return function (conf, ctx) local core = require(\"apisix.core\"); local authorization = core.request.header(ctx, \"Authorization\"); if authorization == \"123\" then core.response.exit(200); elseif authorization == \"321\" then core.response.set_header(\"X-User-ID\", \"i-am-user\"); core.response.exit(200); else core.response.set_header(\"Location\", \"http://example.com/auth\";); core.response.exit(403); end end" +] +} +} +}' +``` + +下一步, 我们创建一个测试路由。 + +```shell +curl -X PUT http://127.0.0.1:9080/apisix/admin/routes/1 +-H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' +-d '{ +"uri": "/headers", +"plugins": { +"forward-auth": { +"host": "http://127.0.0.1:9080/auth";, +"request_headers": ["Authorization"], +"upstream_headers": ["X-User-ID"], +"client_headers": ["Location"] +} +}, +"upstream": { +"nodes": { +"httpbin.org:80": 1 +}, +"type": "roundrobin" +} +}' +``` + +我们可以进行下面三个测试: + +1. **request_headers** 从 `client` 转发请求头到 `authorization` 服务 + +```shell +curl http://127.0.0.1:9080/headers -H 'Authorization: 123' +{ +"headers": { +"Authorization": "123", +"Next": "More-headers" +} +} +``` + +2. **upstream_headers** 转发 `authorization` 服务响应头到 `upstream` + +```shell +curl http://127.0.0.1:9080/headers -H 'Authorization: 321' +{ +"headers": { +"Authorization": "321", +"X-User-ID": "i-am-user", +"Next": "More-headers" +} +} +``` + +3. **client_headers** 当授权失败时转发 `authorization` 服务响应头到 `client` + +```shell +curl -i http://127.0.0.1:9080/headers +HTTP/1.1 403 Forbidden +Location: http://example.com/auth +``` + +最后,你可以通过在路由中移除的方式禁用 `forward-auth` 插件。
[apisix] branch master updated (862c604 -> 92bbde9)
This is an automated email from the ASF dual-hosted git repository. spacewander pushed a change to branch master in repository https://gitbox.apache.org/repos/asf/apisix.git. from 862c604 docs: add forward-auth zh document (#6267) add 92bbde9 docs: correct the 'article' to 'documentation' in Getting started. (#6275) No new revisions were added by this update. Summary of changes: docs/en/latest/getting-started.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
[GitHub] [apisix-website] spacewander closed issue #866: Correct choice of words in Getting started.
spacewander closed issue #866: URL: https://github.com/apache/apisix-website/issues/866 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander merged pull request #6275: docs: correct the 'article' to 'documentation' in Getting started.
spacewander merged pull request #6275: URL: https://github.com/apache/apisix/pull/6275 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tao12345666333 commented on issue #6276: bug: prometheus plugin `enable_export_server=false` not working as expected
tao12345666333 commented on issue #6276: URL: https://github.com/apache/apisix/issues/6276#issuecomment-1034411255 @spacewander thanks for your reply. Does that mean these descriptions in the documentation are wrong? ``` If you still want to expose the metrics via the data plane port (default: 9080), you can configure it like this: plugin_attr: prometheus: enable_export_server: false You may need to use [public-api](https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/public-api.md) plugin to expose it. ``` https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/prometheus.md#api -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander commented on a change in pull request #6242: fix(redirect-plugin): redirection loop behind a proxy or lb
spacewander commented on a change in pull request #6242: URL: https://github.com/apache/apisix/pull/6242#discussion_r803240917 ## File path: t/plugin/redirect.t ## @@ -1000,3 +1000,58 @@ Location: /hello?type=string&name=json --- error_code: 302 --- no_error_log [error] + + + +=== TEST 41: enable http_to_https (pass X-Forwarded-Proto) +--- config +location /t { +content_by_lua_block { +local t = require("lib.test_admin").test +local code, body = t('/apisix/admin/routes/1', +ngx.HTTP_PUT, +[[{ +"uri": "/hello", +"host": "foo.com", +"vars": [ +[ +"scheme", +"==", +"http" +] +], +"plugins": { +"redirect": { +"http_to_https": true +} +} +}]] +) + +if code >= 300 then +ngx.status = code +end +ngx.say(body) +} +} + Review comment: Let's remove the extra blank lines -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tao12345666333 edited a comment on issue #6276: bug: prometheus plugin `enable_export_server=false` not working as expected
tao12345666333 edited a comment on issue #6276: URL: https://github.com/apache/apisix/issues/6276#issuecomment-1034411255 @spacewander thanks for your reply. Does that mean these descriptions in the documentation are wrong? `enable_export_server=false` no longer have any real value? ``` If you still want to expose the metrics via the data plane port (default: 9080), you can configure it like this: plugin_attr: prometheus: enable_export_server: false You may need to use [public-api](https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/public-api.md) plugin to expose it. ``` https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/prometheus.md#api -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tao12345666333 commented on issue #6276: bug: prometheus plugin `enable_export_server=false` not working as expected
tao12345666333 commented on issue #6276: URL: https://github.com/apache/apisix/issues/6276#issuecomment-1034412793 let me try to use `public_api` plugin. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-website] netlify[bot] edited a comment on pull request #870: chore: add the LTS download button of 'apisix'
netlify[bot] edited a comment on pull request #870: URL: https://github.com/apache/apisix-website/pull/870#issuecomment-1032163360 ✔️ Deploy Preview for *apache-apisix* ready! 🔨 Explore the source changes: 138685d28d83d0e3887efecbaf33f9df23378bc9 🔍 Inspect the deploy log: [https://app.netlify.com/sites/apache-apisix/deploys/620470e751d9180008f87069](https://app.netlify.com/sites/apache-apisix/deploys/620470e751d9180008f87069) 😎 Browse the preview: [https://deploy-preview-870--apache-apisix.netlify.app](https://deploy-preview-870--apache-apisix.netlify.app) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] yaule commented on pull request #6270: feat(oidc): add set_userinfo_detail_header
yaule commented on pull request #6270: URL: https://github.com/apache/apisix/pull/6270#issuecomment-1034421680 > https://grafana.com/docs/grafana/latest/auth/auth-proxy/ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-website] Baoyuantop commented on a change in pull request #870: chore: add the LTS download button of 'apisix'
Baoyuantop commented on a change in pull request #870: URL: https://github.com/apache/apisix-website/pull/870#discussion_r803246891 ## File path: website/config/downloads.js ## @@ -9,6 +9,7 @@ module.exports = [ githubBranch: "master", downloadPath: "apisix/2.11.0/apache-apisix-2.11.0-src", version: "2.11.0", +LTSDownloadPath:"2.10.3", Review comment: It looks more like `LTSVersion` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-website] zaunist commented on pull request #870: chore: add the LTS download button of 'apisix'
zaunist commented on pull request #870: URL: https://github.com/apache/apisix-website/pull/870#issuecomment-1034425318 It look like need to sync master branch. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tao12345666333 commented on issue #6276: bug: prometheus plugin `enable_export_server=false` not working as expected
tao12345666333 commented on issue #6276: URL: https://github.com/apache/apisix/issues/6276#issuecomment-1034426253 They are a logical AND relationship. Need to configure both `enable_export_server: false` and `public_api` plugin. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix-website] oil-oil opened a new issue #873: The 2.12.1 version source package is missing
oil-oil opened a new issue #873: URL: https://github.com/apache/apisix-website/issues/873 Follow the operations in the documentation and find that the source package of version 2.12.1 is missing https://user-images.githubusercontent.com/57465570/153325924-ed5a68ee-b185-40ba-b5e9-4d2256a20ef3.png";> The screenshot of the page in the apache website is as follows: https://user-images.githubusercontent.com/57465570/153325897-659c14cc-c9cc-454f-bc4d-8222dff1b79c.png";> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tao12345666333 commented on issue #6276: bug: prometheus plugin `enable_export_server=false` not working as expected
tao12345666333 commented on issue #6276: URL: https://github.com/apache/apisix/issues/6276#issuecomment-1034431045 I have tried three ways of configuration and they all work fine ``` { "count": 3, "node": { "dir": true, "nodes": [ { "modifiedIndex": 36, "value": { "status": 1, "update_time": 1644403772, "id": "1", "priority": 0, "plugins": { "public-api": {} }, "uri": "/apisix/prometheus/metrics", "create_time": 1644403772 }, "createdIndex": 36, "key": "/apisix/routes/1" }, { "modifiedIndex": 38, "value": { "upstream": { "pass_host": "pass", "nodes": { "127.0.0.1:9091": 1 }, "scheme": "http", "type": "roundrobin", "hash_on": "vars" }, "status": 1, "update_time": 1644404420, "id": "3", "priority": 0, "plugins": { "public-api": { "uri": "/apisix/prometheus/metrics" } }, "uri": "/pmetrics", "create_time": 1644404420 }, "createdIndex": 38, "key": "/apisix/routes/3" }, { "modifiedIndex": 37, "value": { "status": 1, "update_time": 1644404184, "id": "2", "priority": 0, "plugins": { "public-api": { "uri": "/apisix/prometheus/metrics" } }, "uri": "/metrics", "create_time": 1644404184 }, "createdIndex": 37, "key": "/apisix/routes/2" } ], "key": "/apisix/routes" }, "action": "get" } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] Chever-John commented on issue #6266: bug: ctx.lua#59 parse_graphql(ctx)
Chever-John commented on issue #6266: URL: https://github.com/apache/apisix/issues/6266#issuecomment-103144 After discussion and review, it was found that the cause of this issue was that we did not use the application/json content type. I will mainly solve this issue in the next 3 days. sry @pcyan -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander opened a new pull request #6277: ci: enforce request review on the final state
spacewander opened a new pull request #6277: URL: https://github.com/apache/apisix/pull/6277 In https://github.com/apache/apisix/pull/5940#discussion_r802593858, during solving the merge conflict, a bug which is fixed in https://github.com/apache/apisix/pull/6204 is reintroduced. The test is also changed so it can't catch up the regression. That PR is approved before merging the master. Luckily, I am cautious enough to start another turn of review. We should not rely on the lucky or someone else's caution. To prevent that from happening again, here we enforce the approval should be applied with the final state. Signed-off-by: spacewander ### What this PR does / why we need it: ### Pre-submission checklist: * [x] Did you explain what problem does this PR solve? Or what new features have been added? * [ ] Have you added corresponding test cases? * [ ] Have you modified the corresponding document? * [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first** -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[apisix] branch master updated: ci: enforce request review on the final state (#6277)
This is an automated email from the ASF dual-hosted git repository. spacewander pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/apisix.git The following commit(s) were added to refs/heads/master by this push: new 06c5193 ci: enforce request review on the final state (#6277) 06c5193 is described below commit 06c51935aa207eef8ef75df24172e8656085c3ff Author: 罗泽轩 AuthorDate: Thu Feb 10 11:24:41 2022 +0800 ci: enforce request review on the final state (#6277) --- .asf.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.asf.yaml b/.asf.yaml index cc4b6b8..51a6b73 100644 --- a/.asf.yaml +++ b/.asf.yaml @@ -45,6 +45,7 @@ github: protected_branches: master: required_pull_request_reviews: + dismiss_stale_reviews: true require_code_owner_reviews: true required_approving_review_count: 2 release/2.12:
[GitHub] [apisix] spacewander merged pull request #6277: ci: enforce request review on the final state
spacewander merged pull request #6277: URL: https://github.com/apache/apisix/pull/6277 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander commented on a change in pull request #6215: feat: clickhouse logger
spacewander commented on a change in pull request #6215: URL: https://github.com/apache/apisix/pull/6215#discussion_r803271948 ## File path: t/plugin/clickhouse-logger.t ## @@ -0,0 +1,227 @@ +# +# 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. +# + +use t::APISIX 'no_plan'; + +log_level("info"); +repeat_each(1); +no_long_string(); +no_root_location(); + +add_block_preprocessor(sub { +my ($block) = @_; + +if ((!defined $block->error_log) && (!defined $block->no_error_log)) { +$block->set_value("no_error_log", "[error]"); +} + +if (!defined $block->request) { +$block->set_value("request", "GET /t"); +} + +my $http_config = $block->http_config // <<_EOC_; +server { +listen 10420; +location /loggly/bulk/tok/tag/bulk { +content_by_lua_block { +ngx.req.read_body() +local data = ngx.req.get_body_data() +local headers = ngx.req.get_headers() +ngx.log(ngx.ERR, "loggly body: ", data) Review comment: Ditto ## File path: t/plugin/clickhouse-logger.t ## @@ -0,0 +1,227 @@ +# +# 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. +# + +use t::APISIX 'no_plan'; + +log_level("info"); +repeat_each(1); +no_long_string(); +no_root_location(); + +add_block_preprocessor(sub { +my ($block) = @_; + +if ((!defined $block->error_log) && (!defined $block->no_error_log)) { +$block->set_value("no_error_log", "[error]"); +} + +if (!defined $block->request) { +$block->set_value("request", "GET /t"); +} + +my $http_config = $block->http_config // <<_EOC_; +server { +listen 10420; +location /loggly/bulk/tok/tag/bulk { +content_by_lua_block { +ngx.req.read_body() +local data = ngx.req.get_body_data() +local headers = ngx.req.get_headers() +ngx.log(ngx.ERR, "loggly body: ", data) +ngx.log(ngx.ERR, "loggly tags: " .. require("toolkit.json").encode(headers["X-LOGGLY-TAG"])) +ngx.say("ok") +} +} +} +_EOC_ + +$block->set_value("http_config", $http_config); +}); + +run_tests(); + +__DATA__ + +=== TEST 1: Full configuration verification +--- yaml_config +plugins: + - clickhouse-logger +--- config +location /t { +content_by_lua_block { +local plugin = require("apisix.plugins.clickhouse-logger") +local ok, err = plugin.check_schema({timeout = 3, + retry_delay = 1, + batch_max_size = 500, + user = "default", + password = "a", + database = "default", + logtable = "t", + endpoint_addr = "http://127.0.0.1:8123";, + max_retry_count = 1, + name = "clickhouse logger", + ssl_verify = false + }) + +if not ok then +ngx.say(err) +else +ngx.say("passed") +end +} +} +--- response_body +passed + + + +
[GitHub] [apisix] SkyeYoung opened a new pull request #6278: docs: improve consul_kv.md
SkyeYoung opened a new pull request #6278: URL: https://github.com/apache/apisix/pull/6278 ### What this PR does / why we need it: - Use the word "Consul KV" in the official document of Consul to replace "consul key value" - Adjust the expression of some text ### Pre-submission checklist: * [x] Did you explain what problem does this PR solve? Or what new features have been added? * [ ] Have you added corresponding test cases? * [ ] Have you modified the corresponding document? * [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix/tree/master#community) first** -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] tzssangglass commented on pull request #6247: Add the de duplication function of Nacos service discovery
tzssangglass commented on pull request #6247: URL: https://github.com/apache/apisix/pull/6247#issuecomment-1034469886 hi @xianshun163 , I have another fix idea to discuss with you. Before adding a new service to services, we can do a de-duplication, we can add de_duplication function in https://github.com/apache/apisix/blob/06c51935aa207eef8ef75df24172e8656085c3ff/apisix/discovery/nacos/init.lua#L200-L203 L202 the code may like ```lua local dup = de_duplication(services, namespace_id, group_name, up.service_name, up.scheme) if dup then goto CONTINUE end if up.discovery_type == 'nacos' then ``` we can compare new service and services in de_duplication function, such as: ```lua local function de_duplication(services, namespace_id, group_name, service_name, scheme) for _, service in ipairs(services) do if service.namespace_id == namespace_id and service.group_name == group_name and service.service_name == service_name and service.scheme == scheme then return true end end return false end ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[apisix-helm-chart] branch master updated: feat(apisix): expose stream proxy tcp/udp ports (#227)
This is an automated email from the ASF dual-hosted git repository. zhangjintao pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/apisix-helm-chart.git The following commit(s) were added to refs/heads/master by this push: new 3d9afdd feat(apisix): expose stream proxy tcp/udp ports (#227) 3d9afdd is described below commit 3d9afddb1b6ae022fefcbe19bf1f7ed8671f5b2f Author: Gallardot AuthorDate: Thu Feb 10 12:10:00 2022 +0800 feat(apisix): expose stream proxy tcp/udp ports (#227) --- charts/apisix/templates/deployment.yaml | 18 ++ charts/apisix/templates/service-gateway.yaml | 20 2 files changed, 38 insertions(+) diff --git a/charts/apisix/templates/deployment.yaml b/charts/apisix/templates/deployment.yaml index 97df7ab..523110e 100644 --- a/charts/apisix/templates/deployment.yaml +++ b/charts/apisix/templates/deployment.yaml @@ -68,6 +68,24 @@ spec: containerPort: {{ .Values.serviceMonitor.containerPort }} protocol: TCP {{- end }} +{{- if and .Values.gateway.stream.enabled (or (gt (len .Values.gateway.stream.tcp) 0) (gt (len .Values.gateway.stream.udp) 0)) }} +{{- with .Values.gateway.stream }} +{{- if (gt (len .tcp) 0) }} +{{- range $index, $port := .tcp }} +- name: proxy-tcp-{{ $index | toString }} + containerPort: {{ $port }} + protocol: TCP +{{- end }} +{{- end }} +{{- if (gt (len .udp) 0) }} +{{- range $index, $port := .udp }} +- name: proxy-udp-{{ $index | toString }} + containerPort: {{ $port }} + protocol: UDP +{{- end }} +{{- end }} +{{- end }} +{{- end }} readinessProbe: failureThreshold: 6 initialDelaySeconds: 10 diff --git a/charts/apisix/templates/service-gateway.yaml b/charts/apisix/templates/service-gateway.yaml index 1361872..db88c4a 100644 --- a/charts/apisix/templates/service-gateway.yaml +++ b/charts/apisix/templates/service-gateway.yaml @@ -66,6 +66,26 @@ spec: {{- end }} protocol: TCP {{- end }} + {{- if and .Values.gateway.stream.enabled (or (gt (len .Values.gateway.stream.tcp) 0) (gt (len .Values.gateway.stream.udp) 0)) }} + {{- with .Values.gateway.stream }} + {{- if (gt (len .tcp) 0) }} + {{- range $index, $port := .tcp }} + - name: proxy-tcp-{{ $index | toString }} +port: {{ $port }} +targetPort: {{ $port }} +protocol: TCP + {{- end }} + {{- end }} + {{- if (gt (len .udp) 0) }} + {{- range $index, $port := .udp }} + - name: proxy-udp-{{ $index | toString }} +port: {{ $port }} +targetPort: {{ $port }} +protocol: UDP + {{- end }} + {{- end }} + {{- end }} + {{- end }} selector: {{- include "apisix.selectorLabels" . | nindent 4 }} {{- end }}
[GitHub] [apisix-helm-chart] tao12345666333 merged pull request #227: feat(apisix): expose stream proxy tcp/udp ports
tao12345666333 merged pull request #227: URL: https://github.com/apache/apisix-helm-chart/pull/227 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] Gary-Airwallex commented on issue #6266: bug: ctx.lua#59 parse_graphql(ctx)
Gary-Airwallex commented on issue #6266: URL: https://github.com/apache/apisix/issues/6266#issuecomment-1034473794 @Chever-John May I also suggest that the `parse_graphql` function should handle the case of GET requests? https://graphql.org/learn/serving-over-http/#get-request Currently an error message is returned regardless of HTTP method used. ``` local body, err = request.get_body(max_size, ctx) if not body then return nil, "failed to read graphql body: " .. (err or "request body has zero size") end ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] Chever-John commented on issue #6266: bug: ctx.lua#59 parse_graphql(ctx)
Chever-John commented on issue #6266: URL: https://github.com/apache/apisix/issues/6266#issuecomment-1034477830 In fact, these are the two new features (support 'json' & 'GET') that we're going to introduce next. As for the launch time, I personally expect it to be completed within a week. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] Chever-John edited a comment on issue #6266: bug: ctx.lua#59 parse_graphql(ctx)
Chever-John edited a comment on issue #6266: URL: https://github.com/apache/apisix/issues/6266#issuecomment-1034477830 In fact, these are the two new features (support 'json' & 'GET') that we're going to introduce next. As for the launch time, I personally expect it to be completed within a week. > @Chever-John May I also suggest that the `parse_graphql` function should handle the case of GET requests? https://graphql.org/learn/serving-over-http/#get-request Currently an error message is returned regardless of HTTP method used. > > ``` > local body, err = request.get_body(max_size, ctx) > if not body then > return nil, "failed to read graphql body: " .. (err or "request body has zero size") > end > ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] Chever-John edited a comment on issue #6266: bug: ctx.lua#59 parse_graphql(ctx)
Chever-John edited a comment on issue #6266: URL: https://github.com/apache/apisix/issues/6266#issuecomment-1034477830 In fact, these are the two new features (support 'json' & 'GET') that we're going to release next. As for the launch time, I personally expect it to be completed within a week. > @Chever-John May I also suggest that the `parse_graphql` function should handle the case of GET requests? https://graphql.org/learn/serving-over-http/#get-request Currently an error message is returned regardless of HTTP method used. > > ``` > local body, err = request.get_body(max_size, ctx) > if not body then > return nil, "failed to read graphql body: " .. (err or "request body has zero size") > end > ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] Chever-John edited a comment on issue #6266: bug: ctx.lua#59 parse_graphql(ctx)
Chever-John edited a comment on issue #6266: URL: https://github.com/apache/apisix/issues/6266#issuecomment-1034477830 In fact, these are the two new features (support 'json' & 'GET') that we're going to release next. As for the launch time, I personally expect it to be completed within a week. @pcyan > @Chever-John May I also suggest that the `parse_graphql` function should handle the case of GET requests? https://graphql.org/learn/serving-over-http/#get-request Currently an error message is returned regardless of HTTP method used. > > ``` > local body, err = request.get_body(max_size, ctx) > if not body then > return nil, "failed to read graphql body: " .. (err or "request body has zero size") > end > ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] spacewander commented on issue #6276: bug: prometheus plugin `enable_export_server=false` not working as expected
spacewander commented on issue #6276: URL: https://github.com/apache/apisix/issues/6276#issuecomment-1034495761 > They are a logical AND relationship. > > Need to configure both `enable_export_server: false` and `public_api` plugin. Yes > @spacewander thanks for your reply. Does that mean these descriptions in the documentation are wrong? `enable_export_server=false` no longer have any real value? > > ``` > If you still want to expose the metrics via the data plane port (default: 9080), you can configure it like this: > > plugin_attr: > prometheus: > enable_export_server: false > You may need to use [public-api](https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/public-api.md) plugin to expose it. > ``` > > [https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/prometheus.md#api](https://github.com/apache/apisix/blob/master/docs/en/latest/plugins/prometheus.md?rgh-link-date=2022-02-10T02%3A01%3A57Z#api) Look like we should fix the description of `You may need to use`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[apisix] branch dependabot/github_actions/actions/setup-go-2.2.0 created (now dc5c61d)
This is an automated email from the ASF dual-hosted git repository. github-bot pushed a change to branch dependabot/github_actions/actions/setup-go-2.2.0 in repository https://gitbox.apache.org/repos/asf/apisix.git. at dc5c61d build(deps): bump actions/setup-go from 2.1.5 to 2.2.0 No new revisions were added by this update.
[GitHub] [apisix] dependabot[bot] opened a new pull request #6279: build(deps): bump actions/setup-go from 2.1.5 to 2.2.0
dependabot[bot] opened a new pull request #6279: URL: https://github.com/apache/apisix/pull/6279 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2.1.5 to 2.2.0. Release notes Sourced from https://github.com/actions/setup-go/releases";>actions/setup-go's releases. Add check-latest input In scope of this release we add the https://github-redirect.dependabot.com/actions/setup-go/pull/186";>check-latest input. If check-latest is set to true, the action first checks if the cached version is the latest one. If the locally cached version is not the most up-to-date, a Go version will then be downloaded from https://github.com/actions/go-versions";>go-versions repository. By default check-latest is set to false. Example of usage: steps: - uses: actions/checkout@v2 - uses: actions/setup-go@v2 with: go-version: '1.16' check-latest: true - run: go version Moreover, we updated @actions/core from 1.2.6 to 1.6.0 Commits https://github.com/actions/setup-go/commit/bfdd3570ce990073878bf10f6b2d79082de49492";>bfdd357 Implement "check-latest" flag to check if pre-cached version is latest one (#... https://github.com/actions/setup-go/commit/44e221478fc6847752e5c574fc7a7b3247b00fbf";>44e2214 Replace 'ubuntu-16.04' -> 'ubuntu-latest' (https://github-redirect.dependabot.com/actions/setup-go/issues/180";>#180) See full diff in https://github.com/actions/setup-go/compare/v2.1.5...v2.2.0";>compare view [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/setup-go&package-manager=github_actions&previous-version=2.1.5&new-version=2.2.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- Dependabot commands and options You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [apisix] bisakhmondal commented on a change in pull request #6228: feat(loggly): support HTTP response code to SYSLOG severity mapping
bisakhmondal commented on a change in pull request #6228: URL: https://github.com/apache/apisix/pull/6228#discussion_r803310088 ## File path: apisix/plugins/loggly.lua ## @@ -85,6 +86,17 @@ local schema = { type = "boolean", default = true }, +severity_map = { +type = "object", +description = "upstream response code vs syslog severity mapping", +patternProperties = { +[".*"] = { Review comment: @spacewander It works as well as doesn't work. Example 1: Want :heavy_check_mark: Got: :heavy_check_mark: ```json ... "severity_map": { "200": "INFO" } ... ``` Example 2: Want :x: Got: :x: ```json ... "severity_map": { "200": "abc" } ... ``` Example 3: Want :x: Got: :heavy_check_mark: : ```json ... "severity_map": { "abc": "def" } ... ``` The problem is, if the key fails to match regex, the pattern properties don't get applied. Also, the program doesn't throw an error for the key mismatch. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@apisix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org