feat(admin): include admins in complete system data export#623
Open
Kayphoon wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Why
The complete system data export is intended to be a full backup of all system state, but it was previously omitting admin users. This meant that a restored system would lose admin accounts. The standalone users export should continue to exclude admins to avoid leaking privileged credentials through that path.
Changes
apps/aether-gateway/src/handlers/admin/request/system/export.rsbuild_admin_system_users_export_payload_with_admin_scopehelper with aninclude_admin_usersflag.include_admin_users = falsefor the standalone users export.include_admin_users = truefor the complete system data export.apps/aether-gateway/src/tests/control/admin/system.rsgateway_handles_admin_system_data_export_includes_admin_users_in_complete_backupverifying both admin and regular users appear in the complete backup.Review Guide
Start here:
apps/aether-gateway/src/handlers/admin/request/system/export.rs— the scope toggle logic.Then check:
apps/aether-gateway/src/tests/control/admin/system.rs— new and updated assertions.Focus areas:
/api/admin/system/users/exportpath still excludes admins./api/admin/system/data/exportpath now includes admins.Can skim:
Verification
cargo fmt --checkgit diff --checkcargo test -p aether-gateway gateway_handles_admin_system_users_export_locally_with_trusted_admin_principalcargo test -p aether-gateway gateway_handles_admin_system_data_export_includes_admin_users_in_complete_backupcargo test -p aether-gateway admin_system_shared_configs_split_export_ownerscargo test -p aether-gateway admin_system_owns_system_route_helpersRisk
Risk level: Low
Potential impact:
Rollback plan:
build_admin_system_users_export_payloadbehavior will be restored.