Commit Graph

21 Commits

Author SHA1 Message Date
zhanghongtong fa31062a5e chore(topic rewrite): export more functions 2020-09-11 12:37:47 +08:00
turtleDeng edcbdcce87 improve: module_acl_internal load/unload api (#3706) 2020-09-05 17:23:22 +08: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
qingchuwudi 7ba801c8d4
Fix reload acl module and clean acl caches (#3409) 2020-04-26 15:45:55 +08:00
turtleDeng d49f4118fe
Mgmt emqx modules (#3376) 2020-04-10 19:55:21 +08:00
张奇怪 78144c0ca5
Update error log (#3342)
Optimize content of error log
2020-03-27 10:10:23 +08:00
zhouzb 7ea75f4289 Update copyright 2020-01-03 18:31:08 +08:00
Feng Lee 20ddd498fc Rename the 'client_id' field to 'clientid' 2019-09-24 17:06:25 +08:00
Feng Lee 98b7e3d948 Rename the type 'client()' to 'client_info()'
- Rename tye type 'client()' to 'client_info()'
- Rename the 'client' field of channel to 'client_info'
- Fix the function specs
2019-09-21 15:27:05 +08:00
Feng Lee 88321fe6fe Remove the emqx_config module
- Remove the emqx_config module
- Move get_env/1, get_env/2 to emqx module
2019-09-09 10:18:10 +08:00
Feng Lee 0a6468cf48 Introduce the 'pipeline' design pattern
- Introduce the 'pipeline' design pattern in emqx_protocol module
- Reame the '{dispatch, ...' to '{deliver, ...' in emqx_broker module
- Rename type 'credentials' to 'client'
2019-07-31 08:09:47 +08:00
Feng Lee 51fb4e33d6 Rename 'Credentials' to 'Client' 2019-07-30 19:10:38 +08:00
Feng Lee 3877c4db1a Merge branch 'channel2' into channel3 2019-06-18 16:49:26 +08:00
terry-xiaoyu 7092748266 Improve log messages using logger header 2019-06-18 14:37:32 +08:00
Feng Lee 21162f88b8 Update copyright 2019-06-18 14:27:06 +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
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
linjun 3a2f6d5a6c Fix badmatch bug for reload_acl 2019-03-21 16:51:57 +08:00
terry-xiaoyu 749494c277 Change default internal-rules to #{} 2019-03-16 13:08:11 +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