Commit Graph

4454 Commits

Author SHA1 Message Date
zhanghongtong 24b4d83c12 Merge remote-tracking branch 'origin/develop' 2019-03-27 04:31:41 +08:00
周子博 58e1b4d485 Readjust log level and unify log format 2019-03-26 22:18:31 +08:00
Shawn f0fa9a9252 Add a function converting message to binary-key map (#2360) 2019-03-26 10:35:10 +08:00
JianBo He 8d92d58b6c Fix allow_anonymous behavoir error (#2355)
EMQ should allow the anonymous connection if the allow_anonymous option is true, although it has one or more auth plugins started.
2019-03-26 10:25:51 +08:00
zhanghongtong 3d45da8e03 Merge remote-tracking branch 'origin/develop' 2019-03-23 04:22:32 +08:00
Shawn 9e7b3a9209
Update emqx_types.erl 2019-03-22 16:27:23 +08:00
terry-xiaoyu bd304572c9 Delete acl_mod and auth_mod 2019-03-22 16:18:42 +08:00
terry-xiaoyu c7a317afaf Add one more connack reason code 2019-03-22 15:43:21 +08:00
HeeeJianBo fc2df9aff5 Adapt to new export style 2019-03-22 14:58:24 +08:00
Gilbert e386778aca Fix typo 2019-03-22 11:31:26 +08:00
Feng Lee dba16aeea5 Add 'remove_header/2', 'get_headers/1' functions
- Adopt new 'export' style
- Add 'remove_header/2', 'get_headers/1' functions
- Remove 'remove_topic_alias/1' function
2019-03-22 11:31:26 +08:00
Feng Lee ba719a896d Call 'tokens/1' instead of 'words/1' 2019-03-22 11:31:26 +08:00
Feng Lee a4550a8fc4 Add emqx_topic:tokens/1 function 2019-03-22 11:31:26 +08:00
JianBo He 513d2bcaaa Fix reload ACL failed (#2344)
The original `reload_acl` function only parse the ACL file, not compile and rehook to 'client.check_acl'
2019-03-22 10:21:16 +08:00
zhanghongtong 962fb0cec5 Merge remote-tracking branch 'origin/develop' 2019-03-22 04:16:15 +08:00
turtled 416bc75d5d Sort plugin list 2019-03-22 01:02:30 +08:00
turtled 865ef864db Get the plugins list through -emqx_plugin module attributes 2019-03-22 00:03:53 +08:00
terry-xiaoyu b79bf13ae7 Rename result -> auth_result 2019-03-22 00:03:34 +08:00
HeeeJianBo 998684fc4e Fix badmatch error in the batch_process of session 2019-03-21 17:40:02 +08:00
terry-xiaoyu 36927f01e7 Add type definition for auth_result 2019-03-21 16:54:50 +08:00
tigercl e7320620c0 Fix alarm report bug (#2332) 2019-03-21 16:53:46 +08:00
linjun 3a2f6d5a6c Fix badmatch bug for reload_acl 2019-03-21 16:51:57 +08:00
tigercl 5a401c44fd Clear dup flag if message published first (#2337) 2019-03-21 10:13:41 +08:00
zhanghongtong dac1b92d8f Merge remote-tracking branch 'origin/develop' 2019-03-21 04:14:44 +08:00
JianBo He 8a73c62f66 Fix followed packet parse failure (#2333)
To fix issue#2303(https://github.com/emqx/emqx/issues/2303)
It will report the following error, when a connection sends a TCP frame contained many of MQTT packet and followed a split MQTT packet.
2019-03-20 10:14:52 +08:00
zhanghongtong 5fb4f23504 Merge remote-tracking branch 'origin/develop' 2019-03-19 09:51:37 +08:00
Gilbert Wong d020ac0390 Delay receive waiting time 2019-03-18 14:20:52 +08:00
turtleDeng a95ebcd7d6
Fix typo 2019-03-17 00:23:44 +08:00
Gilbert Wong 7ff56b55f0 Force makefile to git clone deps 2019-03-16 23:05:15 +08:00
YoukiLin 88c32b2c41 Fix emqx_rpc badargs bug 2019-03-16 21:27:41 +08:00
Gilbert Wong 763115e149 Delegate serialize fun into sendfun 2019-03-16 21:15:10 +08:00
spring2maz a72a914fb8 Fix issue #2312 (#2313)
* Fix SSL option parser

* Fix bridge disconnect log formatting

* Set no headers if new headers is undefined
2019-03-16 19:28:57 +08:00
YoukiLin 29f4faa7dd Add badtcp clause to handle gen_rpc (#2314) 2019-03-16 18:23:18 +08:00
terry-xiaoyu 901bbdedd6 Add some auth error codes 2019-03-16 16:30:25 +08:00
terry-xiaoyu 749494c277 Change default internal-rules to #{} 2019-03-16 13:08:11 +08:00
terry-xiaoyu 2912d9a41b Rename is_super -> is_superuser 2019-03-16 12:51:45 +08:00
terry-xiaoyu a7adb79f17 Allow empty zone in credentials 2019-03-16 12:25:39 +08:00
Shawn 02fe8560e2
Improve emqx_hooks and credentials (#2309)
* Improve emqx_hooks and credentials

1. Modify the return modes of emqx hooks.

Change the return value of hook functions to:
- ok: stop the hook chain and return ok
- {error, Reason}: stop the hook chain and return error
- continue: continue the hook chain

And the return value of emqx_hooks:run/2 is changed to:
- ok
- {error, Reason}

And the return value of emqx_hooks:run/3:
- {ok, Acc}
- {error, Reason, Acc}

2. Treat password as a member of credentials.

Password should be wrapped in the `credentials` data-structure, as the
username/password pair together consists of an authentication method.
There can be some methods using some other credential data (e.g.
a JWT token), and these credential data should also be wrapped in the
the `credentials` data-structure.

An event `client.authenticate` is triggered when an user logs in:
```erlang
emqx_hooks:run('client.authenticate', [], Credentials)
```

A `default callback` that deny/allow any user (according to the
`allow_anonymous` config) should be appended to the end of the
callback chain.

The `credentails` is passed through all of the callbacks, and
can be changed over in this process.

* Refactor emqx hooks return mode

* Remove password from PState
2019-03-16 10:43:53 +08:00
zhanghongtong 5f53952b45 Merge remote-tracking branch 'origin/develop' 2019-03-16 09:33:04 +08:00
spring2maz f2df92fef2 Unload emqx_alarm_handler before unloading plugins when shuting down (#2316)
emqx_alarm_handler publishes mqtt messages,
having it running while plugins are shutdown triggered some
annoying crashes
2019-03-15 17:11:24 +08:00
turtleDeng b902ff3656 Update gen_rpc to v2.3.1 (#2315)
Update gen_rpc to v2.3.1
2019-03-15 10:30:14 +08:00
zhanghongtong e349136cb2 Merge remote-tracking branch 'origin/develop' 2019-03-14 12:09:18 +08:00
Feng Lee 56718e35cb Add emqx_topic:tokens/1 function (#2305)
* Add emqx_topic:tokens/1 function
2019-03-13 23:31:44 +08:00
Shawn 111b66121c
Support TLS/DTLS PSK (#2297)
* Improve filter functions for emqx-hook

* Add PSK hook

* Reset hook args for filter functions
2019-03-13 22:24:19 +08:00
spring2maz 48450d1d37 Move request response out of emqx client (#2293)
* Delete response_topic_prefix

The Response-Infomation in CONNACK was misinterpreated, it should
not be a broker's global config, instead, it should be per-client
or even per-session prefix/suffix mechanism

* Delete request-response code from emqx_client

* Add request-response test code

* meck as default dependency --- temp workaround for dep-vsn-check
2019-03-13 11:27:25 +08:00
Gilbert Wong 27a7105fac Fix emqx_alarm_handler_SUITE
Prior to this change, emqx_alarm_handler_SUITE read emqx.conf rather
gen.emqx.conf which would trigger unexpected errors

This change fix this issue.
2019-03-13 10:52:15 +08:00
Gilbert Wong 076f3e3068 Fix schema bug 2019-03-13 10:14:31 +08:00
zhanghongtong 28bd9a7fda Merge remote-tracking branch 'origin/develop' 2019-03-13 04:15:15 +08:00
turtled b51747f03e Export find_plugin 2019-03-12 22:45:50 +08:00
周子博 6816c1ac3e Delete needless test case in emqx_protocol_SUITE 2019-03-12 10:17:22 +08:00