Commit Graph

8218 Commits

Author SHA1 Message Date
zhongwencool 29ccc98a42 fix: slow_sub api return field's notice_interval is missing 2021-12-15 10:36:13 +08:00
Thales Macedo Garitezi 95de2d3467
fix(monitor): fix return value on badrpc
If the rpc in `emqx_dashboard_monitor_api:get_collect/1` fails, an
empty map is return.  But the current function expects a 4-tuple,
which results in a 500 error returned on such occasions.

```
curl -su admin:public localhost:8888/api/v5/monitor/current | jq .
{
  "code": "INTERNAL_ERROR",
  "message": "error, function_clause, [{emqx_dashboard_monitor_api,format_current_metrics,[[#{},{0,0,0,0},{0,0,0,0}],{0,0,0,0}],[{file,\"emqx_dashboard_monitor_api.erl\"},{line,179}]},{emqx_dashboard_monitor_api,current_counters,2,[{file,\"emqx_dashboard_monitor_api.erl\"},{line,167}]},{minirest_handler,apply_callback,3,[{file,\"minirest_handler.erl\"},{line,112}]},{minirest_handler,init,2,[{file,\"minirest_handler.erl\"},{line,38}]},{cowboy_handler,execute,2,[{file,\"cowboy_handler.erl\"},{line,41}]},{cowboy_stream_h,execute,3,[{file,\"cowboy_stream_h.erl\"},{line,318}]},{cowboy_stream_h,request_process,3,[{file,\"cowboy_stream_h.erl\"},{line,302}]},{proc_lib,init_p_do_apply,3,[{file,\"proc_lib.erl\"},{line,226}]}]"
}
```
2021-12-14 17:56:32 -03:00
Thales Macedo Garitezi 0300403fc0
fix(admin): inconsistent return type on empty inputs
If an empty username or password are given during the initialization
of `emqx_dashboard_admin`, it'll return just the atom `ok`, which
breaks the expected `{ok, _}` in `emqx_dashboard_app:start/2`.

```
{'EXIT',
 {{failed_to_start_app,emqx_dashboard,
   {emqx_dashboard,
    {bad_return,
     {{emqx_dashboard_app,start,[normal,[]]},
      {'EXIT',
       {{badmatch,ok},
        [{emqx_dashboard_app,start,2,
          [{file,
            "/home/thales/dev/emqx/emqx/apps/emqx_dashboard/src/emqx_dashboard_app.erl"},
           {line,32}]},
         {application_master,start_it_old,4,
          [{file,"application_master.erl"},{line,293}]}]}}}}}}}}
```
2021-12-14 17:51:50 -03:00
Ilya Averyanov b8a68d7a9f
Merge pull request #6384 from savonarola/refactor-password-hashing
refactor(authn): unify password hashing
2021-12-14 16:21:02 +03:00
Ilya Averyanov 5538cd3708
Merge pull request #6441 from savonarola/refactor-acl
refactor(authz): hide mnesia authz implementation details
2021-12-14 11:32:25 +03:00
zhongwencool 56804ef733
Merge pull request #6427 from zmstone/feat-add-emqx-plugins-app
feat(plugins): add emqx_plugins skeleton
2021-12-14 16:26:58 +08:00
Zaiming (Stone) Shi 867ebbc8a0 docs: fix review comments for plugins config doc 2021-12-13 20:52:20 +01:00
Zaiming (Stone) Shi 47e1875345 build: add back emqx_slow_subs to release app list
accidently lost it during rebase
2021-12-13 20:52:18 +01:00
Ilya Averyanov 708d9cfc6c refactor(authn): restore pbkdf2 password hashing functionality 2021-12-13 21:40:09 +03:00
Ilya Averyanov abdb98ffa2 refactor(authz): hide mnesia authz implementation details
* Eliminate type and record sharing through `emqx_authz.hrl`.
* Hide all mria/mnesia interactions inside mnesia authz backend.
2021-12-13 21:23:58 +03:00
zhongwencool 3e892a337a
Merge pull request #6436 from tigercl/chore/compatibility-otp24
chore(otp): be compatibility with crypto in otp 24
2021-12-13 22:31:15 +08:00
zhongwencool b4e2aa0dcf
Merge branch 'master' into feat-add-emqx-plugins-app 2021-12-13 22:28:03 +08:00
lafirest cbe683c6a3
Merge pull request #6353 from lafirest/slow_subs
feat(emqx_slow_sus): ported emqx_slow_subs from v4.4
2021-12-13 17:35:17 +08:00
JimMoen 40c4880a71
Merge pull request #6435 from JimMoen/fix-ssl-file-content
fix(ssl): file content return type
2021-12-13 16:49:21 +08:00
zhouzb 69800a9e88 chore(otp): be compatibility with crypto in otp 24 2021-12-13 16:16:57 +08:00
JimMoen 5785b0c20b fix(ssl): file content return type 2021-12-13 16:08:41 +08:00
Zaiming (Stone) Shi 75aa2683ee
Merge pull request #6430 from zmstone/docs-fix-markdown
docs: change <module> to {module} so markdown render will not crash
2021-12-13 08:17:21 +01:00
Zaiming (Stone) Shi d3d8b3a01f fix: allow listener not_found before restart 2021-12-12 22:18:56 +01:00
Zaiming (Stone) Shi 38ac10d3e2 feat(plugins): add emqx_plugins skeleton
* added emqx_plugins app.
* emqx_plugins.erl is moved from emqx app to emqx_plugins app
  same for the test SUITE
