Commit Graph

32 Commits

Author SHA1 Message Date
JimMoen 6168745f90 chore: update copyright 2022-04-14 11:23:25 +08:00
Zaiming Shi 6354e75626 chore: update copyrights 2021-04-23 20:43:00 +02:00
JianBo He ea2a424ce2
Add ensure/2 funcs to avoid needless logs (#3483) 2020-06-04 10:46:53 +08:00
张奇怪 d4932533ca
Auth packet (#3374) 2020-04-10 19:45:18 +08:00
zhouzb 7ea75f4289 Update copyright 2020-01-03 18:31:08 +08:00
Feng Lee 9c3273a2c6 Improve the process of handling MQTT control packets (#3079) 2019-12-06 19:51:06 +08:00
terry-xiaoyu 0bd69ba059 Fix connack reason code when crash 2019-09-20 22:30:16 +08:00
terry-xiaoyu b29ceb9f6b Fix connack reason code when crash 2019-09-20 22:27:02 +08:00
terry-xiaoyu 1e4c51f080 Send DISCONNECT on packet parse error 2019-09-05 18:16:15 +08:00
Feng Lee 847375d2fb Improve connection and channel modules (#2860)
Improve the connection and channel modules
2019-09-05 14:17:15 +08:00
Gilbert 79744af681 Wrapper proper test cases into common test cases (#2785)
* Wrapper proper test cases into common test cases

* Improve test cases for reason code module (#2789)

* Split 3 proper tests into 3 ct cases

* Improve test cases for client, rpc and request-response

* Add psk suites to increase coverage

* Add sys test cases
2019-08-16 18:07:12 +08:00
Feng Lee 52a85d9bb9 Export name/1 2019-08-09 15:09:17 +08:00
Feng Lee f60f127681 Improve the moudules and fix the bugs found in new test cases
- Fix the bug that emqx_mountpoint:unmount/2 will throw exception
- Add emqx_banned:info/1 for test cases
- Rename macro TRIE in emqx_trie module to TRIE_TAB
- Rename macro TRIE_NODE in emqx_trie module to TRIE_NODE_TAB
- Rename macro ROUTE in emqx_router module to ROUTE_TAB
2019-08-06 09:05:55 +08:00
Feng Lee 42da51e1c5 Implement batch delivery for the new channel design
- Implement a new emqx_channel module
- Improve the emqx_frame:serialize/2 API
- Improve the emqx_connection, emqx_ws_connection modules
2019-07-02 13:40:52 +08:00
Feng Lee 21162f88b8 Update copyright 2019-06-18 14:27:06 +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
terry-xiaoyu b79bf13ae7 Rename result -> auth_result 2019-03-22 00:03:34 +08:00
terry-xiaoyu 901bbdedd6 Add some auth error codes 2019-03-16 16:30:25 +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
turtled 31e95b56c4 Update Copyright to 2019 2019-01-29 10:43:25 +08:00
Gilbert 1797aadbe7 Fix unsuback compat (#2102) 2018-12-22 18:47:38 +08:00
Gilbert bf7f10ecd1 Add will topic validation and acl check (#2075)
* Add will topic validation and acl check
2018-12-21 10:49:03 +08:00
Feng Lee e15e5d1f98 Fix the atom leaks in emqx_reason_codes module. 2018-11-30 17:45:28 +08:00
Gilbert Wong 32d3826440 Replace macro QOS$i to QOS_$I
The two styles of qos macro name in one project is chaotic. It is not
a good practice.

So I change the QOS$i to QOS_$i
2018-11-08 20:42:31 +08:00
周子博 23c91c0a40 no message 2018-09-08 18:31:44 +08:00
terry-xiaoyu 23e72feab7 fix reason codes 2018-08-31 01:54:25 +08:00
Gilbert Wong 2fc41b6935 fix reason code name for mqtt 4 2018-08-30 19:09:22 +08:00
Feng Lee c2c1320083 Update compat/2 for suback reason codes 2018-08-25 16:05:58 +08:00
Feng Lee 5f42f88401 Pass paho zero_length_clientid test case 2018-08-25 11:51:36 +08:00
Feng Lee 62aa072f2f Upgrade for MQTT Version 5.0 and Erlang/OTP R21 2018-07-18 13:43:17 +08:00
Feng Lee 31bc091873 Implement MQTT Version 5.0 client 2018-05-06 17:45:18 +08:00