Commit Graph

18116 Commits

Author SHA1 Message Date
Andrew Mayorov
e521a9f5fc
fix(utils): denote emqx_jsonish follows access module behaviour
Defined in `emqx_template`.
2023-11-02 20:13:32 +07:00
Andrew Mayorov
b5b6c3f8cc
fix(tpl): ensure full backward compat in basic connectors 2023-11-02 20:13:32 +07:00
Andrew Mayorov
02c1bd70b6
feat(tpl): factor out loose json concept into a separate module
Which is called `emqx_jsonish`. Also introduce an _access module_
abstraction to extract information from such data during rendering.
2023-11-02 20:13:31 +07:00
Andrew Mayorov
69cfa740ea
fix(ruleeng): ensure full backward compatibility 2023-11-02 17:11:12 +07:00
Andrew Mayorov
75cc663786
chore(ruleeng): streamline application dependencies 2023-11-02 17:11:12 +07:00
Andrew Mayorov
8e4585d64f
chore: move template modules to emqx_utils
Even though most of the time these modules will be used by
connectors, there are exceptions (namely, `emqx_rule_engine`).
Besides, they are general enough to land there, more so given
that `emqx_placeholder` is already there.
2023-11-02 17:11:12 +07:00
Andrew Mayorov
343b679741
feat(tpl): make escaping mechanism more foolproof
Treat "${$}" as literal "$". This allows to template express
strings, for example, of the form "${some_var_value}" where
`some_var_value` is interpolated from bindings.
2023-11-02 17:11:11 +07:00
Andrew Mayorov
f689d6c233
fix(tpl): ensure backward compat in emqx_rule_engine
Missing bindings in string templates will be rendered as "undefined",
as before. Rendering still assumes that missing binding with implicit
default (`undefined`) is an error.

