Commit Graph

92 Commits

Author SHA1 Message Date
Kjell Winblad aa57ea9ee1 fix: mongodb authz crash
This fixes a crash with an error in the log file (see below) that
happened when the MongoDB authorization module queried the database. The
reason is that the collection name that was sent to the mongodb
connection was an atom. This is fixed by making sure it is not an atom.

2023-03-08T17:16:34.215523+01:00 [error] msg: query_mongo_error, mfa:
emqx_authz_mongodb:authorize/4, line: 95, peername: 127.0.0.1:53212,
clientid: client123, collection: mqtt_acl, filter: #{username =>
<<"emqx_u">>}, reason: {resource_error,#{msg => #{error =>
{error,{error_cannot_parse_response,{op_msg_response,#{<<"code">> =>
73,<<"codeName">> => <<"InvalidNamespace">>,<<"errmsg">> => <<"Failed to
parse namespace element">>,<<"ok">> => 0.0}}}},id =>
<<"emqx_authz_mongodb:3">>,name => call_query,request =>
{find,mqtt_acl,#{username => <<"emqx_u">>},#{}},stacktrace =>
[{mc_connection_man,reply,1,[{file,"mc_connection_man.erl"},{line,123}],
...]}, reason => exception}}, resource_id: <<"emqx_authz_mongodb:3">>

Fixes: https://github.com/emqx/emqx/issues/9783
2023-03-09 16:01:23 +01:00
Zaiming (Stone) Shi 9316690c29 fix(schema): binary string for default values
A lot of the string value fields had default value defined in
schema as list-string rather than binary-string.
This caused the generated schema dump (in JSON format)
to have raw_default field as an integer array.
2023-02-21 09:09:51 +01:00
Ivan Dyachkov f90c41f769 fix: set default value in schema 2023-01-12 13:49:52 +01:00
Thales Macedo Garitezi 48e1ba4832 feat(docs): add tags to schemas
This'll allow us to split the generated `schema.json` file into
subsections for better documentation navigation.
2023-01-11 09:10:03 -03:00
Zaiming (Stone) Shi e52f9d5920 refactor: use union member type selector for authz sources 2023-01-09 14:26:16 +01:00
Zaiming (Stone) Shi dbc10c2eed chore: update copyright year 2023 2023-01-02 09:22:27 +01:00
Zhongwen Deng c7cc2e85b2 fix: add default&example for schema 2022-06-06 09:52:10 +08:00
Ilya Averyanov 91da451803 feat(authz): add default authn-based authz source 2022-05-13 12:51:10 +03:00
EMQ-YangM 30b3060327 fix: improve authn, authz metrics 2022-05-05 18:53:31 +08:00
JianBo He 344a754674
Merge pull request #7817 from JimMoen/fix-auth-http 2022-04-29 16:36:10 +08:00
JianBo He 1632df9ebb
Merge pull request #7837 from EMQ-YangM/reduce_duplicate_field
fix: reduce duplicate field
2022-04-29 15:50:27 +08:00
EMQ-YangM 110f0d0e94 fix: reduce duplicate field 2022-04-29 14:37:49 +08:00
JimMoen ad4b70c27e fix(auth): mongo field `filter` not required and have default value 2022-04-29 13:37:29 +08:00
JimMoen 15ef9892c5 fix(auth): authn & authz http support placeholder in HTTP path 2022-04-29 12:48:00 +08:00
JimMoen dae418ae4a fix(auth): authn & authz http not required `body` field 2022-04-29 12:47:56 +08:00
JimMoen e4826400b8 fix(auth): authn & authz HTTP haeders without `content-type` via GET method 2022-04-29 12:47:52 +08:00
Yang Miao 7061d94cf9
Merge pull request #7823 from EMQ-YangM/authz_add_metrics
feat: new authz metrics
2022-04-29 11:27:59 +08:00
EMQ-YangM 3fa8447c85 fix: fix static check warning, add some fields schema 2022-04-29 10:32:52 +08:00
EMQ-YangM f91a6b9f00 fix: authz add metrics_and_status schema 2022-04-29 00:37:21 +08:00
zhouzb fa9bd74595 chore: rename selector to filter and fix spellcheck 2022-04-27 11:29:18 +08:00
Ilya Averyanov fc2ea9e484 feat(emqx_auth_jwt): use JWT for ACL checks 2022-04-25 11:59:04 +03:00
JimMoen 11d2ae117c docs: authz i18n zh_CN support 2022-04-22 10:40:34 +08:00
JimMoen 341973880d fix(authz): refine authz-http api with default headers 2022-04-19 18:57:01 +08:00
JimMoen 14a97d777d fix(authz): api required fields 2022-04-19 18:57:01 +08:00
ieQu1 8df76da9ac chore(formatting): Fix formatting of modules, authz and authn 2022-04-05 11:01:53 +02:00
ieQu1 99b3f2f83e docs(schema): Document missing records and fields 2022-04-04 23:58:43 +02:00
JimMoen 82559b9b08 style: erlfmt apps/emqx_authz 2022-04-01 02:19:46 +08:00
ieQu1 b6d93e91e6 docs(schema): Document fields for HTTP auth 2022-03-30 13:05:56 +02:00
ieQu1 edb91e2e4a docs(schema): Add descriptions for authZ and connector 2022-03-30 13:01:01 +02:00
JimMoen 41c808a262 fix(authz): write acl and cert files after nodes config synced 2022-03-23 21:14:43 +08:00
JimMoen f5caf66253 refactor(api): unified api name style 2022-03-11 11:07:55 +08:00
Zhongwen Deng db584f79d6 feat: upgrade hocon to 0.25.0 to replace nullable with required. 2022-02-24 22:39:03 +08:00
JimMoen 4d5ee355bb fix(authz): authz http pool_type use default value `random` 2022-02-21 18:09:04 +08:00
JimMoen ff68e2a20f fix(http): connector and authn/authz http `keep-alive` default 30s , max 1000 2022-02-21 16:35:15 +08:00
k32 5638bcb92b docs: Fix typos 2022-02-17 23:22:31 +01:00
Zaiming (Stone) Shi 2a6d11c7f1
Merge pull request #7038 from zmstone/chore-rename-emqx-no-space-source-code
chore: EMQ X -> EMQX in source code
2022-02-17 21:13:43 +01:00
Zaiming (Stone) Shi 64db085163 chore: EMQ X -> EMQX in source code 2022-02-16 22:08:12 +01:00
zhongwencool 34fe5082c4 fix(schema): schema global validations not working 2022-02-16 14:20:15 +08:00
JimMoen ab7c2b72e3 refactor(connector): db connector provide default port 2022-02-15 00:51:48 +08:00
Shawn 8207090419 fix: format the code to remove extra spaces 2022-02-09 18:46:49 +08:00
Zaiming (Stone) Shi d6f7ffec3c
Merge pull request #6881 from zmstone/refactor-upgrade-hocon-0.23.0
refactor: upgrade to hocon 0.23.0
2022-01-27 15:48:23 +01:00
Kian-Meng Ang fc92e4c8bf docs: fix typos 2022-01-27 12:29:38 +01:00
Zaiming (Stone) Shi 252d7e85d9 refactor: call new hocon apis 2022-01-27 00:23:08 +01:00
Zaiming (Stone) Shi 21183f3b16 docs: fix authz config doc 2022-01-24 13:30:42 +01:00
zhongwencool 3bdfa183f3
Merge pull request #6666 from JimMoen/merge-5.0-beta.3-to-master
Merge 5.0 beta.3 to master
2022-01-06 18:20:30 +08:00
JimMoen 9a115b99a4 Merge remote-tracking branch 'emqx/release-5.0-beta.3' into merge-5.0-beta.3-to-master 2022-01-06 14:08:45 +08:00
Zaiming (Stone) Shi 63167cea70 chore: update copyright 2022-01-05 20:55:00 +01:00
zhongwencool f4f5281b16 fix: authz headers default value 2022-01-05 22:06:50 +08:00
zhongwencool 7e48a4e6f5 fix: authz default should be a map 2022-01-05 19:04:51 +08:00
zhongwencool 303707d69d fix: make sure authz headers is binary. 2022-01-05 15:11:16 +08:00