2021-12-12 19:40:34 +01:00
Zaiming (Stone) Shi fcb7c2c70f docs: change <module> to {module} so markdown render will not crash
<module> is treated as an HTML tag
2021-12-12 19:34:29 +01:00
Zaiming (Stone) Shi e5b11d48a2
Merge pull request #6428 from zmstone/refactor-better-config-doc
docs: better config doc
2021-12-12 19:09:05 +01:00
Zaiming (Stone) Shi 41aa958ac9 refactor(authn): root type as array of union
Deleted the wrapping union.
i.e. previously it's
union([union([...]), array(union([...]))]).
not it's
array(union([...]))

It is after-all a lazy type, and the dynamic check allows
single-elemented arrays not to have `[]` around it.

the old union of array of union schema was just adding confusion
2021-12-11 22:20:53 +01:00
Zaiming (Stone) Shi 7d36079f0a docs(connector): better namespace for http schema 2021-12-11 22:17:52 +01:00
Ilya Averyanov 59f1bfeaac
Merge pull request #6373 from savonarola/authz-backend-behaviours
chore(authz): encapsulate authz backend logic
2021-12-11 00:11:16 +03:00
Ilya Averyanov 426a9908e3
Merge pull request #6424 from savonarola/ranch-compat
[5.0] fix(wss): update cowboy & ranch for OTP24 compatibility
2021-12-10 23:25:32 +03:00
Ilya Averyanov fddb28a4b0 fix(wss): update cowboy & ranch for OTP24 compatibility 2021-12-10 20:38:44 +03:00
Spycsh c1491b8cce
Merge pull request #6369 from Spycsh/master
fix: fix apiVersion for networking.k8s.io/v1
2021-12-10 12:23:31 +01:00
JianBo He 5224da57dc
Merge pull request #6411 from HJianBo/gw-improve-apis-3
More precise gateway http-api examples
2021-12-10 16:52:49 +08:00
lafirest 82746134bb feat(emqx_slow_sus): ported emqx_slow_subs from v4.4 2021-12-10 16:42:55 +08:00
lafirest 3fc26fc4b6
Merge pull request #5987 from lafirest/refactor/ratelimit
refactor(emqx_limiter): use the new hierarchical token bucket to repl…
2021-12-10 15:26:43 +08:00
firest 8493b61cb5 refactor(eqmx_limiter): use the new hierarchical token bucket to replace the old ratelimit code 2021-12-10 14:37:23 +08:00
JianBo He fa11c6df9c test(gw): fix bad test cases 2021-12-10 10:41:38 +08:00
Spycsh a40c50f2e8 fix: fix apiVersion for networking.k8s.io/v1 2021-12-09 21:24:40 +01:00
Thales Macedo Garitezi 540e5dbc0b
Merge pull request #6344 from emqx/update-appup-ext-deps-diff-50
chore(appup): make update_appup.escript output only differences for external dependencies [5.0]

Same as #6307 .

Currently, the update_appup.escript outputs as an error the full appup
file for external dependencies, even if all the changes are already
contained in the depency. Here, we make it only output the missing
actions to be inserted, to aid in seeing what are the differences.
2021-12-09 09:15:25 -03:00
zhongwencool 64341fdc23 fix(swagger): remote api_secret field form api_key api 2021-12-09 17:57:57 +08:00
k32 98be2e15b1
Merge pull request #6405 from k32/sysmon
feat(system_monitor): Add system_monitor application
2021-12-09 10:22:40 +01:00
zhongwencool 0614c157ec fix(elvis): elvis warning 2021-12-09 16:42:10 +08:00
zhongwencool cf11f3f8ee feat(api-key): support api_key/secret 2021-12-09 16:42:10 +08:00
JianBo He d551c7977d
Merge pull request #6162 from HJianBo/port-44-exhook-feat
Pass message header to 'on_message_publish' hook
2021-12-09 16:38:12 +08:00
JianBo He 159ba63530 chore: upgrade grpc-erl to 0.6.4 2021-12-09 15:06:18 +08:00
JianBo He 5d4604701c chore: fix elvis warnings 2021-12-09 15:06:18 +08:00
JianBo He 34cc8cc7f5 chore: put the pool_size default value to avoid hot upgrade failure 2021-12-09 15:06:18 +08:00
JianBo He e7ccd88719 test(props): cover messages headers 2021-12-09 15:06:18 +08:00
JianBo He f132d09483 chore(exhook): parse pool_size 2021-12-09 15:06:18 +08:00
JianBo He 143c685452 feat(exhook): expose process pool_size for grpc client 2021-12-09 15:06:18 +08:00
JianBo He 2b7c311807 chore: upgrade grpc to 0.6.4 2021-12-09 15:06:18 +08:00
JianBo He 262fb13a71 chore(exhook): fix diaylzer warnings 2021-12-09 15:06:17 +08:00
JianBo He 20ba9d285f feat(exhook): expose headers for on_messages_publish hook 2021-12-09 15:06:17 +08:00
lafirest f25c8cdf0f
Merge pull request #6410 from lafirest/fix/lw_cmd_record
fix(emqx_lwm2m): limit the max size of cmd record
2021-12-09 14:57:01 +08:00
JianBo He e662628581 chore(gw): fix bad default value in query-string 2021-12-09 14:50:28 +08:00