This will also restore complete backward compat in `emqx_prometheus`.
2023-11-02 17:11:11 +07:00
Andrew Mayorov
1fcdfe991c
fix(tpl): add few missing @docs + correct typespecs 2023-11-02 17:11:11 +07:00
Andrew Mayorov
a9693eada7
fix(tpl): rename trivial -> is_const
This is clearer. Former naming was a bit misleading.
2023-11-02 17:11:11 +07:00
Andrew Mayorov
7bb995f0c6
feat(tpl): support :n SQL parameters 2023-11-02 17:11:11 +07:00
Andrew Mayorov
dfb7faf6a8
fix(tpl): ensure rough backward compat in emqx_prometheus
But also emit warning when job name template renders with errors.
2023-11-02 17:11:10 +07:00
Andrew Mayorov
49fba40ee7
fix(tpl): ensure backward compat with authz / authn templates
This commit leans heavy into discouraging the former approach where
only part of placeholders were interpolated, depending on `placeholders`
option.
2023-11-02 17:11:10 +07:00
Andrew Mayorov
49f5325c67
feat(tpl): unify validations / errors var representations 2023-11-02 17:11:10 +07:00
Andrew Mayorov
b812f9af5a
feat(tpl): use emqx_connector_template in emqx_rule_engine app 2023-11-02 17:11:10 +07:00
Andrew Mayorov
e1bca5844f
feat(tpl): use emqx_connector_template in emqx_prometheus app 2023-11-02 17:11:10 +07:00
Andrew Mayorov
0538a77700
feat(tpl): use emqx_connector_template in emqx_authn, emqx_authz
This slightly changes semantics: now the attempt to create authenticator
with illegal bindings in templates will fail, instead of treating them
as literals. The runtime behaviour on the other hand should be the same.
2023-11-02 17:11:10 +07:00
Andrew Mayorov
35902dc72d
feat(tpl): switch basic connectors to emqx_connector_template
Also avoid `filename:join/2` in HTTP connector since it's both OS specific
and an overkill.
2023-11-02 17:11:09 +07:00
Andrew Mayorov
28d55d72ca
feat(tpl): split emqx_placeholder into a couple of modules
Located under `emqx_connector` for now. The APIs of the new modules
are slightly different from the old ones. The new ones are more
explicit in terms of error handling. Also copy the according testsuite
from `emqx_plugin_libs` and enrich it for better coverage.
2023-11-02 17:11:09 +07:00
JimMoen
a4ab744d4e
Merge pull request #11805 from HJianBo/typo-fixes
chore: typo fixes
2023-10-25 09:16:23 +08:00
Stefan Strigler
6e12569260
Merge pull request #11797 from sstrigler/EMQX-1057-fix-authz-api-donot-return-200
fix: return 404 if built_in_database not configured as auth source
2023-10-24 12:08:53 +02:00
Stefan Strigler
9436582e14 fix: remove debug statement 2023-10-24 09:57:37 +02:00
Stefan Strigler
ea9228108b fix: use minirest filter 2023-10-24 09:57:08 +02:00
JianBo He
ec7b669b79 chore: typo fixes 2023-10-24 08:51:52 +08:00
Thales Macedo Garitezi
d392c9989f
Merge pull request #11793 from thalesmg/test-rule-engine-foreach-m-20231019
test(rule_engine): add test to exemplify `foreach` with json array payload
2023-10-23 13:43:33 -03:00
Stefan Strigler
4e0e755b28 fix: return 404 if built_in_database not configured as auth source 2023-10-23 16:26:41 +02:00
Zaiming (Stone) Shi
c2d0b91cd7
Merge pull request #11804 from savonarola/1023-friendly-profile-error
chore(tests): report more friendly about unset PROFILE variable
2023-10-23 15:03:21 +02:00
Ilya Averyanov
8c6f6b56b8 chore(tests): report more friendly about unset PROFILE variable 2023-10-23 13:48:42 +03:00
Ivan Dyachkov
541081e10e
Merge pull request #11801 from id/1021-sync-r53
sync r53
2023-10-22 17:26:43 +02:00
Ivan Dyachkov
f94d5757bb Merge remote-tracking branch 'upstream/release-53' into 1021-sync-r53 2023-10-21 08:44:32 +02:00
Ivan Dyachkov
a437e7d0c7
Merge pull request #11799 from id/1020-emqx-builder-5.2-3
chore: emqx-builder 5.2-3
2023-10-20 17:37:24 +02:00
Ivan Dyachkov
41dba71901 chore: emqx-builder 5.2-3 2023-10-20 16:26:53 +02:00
Ilya Averyanov
af6a364492
Merge pull request #11790 from savonarola/1018-improve-redis-cmd-validation-in-auth
feat(auth): improve redis command parsing and validation
2023-10-20 10:04:05 +03:00
Thales Macedo Garitezi
8c4beec6f0 test(rule_engine): add test to exemplify foreach with json array payload
Relates to https://emqx.atlassian.net/browse/EMQX-11174
2023-10-19 18:19:42 -03:00
Ilya Averyanov
0b4600c293 feat(auth): improve redis command parsing and validation 2023-10-19 23:01:35 +03:00
Thales Macedo Garitezi
eda82caf65
Merge pull request #11791 from thalesmg/fix-coap-heartbeat-m-20231018
fix(coap): increase received packet counter for keepalive
2023-10-19 13:12:41 -03:00
Ilya Averyanov
8d82c30b00
Merge pull request #11771 from savonarola/1015-validate-bcrypt-schema-in-api
feat(authn): allow authn providers to define a separate schama for API
2023-10-19 15:34:34 +03:00
Ilya Averyanov
8f9ac6c1f3
Merge pull request #11776 from savonarola/1017-auth-cleanup-2
chore(authn): remove dead code
2023-10-19 15:28:35 +03:00
zhongwencool
9f197a6915
Merge pull request #11785 from zhongwencool/rbac-change-pwd 2023-10-19 09:02:15 +08:00
Thales Macedo Garitezi
5b9866f630 fix(coap): increase received packet counter for keepalive
Fixes https://emqx.atlassian.net/browse/EMQX-11193
Fixes https://github.com/emqx/emqx/issues/11779
2023-10-18 16:35:33 -03:00
Zaiming (Stone) Shi
47199662ec
Merge pull request #11786 from emqx/release-53
Sync release-53 to master
2023-10-18 16:42:58 +02:00
Zaiming (Stone) Shi
f985f149d9
Merge pull request #11787 from zmstone/1018-refactor-improve-nodetool-performance
refactor(nodetool): only add libs when necessary
2023-10-18 16:37:51 +02:00
Zaiming (Stone) Shi
ad09ca9d6d refactor(nodetool): only add libs when necessary 2023-10-18 14:08:35 +02:00
Zaiming (Stone) Shi
dbffc080c2
Merge pull request #11775 from zmstone/1016-docker-build-support-cache
build: make use of rebar git cache in docker build
2023-10-18 13:07:41 +02:00
zhongwencool
81e10c6748 chore: add changelog for 11785 2023-10-18 18:46:13 +08:00
zhongwencool
2388d36b09 fix: allow viewers to change their own passwords 2023-10-18 18:40:02 +08:00
Ilya Averyanov
e1c8317779 chore(authn): remove dead code 2023-10-18 10:57:55 +03:00
Ivan Dyachkov
4c0bec1866
Merge pull request #11782 from id/1018-sync-r53
sync r53
2023-10-18 09:19:36 +02:00
Ivan Dyachkov
82bac3e136 Merge remote-tracking branch 'upstream/release-53' into 1018-sync-r53 2023-10-18 08:04:45 +02:00
Ivan Dyachkov
d45ac980f6
Merge pull request #11781 from id/1017-ci-update-runner-labels
ci: explicitly specify architecture in runner labels
2023-10-18 08:03:35 +02:00