Skip to content
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: avoid duplicated apikey from data import #11798

Merged
merged 2 commits into from Oct 23, 2023

Conversation

JimMoen
Copy link
Member

@JimMoen JimMoen commented Oct 20, 2023

Fixes EMQX-11209

Mnesia uses the first field of the record as the key to identify a record.

In this case:
Table emqx_app's key is name, and it is randomly generated and has no association with api_key.
So when exporting/importing on two different clusters, there will be two records in mnesia with the same api_key but different name, which will cause a case_caluse when node restart after importing.

Summary

🤖 Generated by Copilot at 3fb7df6

This pull request improves the management API key feature by refactoring the creation and authentication logic, adding app key support for the tests, and documenting the dashboard API key function. It affects the files emqx_mgmt_auth.erl, emqx_common_test_http.erl, and emqx_mgmt_api_api_keys.erl.

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:

  • Added tests for the changes
  • Added property-based tests for code which performs user input validation
  • Changed lines covered in coverage report
  • Change log has been added to changes/(ce|ee)/(feat|perf|fix)-<PR-id>.en.md files
  • For internal contributor: there is a jira ticket to track this change
  • Created PR to emqx-docs if documentation update is required, or link to a follow-up jira ticket
  • Schema changes are backward compatible

Checklist for CI (.github/workflows) changes

  • If changed package build workflow, pass this action (manual trigger)
  • Change log has been added to changes/ dir for user-facing artifacts update

@JimMoen JimMoen marked this pull request as ready for review October 20, 2023 14:34
@JimMoen JimMoen requested review from lafirest, sstrigler and a team as code owners October 20, 2023 14:34
@JimMoen JimMoen merged commit 60a84b2 into emqx:release-53 Oct 23, 2023
140 checks passed
@JimMoen JimMoen deleted the fix-conflict-api-key branch October 23, 2023 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants