Commit Graph

171 Commits

Author SHA1 Message Date
zhouzb 487b84f166 test: fix test case 2021-12-28 11:37:51 +08:00
zhouzb d26042703e chore: provide prepared_query and equery 2021-12-28 09:52:31 +08:00
Ilya Averyanov 2bada0bab8 chore(authz): test Mria authz 2021-12-24 16:18:46 +03:00
Ilya Averyanov d75e0104cc chore(authz): test file authz with real files 2021-12-24 16:18:41 +03:00
Ilya Averyanov e0f860d7d9 chore(authz): fix HTTP authz, cover with tests 2021-12-24 16:18:36 +03:00
Ilya Averyanov 462ec39cb1 chore(authz): test Postgresql backend with real Postgresql 2021-12-17 14:20:50 +03:00
Ilya Averyanov 0a1a68245d chore(authz): test Mysql backend with real Mysql 2021-12-17 14:18:54 +03:00
Ilya Averyanov a21f67a67e chore(authz): test Mongo backend with real Mongo 2021-12-17 14:18:54 +03:00
Ilya Averyanov 28c319b6c4 chore(authz): test Mongo backend with real Mongo 2021-12-17 14:18:54 +03:00
Ilya Averyanov 6ad71a483e chore(authz): test Redis backend with real Redis 2021-12-17 14:18:54 +03:00
Ilya Averyanov abdb98ffa2 refactor(authz): hide mnesia authz implementation details
* Eliminate type and record sharing through `emqx_authz.hrl`.
* Hide all mria/mnesia interactions inside mnesia authz backend.
2021-12-13 21:23:58 +03:00
Ilya Averyanov 1c9d867c5e chore(authz): add test for authz backend creation dry run 2021-12-08 21:38:10 +03:00
Zaiming (Stone) Shi 867cc3c4ad test: ensure emqx_connector is loaded 2021-12-04 09:33:14 +01:00
JimMoen a58493f7a4 test(authz): fix test suite for schema check and app start 2021-12-02 10:12:10 +08:00
DDDHuang 21bd9bba55
fix: generate palce holder (#6250)
* fix: generate place holder

* style: whitespace cleanup

* refactor(authz): placeholder for athuz

* test: authz test suite for placeholder

* fix: lw place holder suite

* fix: auth n redis suite

Co-authored-by: JimMoen <LnJimMoen@outlook.com>
2021-11-23 10:56:43 +08:00
JianBo He 905e58c93a
Merge pull request #5997 from HJianBo/gw-fixes-part3
Gateway improvement part.3
2021-11-19 09:29:51 +08:00
JianBo He ad2dbb5a49 chore(gw-sn): append messge headers 2021-11-17 14:51:27 +08:00
zhongwencool 04c204374a
chore: All placeholders are placed in the same header file (#6190)
* chore: All placeholders are placed in the same header file

* feat: Separate placeholders from the rules engine
2021-11-17 14:40:48 +08:00
JianBo He d0bdf27e0c chore: fix elvis warnings 2021-11-17 11:04:09 +08:00
JianBo He 814e01c0cb test(authz): deps on emqx_conf instead of meck emqx_schema 2021-11-17 10:46:38 +08:00
JimMoen a65597e302
Authz api mnesia refactor (#6082)
* refactor(authz): macro move to hrl and rename, add meta example

* refactor(authz_api_mnesia): use config schemas for request validations

* chore(authz_api_mnesia): suite module typerefl fit

* chore(style): authz_api_mnesia style format
2021-11-11 16:29:36 +08:00
JimMoen f44bda806a chore(authz): fix test suite page params 2021-10-26 14:02:19 +08:00
Zaiming (Stone) Shi 666b319729
Merge pull request #5989 from zmstone/refactor-ssl-certs-lib
refactor(tls): move ssl files handling to emqx_tls_lib
2021-10-25 12:42:29 +02:00
zhanghongtong 3c2292e74f chore(authz): add more test case 2021-10-25 13:43:28 +08:00
zhanghongtong 198ae4c782 fix(authz): fix configuration could be updated with incorrect values
when updating the configuration, first check with emqx_resouce:create_dry_run/2

Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-10-25 13:43:28 +08:00
Zaiming Shi 71d2e6bebd refactor(authz): call emqx_tls_lib to save & read SSL files 2021-10-24 10:44:47 +02:00
zhongwencool d784e63b9f
emqx_conf (#5939)
* feat(emqx_conf): move conf manager for emqx_machine to emqx_conf

* chore(emqx_conf): change emqx:get_config/2 to emqx_conf:get/2

* fix: common test failed

* fix: badmatch by typo wrong key

* fix(emqx_conf): get the wrong core nodes

* fix(emqx_conf): get core node's tnx_id not latest tnx_id

* fix: add ro_transation when copy conf file

* fix: delete debug info

* fix: change ekka_rlog to mria_rlog

* fix: remove cluster_rpc from emqx_machine.

* fix: don't call ekka:start/0 explicitly

* fix: ekka should be start in emqx_machine
2021-10-21 18:08:51 +08:00
k32 8e58699ff5
Merge pull request #5937 from k32/mria
feat(mria): Replace ekka_mnesia with mria
2021-10-20 13:15:23 +02:00
Zaiming Shi 9c414096c7 test(authz): test HTTP apis for built-in-database 2021-10-20 09:17:21 +08:00
Zaiming Shi ae854db02d test: fix match pattern of returned rules 2021-10-20 09:17:21 +08:00
Zaiming Shi 891a185eda test: enable emqx_authz_api_mnesia_SUITE tests 2021-10-20 09:17:21 +08:00
k32 b3a8753219 fix(mria): Replace mnesia calls with mria 2021-10-19 12:24:35 +02:00
k32 b515a45a4f chore(mria): Rename module: ekka_mnesia -> mria 2021-10-18 22:04:05 +02:00
zhongwencool c73205a589
Ct helpers migrate (#5943)
* chore: common test

* chore: delete emqx_ct_helpers deps
2021-10-18 13:45:52 +08:00
Tobias Lindahl aa19c2a908 chore: Remove emqx_ct_helpers as dependency 2021-10-15 10:40:57 +02:00
zhanghongtong c5494d5c90 chore(authz mnesia api): ensure built-in-database type source is disabled before purge. 2021-09-26 16:38:08 +08:00
Zaiming Shi 8b6eeef7fc refactor(authz): use macro for cmd names 2021-09-26 16:19:47 +08:00
zhanghongtong 673b12a46d chore(authz mnesia): in the mnesia table, replace atom with int 2021-09-26 16:19:47 +08:00
zhanghongtong 9b3917e0d3 chore(authz mnesia api): get method supports paging
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-09-26 16:19:47 +08:00
zhanghongtong 1a02e0cfd1 feat(authz mnesia api): post accept array data 2021-09-26 16:19:47 +08:00
zhanghongtong 2dc3b51675 chore(authz): use ekka_mnesia instead of mnesia 2021-09-26 16:19:47 +08:00
zhanghongtong b583509976 feat(authz): add authorize for mnesia 2021-09-26 16:19:47 +08:00
zhanghongtong ed6f4895e2 feat(authz mnesia): add api
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-09-26 16:19:47 +08:00
lafirest 6e3ec6c9db fix(schema): fix authn/z's schema time unit 2021-09-26 14:41:46 +08:00
zhanghongtong d1e85e8d00 feat(authz): acl.conf is compatible with the 4.x syntax 2021-09-24 09:59:45 +08:00
zhanghongtong 9ac1e9fcd9 chore(authz api): use raw config for get method 2021-09-23 16:33:06 +08:00
zhanghongtong 00d7d66871 chore(authz): rename mongo to mongodb 2021-09-22 11:28:31 +08:00
tigercl fdbde321cd
Merge pull request #5742 from tigercl/chore/gen_id
chore(gen_id): using emqx_misc:gen_id/0, /1
2021-09-17 09:24:42 +08:00
zhanghongtong fa467d0741 chore(authz): rename pgsql to postgresql
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-09-17 09:16:38 +08:00
zhouzb 9df842eeb8 fix(test): fix test case of authz 2021-09-16 16:51:52 +08:00
zhanghongtong 4fa816fa97 fix(auth mnesia api): fix api error when delete sources 2021-09-13 19:55:39 +08:00
tigercl 09c376c1e5
Merge pull request #5707 from terry-xiaoyu/bridge_apis
feat(bridges): avoid clientid competition between bridges on differen…
2021-09-10 19:32:20 +08:00
zhanghongtong ef0f94025a chore(emqx_authz): rename config item
rename sql to query for mysql and pgsql
rename find to selector for mongo

Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-09-10 19:27:10 +08:00
zhanghongtong 75b77b77b6 chore(emqx_authz api): change rules type from list to string in http api 2021-09-10 19:03:33 +08:00
Shawn d46241fe2f feat(bridges): avoid clientid competition between bridges on different nodes 2021-09-10 14:21:17 +08:00
zhanghongtong 1699a8dc63 chore(authz): rename authorization_rules.conf to acl.conf 2021-09-07 14:42:05 +08:00
zhanghongtong ffbf9b0fab feat(authz): check for duplicate source types
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-09-03 15:49:42 +08:00
zhanghongtong 0fd18a2795 chore(emqx_authz): compression configuration items
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-09-02 15:28:17 +08:00
zhanghongtong b8ee977d9d feat(authz api): support read cert file for api 2021-09-02 11:31:21 +08:00
zhanghongtong 07dcd9e705 feat(authz api): support file type for sources 2021-09-02 11:31:21 +08:00
zhanghongtong 8252771306 feat(authz api): support upload ssl cert file for api 2021-09-02 11:31:21 +08:00
zhanghongtong ef1b617624 feat(authz api): support '/authorization/settings' api and update swagger schema
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-09-01 13:34:02 +08:00
Rory Z c0eaa30064 chore(emqx_authz): change api path 2021-08-31 17:39:32 +08:00
zhanghongtong 6b313a60d4 refactor: refactor emqx_authz
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-08-31 17:39:32 +08:00
zhanghongtong 46fb99d44e chore(emqx_authz): rename rules to sources in emqx_authz 2021-08-27 17:51:11 +08:00
zhanghongtong f03fc88161 chore(emqx_authz): fix test cases error
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-08-27 15:08:56 +08:00
zhanghongtong f2e29184de chore(emqx_authz): use new config path 2021-08-27 15:08:56 +08:00
DDDHuang 86231f795d
refactor: close managment http 8081 (#5564) 2021-08-27 13:46:39 +08:00
Shawn cc56c74964 refactor(emqx): update the tests for the new zone,listener config 2021-08-26 09:11:30 +08:00
Rory Z 7e8dde7e26 chore: fix dialyzer error
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-08-25 10:15:00 +08:00
zhanghongtong a2bafd1a18 feat(authz): support authorization config file part 2 2021-08-25 10:15:00 +08:00
zhanghongtong a7fac1a7a3 feat(authz): support authorization config file part 1. 2021-08-25 10:15:00 +08:00
zhanghongtong bfb363bc61 chore(emqx_authz): rename authorization to authorization_rules in emqx_authz.conf 2021-08-25 10:15:00 +08:00
Turtle bc325e55fc fix(authn-authz-api): fix authn/authz test cases fail 2021-08-24 18:19:21 +08:00
Shawn e8e95d39ef
refactor(config): move emqx_config:get/get_raw to emqx:get_config/get_raw_config (#5517) 2021-08-18 14:52:57 +08:00
Shawn bf6251e20f refactor(config): update the return values of config handlers 2021-08-18 09:42:06 +08:00
Shawn bd8263e324 refactor(config): move APIs for config update,remove,reset to emqx
Move the emqx_config:update,remove,reset APIs to emqx, to remove
the circular dependency between the modules emqx_config and
emqx_config_handler.

After this change the dependency among these modules will be:

```
emqx ---> emqx_config
   |          ^
   |          |
   + ---> emqx_conifg_handler
```
2021-08-18 09:42:06 +08:00
Shawn 988d620421 fix(test): mock emqx_resource:remove/1 in emqx_authz_http_SUITE 2021-08-16 17:41:53 +08:00
Shawn 7f03cd0e8b fix(config): update the calls to emqx_config:update/2,3 2021-08-16 17:41:53 +08:00
Shawn 4bf1e83449 fix(test): variable 'Id' shadowed in 'fun' 2021-08-12 17:20:05 +08:00
zhanghongtong a94bfaf28b feat(authz api): support move rule position
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-08-11 18:23:22 +08:00
zhanghongtong 632cc895d5 chore(authz): formatting error returned
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-08-11 11:06:58 +08:00
zhanghongtong 69a0fafd6b feat(authz api): get api support paging
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-08-11 11:06:58 +08:00
zhanghongtong c821528af9 feat(authz api): full CURD api 2021-08-11 11:06:58 +08:00
zhanghongtong 4bb1e9c964 feat(authz): more better update function
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-08-11 11:06:58 +08:00
Zaiming Shi 781de7f2a7 test(authz): ensure config cleaned up after test 2021-08-04 08:40:09 +02:00
Zaiming Shi 40faa31241 test(authz): no need to mock emqx_config 2021-07-30 16:53:21 +08:00
Zaiming Shi 9dcb725898 fix(emqx_authz): update config with own schema module 2021-07-30 09:18:43 +08:00
Zaiming Shi c0ffbd68c8 test(emqx_authz): adjust meck and app start order 2021-07-29 13:32:57 +02:00
zhanghongtong 4c6739161d chore(emqx authz): rename root name for authz conf
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-07-29 16:44:40 +08:00
zhanghongtong 4ef00072b9 chore(authz): add annotations for rules
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-07-29 16:44:40 +08:00
Turtle 4afae79be9 chore(statsd): update statsd conf root 2021-07-29 10:08:07 +08:00
zhanghongtong 8ba0890ce5 feat(authz): add id for every rule 2021-07-27 13:39:28 +08:00
zhanghongtong 4c5b75f281 chore: rename acl to authz
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-07-26 16:10:33 +08:00
Shawn bbf40a85bf fix(config): merge conflicts 2021-07-23 18:49:09 +08:00
Shawn 2ddcfdf365 refactor(config): rename emqx_config:update_config/2 to emqx_config:update/2 2021-07-23 17:25:39 +08:00
Shawn f2e62def1b refactor(config): remove emqx:get_env/1,2 from testcases 2021-07-23 10:56:20 +08:00
Shawn 6915d9abeb fix(authz): update testcases for emqx_authz 2021-07-17 16:59:31 +08:00
Shawn 1d2cb6cb81
Merge branch 'master' into emqx_config 2021-07-17 15:53:12 +08:00
zhanghongtong bb417e4498 feat(authz): support http
Signed-off-by: zhanghongtong <rory-z@outlook.com>
2021-07-17 15:48:29 +08:00