Commit Graph

669 Commits

Author SHA1 Message Date
nic-chen
baf8a26cea
chore: expose more schema via control API (#3127) 2020-12-25 21:26:15 +08:00
Yuelin Zheng
86fa46d85b
feat: Implement traffic splitting plugin (#2935)
close #2303
close #2603
2020-12-25 15:53:00 +08:00
guyang
0802c95faf
feat: add batch process metrics (#3070) 2020-12-24 19:24:46 +08:00
罗泽轩
966d68829a
feat: validate certificate & key (#3085)
Fix #296
Fix #2816

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2020-12-23 21:30:09 +08:00
罗泽轩
a661b940b0
feat: add script_id field used by dashboard (#3096)
Used as a reference to script metadata.
2020-12-23 19:17:26 +08:00
罗泽轩
357a2efa68
feat: expose schema via control API (#3092)
Close #3022
2020-12-23 16:40:19 +08:00
罗泽轩
560a2fe3ab
change: remove k8s_deployment_info (#3098)
Fix #3068
2020-12-22 22:28:47 +08:00
Alex Zhang
c3d61fcfa3
feat: add control api for plugin server-info (#3088)
* feat: add control api for plugin server-info

Previously we added plugin server-info without exposing API since the same port problem of admin api and proxy. Now we have Control API support so we expose server-info API through Control API. People now can insight the server info about APISIX instance easily.
2020-12-22 11:04:56 +08:00
罗泽轩
7c158b739a
refactor: don't force plugin to use /vn prefix (#3081) 2020-12-21 10:38:10 +08:00
罗泽轩
31b49ad0e1
fix: upgrade lua-resty-ngxvar to solve the upstream_xxx_time problem (#3065)
Fix #2954
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2020-12-20 20:09:46 +08:00
罗泽轩
e9826b60f3
fix: make debug-mode work with global rule (#3023)
Fix #1667.

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2020-12-18 17:14:51 +08:00
罗泽轩
fd2db606a9
feat: rewrite handwriting validation with jsonschema (#3021)
Fix #2967. Some plugins can't be rewritten, so I have to keep them.

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2020-12-18 16:55:23 +08:00
罗泽轩
310c95158f
feat: allow upstream without nodes (#3076)
Fix #3072
2020-12-18 16:05:54 +08:00
罗泽轩
924a30db36
feat: add control API (#3048)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
Co-authored-by: John Bampton <jbampton@users.noreply.github.com
2020-12-18 15:05:09 +08:00
Peter Zhu
560fca3e0b
fix: fix on setting server info to etcd (#3075)
* fix: fix on setting server info to etcd
2020-12-18 14:46:49 +08:00
罗泽轩
81c8d806a3
test: remove useless skywalking mock (#3066)
Now we connect to real skywalking for test.

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2020-12-18 08:30:55 +08:00
John Bampton
6331e5d057
feat(CI): add a GitHub Action to lint the YAML files (#3044)
Lint some YAML
Add a `.yamllint` config file
2020-12-18 08:29:17 +08:00
Yuelin Zheng
bdd00e1f55
feat: support ctx.var to get service_name and route_name (#3036)
close #2982
2020-12-17 22:26:25 +08:00
罗泽轩
370beda74d
feat: improve the error msg when client doesn't send SNI (#3053) 2020-12-16 08:56:30 +08:00
罗泽轩
d16ac7a021
feat: share etcd client (#2932)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2020-12-15 20:18:25 +08:00
罗泽轩
8420a0f39d
feat: return 502 for upstream not found in the DP (#3050)
Fix #3035

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2020-12-15 18:04:10 +08:00
John Bampton
511f52a856
refactor: remove trailing whitespace (#3040) 2020-12-15 08:56:20 +08:00
John Bampton
dcdbc1cc9e
chore: spelling (#3027) 2020-12-13 19:31:24 +08:00
John Bampton
3c01db5ef0
chore: spelling (#3012)
Co-authored-by: 罗泽轩 <spacewanderlzx@gmail.com>
Co-authored-by: YuanSheng Wang <membphis@gmail.com>
2020-12-13 00:04:48 +08:00
罗泽轩
cc9c1bb090
ci: check misspell (#3011)
Fix #3009
2020-12-10 23:05:36 +08:00
罗泽轩
0eacf3af7d
feat: improve jsonschema validation on route resource (#3008)
fix #2671
fix #2991
2020-12-10 22:53:53 +08:00
罗泽轩
93e2f1647a
feat: route accroding to the graphql attributes (#2964)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2020-12-10 15:51:00 +08:00
罗泽轩
85a84fb191
fix: avoid unnecessary type check and support var in local_conf (#2990)
Also merge bundle of repeated code.

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2020-12-10 15:48:47 +08:00
YuanSheng Wang
a670ea2f2e
bugfix: always necessary to save the data of the limit concurrency, and release the statistical status in the log phase. (#2465)
fix #2450
2020-12-10 14:50:15 +08:00
罗泽轩
270aef027a
test: make node/merge-route.t stable (#2999)
The time_window field might be the last one, which doesn't have ','

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2020-12-09 17:08:26 +08:00
罗泽轩
9918efbe5b
test: solve conflict between #2993 and #2943 (#2997)
Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2020-12-09 14:30:46 +08:00
tzssangglass
c7b198f969
feat: support enable/disable route (#2943)
fix #2737
2020-12-09 10:38:21 +08:00
Alex Zhang
7855d9eed2
feat: implement new plugin server-info (#2926)
close #2821
2020-12-09 10:07:57 +08:00
罗泽轩
1e882e378d
feat: delete useless data in the response (#2993)
Fix #2759

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
2020-12-09 08:53:38 +08:00
罗泽轩
93241949b4
chore(skywalking): the range of sample rate should be [0, ratio) (#2984) 2020-12-08 23:16:22 +08:00
罗泽轩
79075000aa
feat(fault-injection): support Nginx variable in abort.body (#2986)
Fix #2827
2020-12-08 13:18:34 +08:00
罗泽轩
97ed426b4e
fix: refresh cached header when we set request header (#2917) 2020-12-07 21:50:31 +08:00
罗泽轩
08d25ebc51
test: make node/merge-route.t stable (#2978) 2020-12-07 20:21:12 +08:00
罗泽轩
1b8dca96ac
feat: increase the delay before resync (#2977)
It improves the behavior under #2899.
2020-12-07 20:20:31 +08:00
roketyyang
c41aa8534a
feat: update lua-resty-radixtree to 2.5 (#2971)
Co-authored-by: roketyyang <roketyyang@tencent.com>
2020-12-05 21:32:58 +08:00
Alex Zhang
37efc410f0
fix: fixed the non-effective plugin configuration update in tcp/udp-logger plugin (#2928) 2020-12-04 23:55:38 +08:00
guyang
21a18c17f3
fix: change string concat (#2953)
* change  string concat

* change function range

* change function space

* change local var

* fix test case
2020-12-04 22:43:34 +08:00
罗泽轩
2f3ab6a2bc
feat: disable node-status by default (#2968)
Fix #2952
2020-12-04 22:25:11 +08:00
罗泽轩
f84a44e409
feat(limt-count): use 'remote_addr' as default key (#2927) 2020-12-02 17:04:31 +08:00
罗泽轩
bbbd10e1b3
feat: validate the operator in vars (#2911)
Fix #2878
2020-12-02 15:37:07 +08:00
罗泽轩
a019b4e4d0
test: improve chash-balance cases (#2920)
Fix #2914
2020-12-02 15:12:00 +08:00
Alex Zhang
fa30c102e0
fix: fixed the non effective config update in http-logger (#2901)
* change: changed log level when delete stale batch processor objects

close #2870
2020-12-01 23:06:33 +08:00
Jens Keiner
c140d0eddc
fix: Basic auth plugin should run in rewrite phase. (#2905) 2020-12-01 23:03:45 +08:00
罗泽轩
ddfeb5de1d
fix: reject "" for route's remote_addrs (#2907)
This change imroves the IP schema validation.
2020-12-01 15:44:50 +08:00
罗泽轩
a63b6b8c6e
feat: allow create consumers with multiple auth plugins (#2898)
Fix #2850
2020-12-01 15:42:59 +08:00
tzssangglass
9dfe697b64
feat: allow user to specify APISIX id in config.yaml (#2893)
fix #2810
2020-11-30 19:08:04 +08:00
dabue
e66dd9a314
feat: implement error-log-logger plug-in (#2592) 2020-11-30 14:43:16 +08:00
罗泽轩
f267291f3a
feat(prometheus): allow customizing Prometheus export uri (#2826)
* feat(prometheus): allow customizing Prometheus export uri

Close #2296.
2020-11-30 14:35:06 +08:00
罗泽轩
44855ec1a7
ci: make it work under OpenResty 1.19 (#2768) 2020-11-30 10:32:35 +08:00
Wen Ming
d2ea344fc1
Revert "refactor: separate admin and proxy port in default config (#2802)" (#2871)
This reverts commit b13f167445.

Co-authored-by: Vinci Xu <277040271@qq.com>
2020-11-28 19:05:14 +08:00
罗泽轩
1c211ff7b1
fix: validate plugin configuration in the DP (#2856)
Fix #2834
2020-11-28 13:29:00 +08:00
罗泽轩
f4dfcfbb6b
fix: we didn't initialize custom variable for admin access log (#2874)
* fix: we didn't initialize custom variable for admin access log

* t
2020-11-28 13:12:17 +08:00
Yuelin Zheng
d7e59113d5
feat: How to distinguish whether the 5xx status code (eg 500) comes from upstream or apisix (#2817)
close #2501
2020-11-27 18:33:02 +08:00
罗泽轩
35269581e2
test: increase waiting time to make plugins reload test stable (#2868) 2020-11-27 17:36:58 +08:00
罗泽轩
67eb787c38
fix: distinguish different routes which has the same service (#2840)
Fix #2828.

The bug is introduced in #2121.

Can't be reproduced in over 1 millions requests after applying this
patch.
2020-11-25 14:32:11 +08:00
罗泽轩
1ad90f7206
chore: sort default plugin list for easier search (#2824) 2020-11-25 14:11:24 +08:00
Yuelin Zheng
72f907ea8b
feat: the request parameter participating in the signature can be the parameter name (#2830)
close #2823
2020-11-25 13:05:03 +08:00
Vinci Xu
b13f167445
refactor: separate admin and proxy port in default config (#2802)
change all admin 9080 to 9180
2020-11-24 16:51:47 +08:00
Peter Zhu
95226d950f
fix: check decrypt key to prevent lua thread aborted (#2815)
Fix #2791
2020-11-24 16:43:29 +08:00
Yuelin Zheng
dc5fee27a2
feat(kafka-logger): the key field should be optional. (#2807)
fix #2778
2020-11-24 16:05:52 +08:00
罗泽轩
d7593a0ac3
feat: support '.' in id definition (#2795)
* feat: support '.' in id definition

Close #2274.

* tweak test
2020-11-23 22:36:40 +08:00
Shuyang Wu
36162e3607
fix: move conf/cert to t/certs and disable ssl by default (#2112) 2020-11-20 11:10:01 +08:00
guyang
b3cd11ff02
feat: Improve zipkin span reporter performance (#2727)
Close #2726
2020-11-19 11:31:07 +08:00
guyang
5b396020d5
feat: support plugin for "aliyun" log service (#2177) 2020-11-19 00:04:01 +08:00
Yousa
208ae3d2b7
chore: format the string.find (#2785) 2020-11-18 23:58:36 +08:00
罗泽轩
e7223e77a3
fix(http-logger): correct the Content-Type of newline format log report (#2780) 2020-11-18 17:51:03 +08:00
罗泽轩
1a24c2af39
refactor(consumer): remove id and use username only (#2679)
Close #2656
Close #2653
Close #2651
2020-11-18 17:44:40 +08:00
Yuelin Zheng
e4de3d5b9b
feat(proxy-cache): the cache_zone field in the schema should be optional (#2776) 2020-11-18 16:07:13 +08:00
Yousa
53e2d5387f
fix: remove upstream 'Server' header info. fix #2714 (#2731)
fix #2714
2020-11-18 13:15:31 +08:00
Yuelin Zheng
a6678c33c5
fix(hmac-auth): when the request contains escape characters, the signature verification fails (#2749)
fix #2710
2020-11-18 09:02:37 +08:00
罗泽轩
8983a8dd27
fix(etcd): avoid getting with prefix (#2772)
Fix #2771.
2020-11-17 21:28:55 +08:00
罗泽轩
671d184ceb
bugfix: we didn't keep the create_time correctly (#2760) 2020-11-17 18:39:28 +08:00
罗泽轩
dec9518d3c
test: improve bin/apisix test cases. (#2761)
* test: improve bin/apisix test cases.

Avoid modifying config-default,yaml directly.

* unset APISIX_PROFILE

* increase sleep time
2020-11-17 18:00:30 +08:00
Firstsawyou
8166f7a2d7
fix: the log report of the custom log format is incorrect. (#2729)
fix #2723
2020-11-15 19:46:50 +08:00
罗泽轩
0654687aed
test: write the config.yaml according to the profile (#2736) 2020-11-15 19:36:53 +08:00
罗泽轩
23a47b9eac
fix: user's route was prior to the plugin's one (#2733) 2020-11-15 17:28:56 +08:00
罗泽轩
91d99452c5
test: check SSL configuration for stand alone mode (#2705) 2020-11-15 17:23:02 +08:00
罗泽轩
58cba26e51
fix(http-logger): validate uri (#2708) 2020-11-15 17:22:25 +08:00
罗泽轩
da4e12e0f7
feat: generate create/update_time automatically (#2740) 2020-11-15 17:20:51 +08:00
Firstsawyou
3ff46e28eb
chore: code format optimization of t/lib/server.lua file. (#2742)
fix #2697
2020-11-13 22:27:03 +08:00
罗泽轩
39879630ae
fix: reload plugin when plugin attribute is cahnged (#2704)
Close #2655
2020-11-13 00:23:30 +08:00
Firstsawyou
2ba28ff6a7
chore: sort the request headers output by the _M.uri and _M.old_uri function in t/lib/server.lua (#2696)
fix #2636
2020-11-12 14:37:51 +08:00
罗泽轩
a2fa3ff89d
ci: self host openid configuration (#2698)
Also split long test
2020-11-11 11:38:25 +08:00
罗泽轩
b3f240c80c
feat: increase the length of rule name to 100 (#2667)
Close #2665
2020-11-11 10:36:28 +08:00
罗泽轩
1ea912d752
fix: use same config-default.yaml for different environments (#2663)
Close #2634.
2020-11-10 19:07:46 +08:00
dabue
70453aece3
chore(core): enabled websocket in route and service (#2593) 2020-11-10 16:56:38 +08:00
罗泽轩
2c37f0e5f2
fix(key-auth): 'key' is required in consumer configuration (#2689)
Close #2686.

According to the
https://github.com/apache/apisix/pull/2120#discussion_r477153261,
instead of skipping consumer without key, we should make 'key' required
only for consumer configuration.
2020-11-10 16:08:46 +08:00
罗泽轩
3ba6629daa
feat: disable example-plugin by default (#2673)
Close #2659.
2020-11-10 08:46:54 +08:00
tzssangglass
53a8f5a2ed
fix: the jwt plugin does not handle the case where exp is empty. (#… (#2657)
fix #2649
2020-11-09 11:01:08 +08:00
罗泽轩
d2d826e6ab
fix(log-rotate): avoid creating multiple timers (#2596) 2020-11-09 09:09:33 +08:00
罗泽轩
ebf0563a40
change: disable skywalking by default. (#2632)
* fix: disable skywalking by default.

Close #2623.

* trailing sw

* clean test
2020-11-09 08:12:52 +08:00
Alex Zhang
188355494d
feat: hide APISIX version from Server header. (#2639)
Sometimes expose version is dangerous, which can be utilized by
malicious crackers when there are some security bugs in that version.
2020-11-07 00:04:28 +08:00
罗泽轩
2ad7f65659
fix(jwt-auth): validate if the claimed secret is base64 encoded. (#2642) 2020-11-06 23:48:21 +08:00
tzssangglass
27875e5790
feat(jwt-auth): support to use of the RS256 algorithm (#2594)
* example for #2523

* fix: jwt-auth plugin RS256 algorithm is not easy to use. (#2523)

fix: add more test cases for jwt plugin. (#2355)

fix #2523

fix #2355
2020-11-06 10:16:20 +08:00
Firstsawyou
6061c8722b
fix: after proxy-mirror plugin mirroring request, http version change… (#2629)
fix #2618
2020-11-05 14:48:58 +08:00
Firstsawyou
b8e853cc39
fix: after proxy-mirror plugin mirroring request, the host in the mir… (#2626)
fix #2617
2020-11-05 08:56:18 +08:00
罗泽轩
073c84f5e6
feat: support stream configuration in standalone mode (#2610)
Close #2048
2020-11-04 10:45:09 +08:00
罗泽轩
4baee2461e
test: check the plugin name for each plugin (#2607)
Close #2579
2020-11-04 09:49:14 +08:00
YuanSheng Wang
34d53fc48b
test: format by reindex. (#2601) 2020-11-03 13:59:01 +08:00
Alex Zhang
5191374545
feat: support TLS connection with etcd. (#2548)
Support the TLS connection when communicating with etcd cluster. We added a configuration item to custom the certificate verification. Whether to setup TLS connection or not depends on the endpoints' scheme, for instance, when endpoints are:

```
etcd:
  host:
    - "https://127.0.0.1:2379"
    - "https://127.0.0.1:3379"
```

APISIX will originate TLS connection automatically, and the Server Name Indication extention will be set by the endpoint host (`127.0.0.1` in above case). Note by default APISIX will verify the certificate, close the verification in configuration explicitly if you want to bypass it.

```
etcd:
  tls:
    verfiy: false
```
2020-11-03 13:53:39 +08:00
罗泽轩
432c954a74
fix: plugin hot reload should work on node (#2430) 2020-11-03 13:46:24 +08:00
罗泽轩
bf44ed124d
change: make lrucache lock optional (#2575) 2020-11-02 16:47:32 +08:00
Peter Zhu
68cf301ed4
chore: move try_read_attr function into table.lua (#2257) (#2566)
Co-authored-by: YuanSheng Wang <membphis@gmail.com>
2020-10-31 09:13:20 +08:00
shoogoome
fff4d14a0d
feature: support multiple service discovery (#2556)
support multiple service discovery,then we can switch it in upstream
2020-10-30 20:34:10 +08:00
guyang
37a0792eb4
bugfix: fix zipkin plugin error when used with limit count plugin (#2499)
fix #2377
2020-10-30 16:20:43 +08:00
罗泽轩
960077f245
fix(echo): modify response body correctly (#2561)
Fix #2427, #2554
2020-10-29 16:48:53 +08:00
YuanSheng Wang
b23475fcba
feat: upgrade skywalking plugin to support skywalking 8.0 . (#2389) 2020-10-29 15:29:52 +08:00
JinChen
61bcb18885
fix: jwt-auth add consumer_schema to the _M (#2555)
Signed-off-by: Jaycean <jinchen_jacean@163.com>
2020-10-29 14:37:13 +08:00
JinChen
d2aa1d8bfb
feat: get schema by schema_type (#2509)
* get schema by schema_type

* Fix setting non standard global variable JSON_ schema

* Fix setting non standard global variable JSON_ schema

* Modify the usage of ngx module

* Fix format issues caused by branch conflicts

* Modify the test case to return data
2020-10-29 09:26:59 +08:00
Firstsawyou
146e222e0c
fix: the plugin hmac-auth missed a \n (#2543)
* fix: the plugin hmac-auth missed a `\n`.
fix #2527

* docs: modify doc.

* fix: consumer-restriction.t and custom_hmac_auth.t
2020-10-28 13:37:22 +08:00
tzssangglass
9b63fd5710
feature: prometheus plugin apisix_http_status metric route tag Improve recognition (#2497)
fix #1574
2020-10-28 13:22:25 +08:00
Vinci Xu
d08d9466d8
chore: change test case to keep stable (#2541) 2020-10-27 23:37:48 +08:00
Alex Zhang
3306a3ed3c
feature: support percentage for fault injection (#2516) 2020-10-27 14:10:44 +08:00
YuanSheng Wang
6a7dfa6775
feat: implement api breaker plugin. (#2455)
Co-authored-by: liuheng <liuhengloveyou@gmail.com>
2020-10-27 13:40:23 +08:00
JinChen
e2f450fa1a
feat:The limit-conn plugin supports 'consumer_name' field (#2415)
The limit-conn plugin supports the` consumer_name` field
The method of PR is referred: #2333
2020-10-27 10:44:44 +08:00
Firstsawyou
80affa0366
feat: The limit-count plugin supports service_id field. (#2521)
fix #2518
2020-10-27 10:41:07 +08:00
罗泽轩
2a66762ca6
change(batch-requests): limit the body size to 1M (#2507)
To avoid blocking on reading large body file and
spending too much memory in encode JSON body.
2020-10-26 21:50:51 +08:00
罗泽轩
9500a8219a
change(jwt-auth): split schema to adapt different occasions (#2459)
Close #2288.
2020-10-26 20:26:11 +08:00
罗泽轩
009681179f
feat(response-rewrite): clear cache headers to avoid polluting the cache (#2504) 2020-10-26 20:25:53 +08:00
Firstsawyou
853a7be0f4
feat(hmac-auth): remove auth headers for hmac-auth plugin. (#2491)
fix #2490
2020-10-25 07:33:11 +08:00
罗泽轩
0f15939a9c
fix: compare if the interceptors are injected by ourselves (#2484)
fix #2482.
2020-10-21 20:34:32 +08:00
Joey
127dac9ebb
feat(prometheus): Add consumer metric data support (#2469)
* feat: Add consumer support for prometheus metrics

Signed-off-by: imjoey <majunjiev@gmail.com>

* Add more detailed comments for newly added consumer label

Signed-off-by: imjoey <majunjiev@gmail.com>
2020-10-21 09:32:52 +08:00
罗泽轩
ed1f08f926
fix(limit-conn): conn and default_conn_delay should > 0 (#2478)
Close #2472.
2020-10-20 20:45:51 +08:00
罗泽轩
5906c73a07
fix: we didn't traverse the plugin interceptors correctly (#2462)
This bug is introduced in 6a543a9.
2020-10-19 15:55:32 +08:00
Alex Zhang
71dcf367d3
change: read 8bytes from /dev/urandom as the random seed for better randomness (#2437) 2020-10-19 14:53:48 +08:00
JinChen
5fcbb4de9c
plugin(consumer-restriction): use draft7 way to rewrite the JSON Schema. (#2440)
fix: #2402
2020-10-19 09:55:08 +08:00
JinChen
9e1030ee42
feat: limit-count plugin supports limiting requests by consumer name. (#2421)
fixed #2333
2020-10-17 19:24:55 +08:00
haifeng9414
3bb670b521
bugfix: set route priority for router radixtree_host_uri. (#2447)
Fix: #2423.
2020-10-17 19:20:51 +08:00
nic-chen
a92331c27a
feature: add managed fields in json schema for resources, such as create_time and update_time (#2444)
* feature: add managed fields in jsonschema for resources, such as create_time and update_time
2020-10-17 18:48:02 +08:00
罗泽轩
6a543a98a2
feat: use interceptors to protect plugin's route (#2416) 2020-10-17 17:45:26 +08:00
Firstsawyou
d1729c0af3
feat: In dns parse, when the parameter resolvers is empty, the local dns is used as resolvers by default (#2424)
fix #2422
2020-10-17 13:44:53 +08:00
YuanSheng Wang
c65f5c9465
feature: plugin limit-count support to use redis cluster (#2406)
fix #638

Co-authored-by: liuheng <liuhengloveyou@gmail.com>
2020-10-17 08:21:47 +08:00
YuanSheng Wang
78910d828b
CI: turn off the Lua code coverage check in CI. (#2435)
We don't enable Lua code override now, its output is unstable and this is unacceptable.

Disabling the Lua code override first will make CI run faster.

* test: print more information when failed.
2020-10-16 09:59:30 +08:00
罗泽轩
b5fe9ced45
change: use 405 as the error code for unsupported HTTP method (#2418) 2020-10-16 09:02:35 +08:00
罗泽轩
4f535e7401
fix(prometheus): don't provide etcd metrics when you don't use it (#2396) 2020-10-14 16:02:08 +08:00
YuanSheng Wang
5614a95758
feat(http-logger): support for specified the log formats via admin API (#2309)
curl http://****/apisix/admin/plugin_metadata/http-logger -d '
{
    "log_format": {
        "host": "$host",
        "@timestamp": "$time_iso8601",
        "client_ip": "$remote_addr"
    }
}'

when we enabled plugin http-logger, we will get the message body like:

{"host":"localhost","@timestamp":"2020-09-23T18:29:07-04:00","client_ip":"127.0.0.1","route_id":"1"}
{"host":"localhost","@timestamp":"2020-09-23T18:29:07-04:00","client_ip":"127.0.0.1","route_id":"1"}
2020-10-13 14:21:54 +08:00
dabue
40577ee1e2
chore: remove the folder 'logs' in root and replace baidu.com with github.com in test cases (#2374)
* rm log

* replace baidu.com to github.com in testcases

* keep folder logs

* remove the folder logs

* update Makefile
2020-10-12 23:49:43 +08:00
罗泽轩
b8e4b8589d
change(hmac-auth): split schema to adapt different occasions (#2386) 2020-10-11 19:18:37 +08:00
YuanSheng Wang
251625d8ab
bugfix: set random seed for each worker process at init_worker phase, only init phase is not enough. (#2357) 2020-10-09 16:39:49 +08:00
YuanSheng Wang
73dfdf2185
feat: add new filed meta_style, collect the request information with original style. (#2364) 2020-10-09 16:33:07 +08:00
Joey
9d0d351226
Add lables for Route/Service/Consumer/SSL (#2345)
Signed-off-by: imjoey <majunjiev@gmail.com>
2020-10-09 14:05:14 +08:00
罗泽轩
5b97223592
feat: implemented referer-restriction plugin (#2352) 2020-10-06 18:20:17 +08:00
Firstsawyou
c3de84e285
feature: support consumer_name as key for limit-req plugin. (#2270)
fix #2267
2020-10-06 18:18:22 +08:00
L
720d135fd2
fix: Update error message when Route doesn't exist (#2304)
Fixes #2302

Co-authored-by: YuanSheng Wang <membphis@gmail.com>
2020-10-06 11:48:52 +08:00
YuanSheng Wang
50c99a5e3b
bugfix: create etcd object in xpcall, this step may fail (#2312)
* bugfix: create the etcd object in `xpcall`, it may fail, the return values of `etcd.new` should be `res, err`.

fix issue: #2310

1. The old process, if creating etcd fails, etcd data will no longer be synchronized. We need to create the etcd object in xpcall.
2. the return value should be res, err of etcd.new.

* test: old test case is unstable, should delete some checkpoint which is wrong.
2020-10-05 10:22:28 +08:00