Commit Graph

35 Commits

Author SHA1 Message Date
JianBo He 9a8859a44c refactor(topic): move triples/1 func into emqx_trie module 2020-06-18 17:38:34 +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
zhouzb 7ea75f4289 Update copyright 2020-01-03 18:31:08 +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
Feng Lee 4afa02ee48 Update all the test cases 2019-08-06 09:04:37 +08:00
Feng Lee 6b84eb0595 Rewrite the channel, protocol and session modules. 2019-07-22 17:08:53 +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
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
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
Feng Lee 56718e35cb Add emqx_topic:tokens/1 function (#2305)
* Add emqx_topic:tokens/1 function
2019-03-13 23:31:44 +08:00
spring2maz 67376727c9 Add batch send support for emqx_client:publish/2
also cover emqx_portal_mqtt with CT
2019-02-28 11:17:27 +08:00
spring2maz fbe67e6784 Introduce new bridge impl 2019-02-28 11:17:27 +08:00
Feng Lee c8b243ed22 Change some '-type' attrs to '-opaque' and improve emqx_gc, emqx_inflight modules
- Define 'GCS(St)' macro to improve emqx_gc module
- Define 'Inflight(MaxSize, Tree)' macro to improve emqx_inflight module
2019-02-22 18:08:13 +08:00
Feng Lee 82c337a040 Fix 'drpped' typo
- Fix 'drpped' typo
- Add specs for exported functions
- Add 'group()' type in emqx_topic module
2019-02-22 10:03:29 +08:00
turtled 31e95b56c4 Update Copyright to 2019 2019-01-29 10:43:25 +08:00
Gilbert 4c40f75f4b Request & Response (broker and client) (#1819)
Add request & response support for CONNECT & CONNACK

Prior to this change, there is no validate and specified process for
Request-Response-Information and Response-Information

Also added basic Request/Response functionality to emqx_client implementation
2018-10-18 19:21:05 +02:00
Feng Lee 69e5869fa0 Add submit/2, async_submit/2 functions for emqx_pool module. 2018-09-16 20:49:47 +08:00
周子博 6f6e24592b Fix the reverse match 2018-09-07 18:32:03 +08:00
周子博 42b3c9b4d6 Send DISCONNECT packet with reason code PROTOCOL_ERROR when topic is empty, add checks for topics 2018-09-06 14:47:34 +08:00
Feng Lee 567aeb274f Define types in emqx_types, emqx_mqtt_types modules 2018-08-29 23:08:55 +08:00
turtled 95d36d0204 Fix share sub bug 2018-08-27 10:15:41 +08:00
Feng Lee 0f052ce352 Upgrade connection, protocol and session modules for MQTT 5.0 2018-08-24 18:39:59 +08:00
Feng Lee 7d0cba9427 Add MQTT 5.0 supports for connection, protocol and session modules 2018-08-06 16:33:10 +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 055de617fc Add emqx_message:make/4 and fix whitespace 2018-05-31 21:57: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 f4fd6efe16 Merge the emqx-common, emqx-router libraries 2018-02-26 23:29:53 +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