New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(bridge): validate bridge name before attempting to convert certificates #11540
fix(bridge): validate bridge name before attempting to convert certificates #11540
Conversation
dbbed50
to
c14556c
Compare
could it be a schema validator? |
There's already validation in hocon for that. The problem here is that certificate conversion happens before hocon is called, and invalid names might lead to bad file paths. |
c14556c
to
0f297ff
Compare
@@ -180,6 +181,31 @@ t_update_ssl_conf(Config) -> | |||
?assertMatch({error, enoent}, file:list_dir(CertDir)), | |||
ok. | |||
|
|||
t_create_with_bad_name(_Config) -> | |||
Path = [bridges, mqtt, 'test_哈哈'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😮💨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
¯\_(ツ)_/¯
targeting
release-52
Fixes https://emqx.atlassian.net/browse/EMQX-10865
Example error:
Summary
🤖 Generated by Copilot at dbbed50
This pull request improves the validation of bridge names in the
emqx_bridge
application. It adds a new function and a regular expression macro to check the bridge names in the configuration files and the HTTP API. It also updates the test suites to cover the new validation logic and the HTTP response.PR Checklist
Please convert it to a draft if any of the following conditions are not met. Reviewers may skip over until all the items are checked:
changes/(ce|ee)/(feat|perf|fix)-<PR-id>.en.md
filesChecklist for CI (.github/workflows) changes
changes/
dir for user-facing artifacts update