Commit Graph

35 Commits

Author SHA1 Message Date
Zaiming Shi 6354e75626 chore: update copyrights 2021-04-23 20:43:00 +02:00
Zaiming Shi 97f2e5d544 test(auth_http): test unset acl_req app env 2021-04-19 08:39:26 +02:00
Ayodele 2b481dabe7
Fix some dialyzer warnings (#3988) 2021-01-05 20:49:50 +01:00
Shawn 4f82c77e7a
fix(log): improve the error log message on hook failure (#3973) 2020-12-31 13:55:09 +08:00
Zaiming Shi ab5599b3ec refactor(hook): Add emqx_hooks:put to hide already_exists error
This also fixes dialyzer warnings in emqx_mod_presence
2020-12-10 09:35:36 +01:00
JianBo He e3489b9d46 refactor(style): improve all types declaration
- Add dialyzer for code analysis
- Correct all the module type declarations
- Use `-type()` to declaration a type instead of `-opaque`
  (It is advantageous to the code dialyzer)

BROKEN CHANGES:
- Add a ?DEFAULT_SUBOPTS for emqx_broker:subscribe/1,2,3
- Remove the needless internal function `emqx_vm:port_info(PortTerm, Keys)`
2020-06-18 17:38:34 +08:00
张奇怪 78144c0ca5
Update error log (#3342)
Optimize content of error log
2020-03-27 10:10:23 +08:00
zhouzb 839465fbd8 Enhance security 2020-02-07 09:19:21 +08:00
zhouzb 7ea75f4289 Update copyright 2020-01-03 18:31:08 +08:00
zhouzb 8bf06b9c63 Fix typo 2019-11-23 10:53:27 +08:00
tigercl f44b8ce607
Avoid emqx crashes due to auth plugins (#3047)
Avoid emqx crashes due to auth plugins
2019-11-23 10:11:48 +08:00
Feng Lee fb54fe0fad Improve export_type attr 2019-06-25 14:45:23 +08:00
Feng Lee 3877c4db1a Merge branch 'channel2' into channel3 2019-06-18 16:49:26 +08:00
Feng Lee 7774b85f81 Implement the channel architecture 2019-06-18 15:03:51 +08:00
terry-xiaoyu 7092748266 Improve log messages using logger header 2019-06-18 14:37:32 +08:00
周子博 0fbf771543 Readjust log level into error when got unexpected message 2019-03-27 11:07:58 +08:00
周子博 58e1b4d485 Readjust log level and unify log format 2019-03-26 22:18:31 +08:00
HeeeJianBo fc2df9aff5 Adapt to new export style 2019-03-22 14:58:24 +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
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
Feng Lee 7a645dd9cc Add 'include/types.hrl' and introduce some common types 2019-02-19 17:16:11 +08:00
turtled 31e95b56c4 Update Copyright to 2019 2019-01-29 10:43:25 +08:00
Feng Lee e882af9369 Use the new logger macros 2019-01-10 08:53:10 +08:00
Feng Lee fb7b63c59b
Merge branch 'emqx32' into subscription-sharding 2018-12-10 10:08:18 +08:00
Feng Lee 64f62fa0ce Make some processes hibernate after 1s. 2018-12-08 15:03:34 +08:00
Feng Lee 36e7d63d66 Implement subscription sharding.
1. Improve the design router, broker and shared_sub
2. New ets tables' design for subscription sharding
2018-12-07 18:20:09 +08:00
Feng Lee 2a75105580 Improve the Hooks's design 2018-09-06 16:27:16 +08:00
Feng Lee 4635921458 Rewrite the hooks module 2018-09-05 23:21:06 +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 2a4ffc6645 Add more service modules for MQTT Version 5.0 2018-04-18 16:34:23 +08:00
Feng Lee 71acf91ace Replace lager with emqx_log 2018-04-09 12:34:53 +08:00
Feng Lee 282e341433 EMQ X R3.0 - Improve the design of pubsub and router 2018-03-21 16:48:52 +08:00
Feng Lee 6a957e1b33 Support MQTT Version 5.0 2018-03-02 20:18:27 +08:00
Feng Lee b63c34ab14 Merge the latest master branch 2018-02-24 11:27:09 +08:00
Feng Lee 4b8cd18f5d Merge with EMQ X project 2017-10-09 19:43:06 +08:00