Commit Graph

377 Commits

Author SHA1 Message Date
YuanSheng Wang
ee7533874d
optimize: Use lru to avoid resolving IP addresses repeatedly . (#1772)
* optimize: Use lru to avoid resolving IP addresses repeatedly .
Cached the global rules to `ctx` .

* optimzie: used a longer time interval for etcd and flush access log.

* optimize: return upstream node directly if the count is 1 .

* optimize: avoid to cache useless variable.
2020-06-28 18:14:38 +08:00
Shenal Silva
ef89dceda6
feature: support etcd auth (#1769)
Fix #1713 , #1770
2020-06-26 17:25:58 +08:00
Shenal Silva
492fa71cbc
bugfix: added content-type for admin API responses (#1746) 2020-06-24 13:57:10 +08:00
YuanSheng Wang
d419fb2289
test: added test cases. (#1752) 2020-06-24 09:59:11 +08:00
YuanSheng Wang
e30a7469bc
test: use longer ttl, avoid the cached item expired. (#1760) 2020-06-23 18:21:08 +08:00
Wen Ming
d372fe2516
bugfix: fixed configures of nginx.conf for security reasons (#1759)
removed working_directory and removed TLSv1 TLSv1.1 from ssl_protocols
2020-06-23 16:03:19 +08:00
YuanSheng Wang
6a43a8c735
feature: implemented plugin uri-blocklist . (#1727)
first step: #1617
2020-06-22 14:45:55 +08:00
YuanSheng Wang
748e33756b
refactory: collect upstream logic and put them in a single file. (#1734)
feature: support dynamic upstream in plugin.

here is a mini  example in `access` phase of plugin:

```lua
    local up_conf = {
        type = "roundrobin",
        nodes = {
            {host = conf.upstream.ip, port = conf.upstream.port, weight = 1},
        }
    }

    local ok, err = upstream.check_schema(up_conf)
    if not ok then
        return 500, err
    end

    local matched_route = ctx.matched_route
    upstream.set(ctx, up_conf.type .. "#route_" .. matched_route.value.id,
                 ctx.conf_version, up_conf, matched_route)
    return
```
2020-06-22 14:21:42 +08:00
Eric Shi
2b5ddbca2f
test: add test cases about the string id in service #1659 (#1750) 2020-06-22 12:55:58 +08:00
YuanSheng Wang
f1e66ad1a3
bugfix: id can be string object, which contains ^[a-zA-Z0-9-_]+$. (#1739)
Fix #1654
2020-06-21 16:28:11 +08:00
Ayeshmantha Perera
f8f104dc0f
feature(echo): support header filter and access phases. (#1708) 2020-06-19 21:33:20 +08:00
YuanSheng Wang
e38d0a9dc8
change: update resty-radixtree to version 1.9 . (#1730) 2020-06-19 12:24:52 +08:00
Vinci Xu
3010e04d47
feat[batch-request]: cp all header to every request (#1697) 2020-06-16 18:09:02 +08:00
Nirojan Selvanathan
cd98a2bec8
feature: support authorization Plugin for Keycloak Identity Server (#1701) 2020-06-16 13:51:36 +08:00
Ayeshmantha Perera
1764890d08
feature: support body filter plugin echo. (#1632) 2020-06-13 20:56:11 +08:00
nic-chen
56aeb4a6a9
feature: ssl enhance (#1678)
support enable or disable ssl by patch method
support encrypted storage of the SSL private key in etcd
support multi snis

Fix #1668
2020-06-13 16:10:27 +08:00
YuanSheng Wang
b34b554597
change: set default reject code for some plugins (#1696)
plugin list:

limit-count
limit-conn
limit-req
2020-06-11 15:30:14 +08:00
YuanSheng Wang
2025337077
test: add test case for route with filter_func. (#1683) 2020-06-11 11:03:02 +08:00
YuanSheng Wang
1b7c1bc583
test case: formatted by reindex. (#1651) 2020-06-09 20:48:16 +08:00
nic-chen
b59a519197
feat: support resource name for route, service and upstream object. (#1655) 2020-06-09 08:26:33 +08:00
stone4774
d6cee162d6
plugin: add consumer-restriction (#1437) 2020-06-08 12:49:46 +08:00
YuanSheng Wang
c452846b81
bugfix: wildcard certificates cannot match multi-level subdomains in … (#810) 2020-06-08 10:52:25 +08:00
dabue
171db26e12
test: add test case for #1625 to test the filed of overhead (#1645) 2020-06-05 21:23:42 +08:00
Wen Ming
f615cf7134
feature: support http_to_https in redirect plugin. (#1642) 2020-06-03 17:46:58 +08:00
Wen Ming
82f85e5946
test: added test tests for skywalking. (#1621) 2020-06-02 12:24:56 +08:00
nic-chen
ecd684b3a0
feat(admin api): enhance PATCH method, allow to update partial data. (#1609) 2020-06-02 11:28:45 +08:00
Vinci Xu
6faf3ef2ed
bugfix(batch-requests): support cookie (#1599) 2020-06-02 09:26:24 +08:00
Wen Ming
398941b72f
feature: add skywalking plugin. (#1241) 2020-05-27 17:55:47 +08:00
Wen Ming
67a2096540
test cases: add doc and test cases for how to redirect http to https. (#1595)
* add FAQ about redirect http To https

* add test cases for serverless plugin and redirect plugin

Co-authored-by: rhubard <18734141014@163.com>
2020-05-26 23:11:29 +08:00
YuanSheng Wang
c9a53abbb9
test: updated style. (#1606) 2020-05-22 21:34:58 +08:00
qiujiayu
e7d19ec160
feature: support discovery center (#1440) 2020-05-14 23:20:44 +08:00
YuanSheng Wang
cafbfe160a
feature: support new field exptime for SSL object. (#1575)
fix #1571.
2020-05-12 15:50:52 +08:00
YuanSheng Wang
463c521929
feature(prometheus): support to collect metric overhead (#1576)
Fix #1534 .
2020-05-12 15:47:49 +08:00
nic-chen
0300304011
bugfix: got 500 error when using post method in grpc-transcode plugin(#1566) 2020-05-11 13:30:28 +08:00
Nirojan Selvanathan
64fcb9fd72
plugin: add HTTP logger for APISIX (#1396) 2020-05-09 16:19:41 +08:00
Vinci Xu
ffce4b7720
bugfix(CORS): using rewrite phase and add lru cache for multiple origin (#1531) 2020-05-06 11:52:49 +08:00
Ayeshmantha Perera
33b437df4e
feature: implemented plugin sys logger. (#1414) 2020-05-06 10:49:18 +08:00
Vinci Xu
3a9e0fc675
feature: add batch request plugin. (#1388) 2020-04-29 21:40:45 +08:00
Nirojan Selvanathan
c6cc2b5fcb
plugin(kafka-logger): Updating kafka logger to use the batch processor util (#1358) 2020-04-29 12:12:41 +08:00
YuanSheng Wang
89a07efb51
test: reindex by tools reindex. (#1519) 2020-04-28 18:54:14 +08:00
罗泽轩
972840ec96
fix: skip tombstone mark when iterating the global values (#1517)
Close #1473.
2020-04-28 17:25:55 +08:00
YuanSheng Wang
0f3310562c
bugfix: init clean_handlers when add new item from etcd. (#1412)
fix #1384
2020-04-28 16:01:04 +08:00
nic-chen
a53b4707fb
feat: support saving k8s deployment info to upstream (#1502)
* feat: support save k8s deployment info to upstream
2020-04-27 10:47:17 +08:00
罗泽轩
ca91387a60
test: fix regex usage in some cases (#1504) 2020-04-26 10:43:08 +08:00
YuanSheng Wang
c351b38086
bugfix(lrucache): when creating cached objects, use resty-lock to avoid repeated creation. (#1486)
* bugfix(lrucache): one common use case for this library is avoid the so-called "dog-pile effect",
    that is, to limit concurrent backend queries for the same key when a cache miss happens.
* bugfix: catch the error messag by pcall, it may fail when generate new validator.
2020-04-22 17:47:16 +08:00
Wen Ming
19663a87a0
bug: fixed wrong string join in limit-count plugin. (#1487) 2020-04-22 13:27:00 +08:00
YuanSheng Wang
7440192f8f
bugfix(CI): avoid to install APISIX to deps folder, that is a bug for older luarocks (#1471)
If the Luarocks version is lower than "v2.4.3", it does not support the "--only-deps" parameter. Even if we set the "--only-deps" parameter, no error message will be given during runtime.

We only wanted to install the dependencies in the deps directory, but the APISIX was also installed so that the test case might load the wrong version of the source code.
2020-04-20 09:09:14 +08:00
罗泽轩
9baad7856b
bug(proxy-rewrite): reject invalid header (#1462) 2020-04-16 19:01:19 +08:00
YuanSheng Wang
669772f5d5
bugfix: check if the service's upstream node is host. (#1402) 2020-04-12 09:31:58 +08:00
YuanSheng Wang
256cc19980
bugfix: throw error meg when call admin API to enable mqtt plugin but stream_proxy is disabled. (#1407) 2020-04-08 16:24:55 +08:00
paoying
c91da997eb
feature(jwt-auth): support base64 secret for jwt-auth plugin. (#1224) 2020-04-08 09:34:14 +08:00
Lien
f5a078274f
feature: add service name and report local server IP for Zipkin plugin (#1386) 2020-04-08 08:47:41 +08:00
YuanSheng Wang
076ecf3ade
bugfix: should not drop the error msg of dns_parse. (#1398)
fix #573 .
2020-04-06 11:04:09 +08:00
Nirojan Selvanathan
25e110135a
featue: Updating the UDP logger to use the batch processor util (#1355) 2020-04-03 16:33:32 +08:00
Nirojan Selvanathan
d90e982e6e
feature: Updating TCP logger to use the batch processor util (#1356) 2020-04-03 10:54:05 +08:00
罗泽轩
eb358e94c8
bugfix: plugin in header_filter/body_filter should be run like log phase (#1383) 2020-04-02 17:20:13 +08:00
Lien
69d2039520
plugin(response-rewrite): rewrite binary data to client by base64 (#1381) 2020-04-02 12:03:58 +08:00
罗泽轩
e24fd851a3
change: blacklist $request_method in proxy-cache's cache key. (#1385)
Close #1307
2020-04-02 08:55:48 +08:00
Wen Ming
c76e7e3623
feature: remove lua dir. (#1351) 2020-03-31 23:23:29 +08:00
iGeeky
84707263d0
plugin(wolf-rbac): added new api change_pwd and user_info. (#1204) 2020-03-31 13:39:49 +08:00
YuanSheng Wang
d7f54ff518
feature: support to print log with specific prefix. (#1284) 2020-03-31 10:25:05 +08:00
Nirojan Selvanathan
52934b5fc7
Batch Processor: Fix for rescheduling execution for max_retry_count is 0 and 1 (#1349) 2020-03-30 09:44:33 +08:00
Nirojan Selvanathan
c3400867d5
Adding test case for public key based introspection (#1354) 2020-03-30 09:42:27 +08:00
YuanSheng Wang
aa13b72c0d
luacov: add new path plugins/limit-count and plugins/utils. (#1357) 2020-03-29 10:58:11 +08:00
Vinci Xu
c363ea46d9
feature: add cors plugin (#1327) 2020-03-29 10:30:59 +08:00
YuanSheng Wang
51684de77b
bugfix: fail to get the http request header by ngx.var. * (#1348)
* bugfix: to get the HTTP request header by `ngx.var.*`, we need to convert
  the name to lower case with dashes replaced by underscores.

more information:

http://nginx.org/en/docs/http/ngx_http_core_module.html#var_http_

* change: the key should be a string object when fetching a value from `ctx.var`.

* bug(make lint): If the code style is bad, do exit with code 1.
2020-03-27 23:13:46 +08:00
qiujiayu
7baa0abd44
feature: if the dns_resolver is not set in the file conf/config.yaml, use the resolver in local DNS. (#1217)
Fix #1164
2020-03-26 09:48:18 +08:00
dabue
5970b50568
change: code style in lua/apisix.lua and t/plugin/proxy-mirror.t (#1339) 2020-03-26 07:23:19 +08:00
罗泽轩
be348805ea
feature: run log plugins in the global rule (#1333)
* feature: run log plugins in the global rule

Close #1202.

* register path as hello3 to avoid conflicts with other test case
2020-03-25 09:48:12 +08:00
Ayeshmantha Perera
8adafa3ee2
feature: add Kafka Logger plugin. (#1312) 2020-03-25 08:26:45 +08:00
Lien
5be1daacb1
deletion: drop webdocket enable control in proxy-rewrite plugin (#1332)
* deletion: drop webdocket enable control in proxy-rewrite plugin

* fix test-case
2020-03-24 21:16:21 +08:00
YuanSheng Wang
67b63b24af
bugfix: added key field when parse route from local yaml. (#1334) 2020-03-24 20:19:04 +08:00
YuanSheng Wang
8d745c7441
test: wait a longer time. (#1323) 2020-03-23 00:03:51 +08:00
YuanSheng Wang
60b88536fe
bugfix: check the count of upstream valid node. (#1292) 2020-03-19 12:07:43 +08:00
罗泽轩
a4509b6d9e
chore: improve the preallocation in deepcopy method (#1298) 2020-03-19 08:12:33 +08:00
agile6v
fc948f9578
feautre: support for proxy mirror plugin. (#1288) 2020-03-19 08:10:03 +08:00
YuanSheng Wang
9837b80ac5
update resty-etcd to version 0.9 . (#1278) 2020-03-16 08:46:30 +08:00
agile6v
864aa16e91
feature: support for proxy caching plugin based on disk. (#1153) 2020-03-15 22:26:08 +08:00
Ayeshmantha Perera
d07871186a
feature: implemented tcp logger plugin. (#1221) 2020-03-15 09:22:13 +08:00
YuanSheng Wang
33699f8407
bugfix(proxy-rewrite): Invalid pattern. (#1267)
Fix #1263
2020-03-14 22:19:13 +08:00
YuanSheng Wang
177892f1a4
bugfix: return the schema of plugin grpc-transcode. (#1265) 2020-03-14 22:01:47 +08:00
YuanSheng Wang
8e8ec23539
bugfix: 'required' should same level as properties, added test case. (#1261)
* travis: use golang binary file directly.
2020-03-14 15:41:02 +08:00
YuanSheng Wang
aa3c71a10a
bugfix: plugin node-status and heartbeat don't have schema. (#1249) 2020-03-14 09:34:34 +08:00
YuanSheng Wang
c53f714613
test: added test cases. (#1252)
fix #1246
2020-03-13 20:06:22 +08:00
YuanSheng Wang
834e9e1873
bugfix: the plugin basic-auth needs required field (#1251)
Fix #1244
2020-03-13 20:05:44 +08:00
Wen Ming
0ff1c820ae
bugfix: hide ssl private key in admin API. (#1240) 2020-03-13 15:56:38 +08:00
Nirojan Selvanathan
1c3fd309f1
test case: adding test case for extending buffer timer (#1222) 2020-03-08 16:00:19 +08:00
Vinci Xu
c2250383f2
bugfix: global ruls admin api should list resource without id (#1199) 2020-03-07 19:51:40 +08:00
Wen Ming
be2eec3c6d
feature: supported key-based authentication to the dashboard. (#1169) 2020-03-05 14:48:27 +08:00
Nirojan Selvanathan
429f0165c2
feature: Moving logs utils and batch processor to utils dir and typo fixes in docs (#1191) 2020-03-04 09:44:17 +08:00
温铭 WenMing
a6f7c8571e
bugfix: return 400 when not pass plugin name to admin API. (#1174) 2020-02-28 16:26:39 +08:00
qiujiayu
b210a7b866
feature: support to load different config file by ENV APISIX_PROFILE profile (#1147) 2020-02-28 08:46:42 +08:00
YuanSheng Wang
0ee3c4be0e
bugfix(prometheus): the balancer IP may be nil, use an empty string i… (#1166)
* bugfix(prometheus): the balancer IP may be nil, use an empty string instead.
2020-02-27 16:14:56 +08:00
YuanSheng Wang
6cca341b7f
test: exported ENV{APISIX_HOME}, allow user to define the working path by himself. (#1160)
* change: enable Lua code coverage.
2020-02-26 21:26:01 +08:00
YuanSheng Wang
188b1849b2
bugfix: compare server_port with number data type. (#1154) 2020-02-24 19:32:32 +08:00
nic-chen
b66ff90f1f
feat: plugin grpc-transcode supports grpc deadline (#1149) 2020-02-24 10:58:15 +08:00
wonglend
5b1a47a38e
feature: Support password auth for plugin limit-count-redis (#1150) 2020-02-24 10:54:48 +08:00
YuanSheng Wang
859e085c21
test: need to escape the character {. (#1148) 2020-02-21 21:02:03 +08:00
Nirojan Selvanathan
d50727bcf0
feature: Batch processor implementation to aggregate logs in batch (#1121) 2020-02-20 15:25:20 +08:00
YuanSheng Wang
fbb9bd039c
bugfix: checked consumer first, it maybe a boolean value when it was beed deleted. (#1139) 2020-02-20 15:23:30 +08:00