Commit Graph

29 Commits

Author SHA1 Message Date
Zaiming Shi 6354e75626 chore: update copyrights 2021-04-23 20:43:00 +02:00
Zaiming Shi f9465dda16 Merge branch 'dev/v4.3.0' into merge-e4.2.4-to-dev-4.3.0 2021-02-14 21:41:23 +01:00
Zaiming Shi dc184574a3 chore(style): fix elvis check for emqx_access_rule 2021-02-13 11:54:09 +01:00
turtled 77d777fd11 chore(acl): rollback emqx_access_rule module 2020-11-13 10:40:14 +08:00
turtled eb4b9936dc fix(modules): fix conflicts 2020-10-11 11:12:39 +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 00f3a2f939 Use 'peerhost' to replace 'peername' 2019-09-18 19:17:30 +08:00
Feng Lee b32156bd68 Rename the type 'credentials' to 'client' 2019-07-31 08:08:11 +08:00
Feng Lee d99c9daf76 Replace credentials with client 2019-07-27 23:22:02 +08:00
Feng Lee fb54fe0fad Improve export_type attr 2019-06-25 14:45:23 +08:00
Feng Lee 21162f88b8 Update copyright 2019-06-18 14:27:06 +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
turtled 31e95b56c4 Update Copyright to 2019 2019-01-29 10:43:25 +08:00
tigercl 97474171d0 Better report errors in acl.conf (#2065) 2018-12-19 23:06:48 +08:00
周子博 ec2e289776 Fix crash in emqx_acl_internal:filter/2 2018-12-10 11:13:25 +08:00
周子博 b2c3d8366d Add logs for malformed acl configuration file 2018-12-03 13:57:37 +08:00
Feng Lee 567aeb274f Define types in emqx_types, emqx_mqtt_types modules 2018-08-29 23:08:55 +08:00
Feng Lee 0e3728c940 Add emqx_types module and 'credentials' type 2018-08-26 16:24:51 +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 71acf91ace Replace lager with emqx_log 2018-04-09 12:34:53 +08:00
Feng Lee 39548cc399 Improve the session management 2018-04-04 15:28:01 +08:00
Feng Lee 2eed46310c Misc fix for the MQTT Version 5.0 2018-03-30 17:18:08 +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