Automated post-migration validation for iam-migration (ETBC to IAM). Use when designing or executing verification that legacy ETBC users can log in to the portal, permissions are consistent, and app/menu mappings are correct across iam-management-service, iam-auth-center-service, APISIX, and portal-front.
Provide a repeatable workflow to validate ETBC to IAM migration outcomes: login compatibility, permission parity, and app/menu tree mapping correctness. Use this skill to design checks, automate validation, and generate a release gate report.
Collect these before running the workflow:
iam-migration, iam-management-service, , and .iam-auth-center-serviceportal-frontFIELD_MAPPING_CN.md and src/main/resources/sql/reader/*.sql in iam-migration as the mapping source of truth.--tenant-id to scripts.legacy_user_mapping, legacy_role_mapping, legacy_resource_mapping, legacy_org_mapping.iam_user_role, iam_role_permission, iam_feature_permission, iam_solution_layout.iam-auth-center-service for each password algorithm in scope.iam-management-service portal endpoints.legacy_resource_mapping.Use the scripts in scripts/ to automate validation steps.
Run to validate legacy mapping coverage, duplicates, and orphans.
Example:
python3 scripts/validate_legacy_mappings.py \
--etbc-users etbc_users.csv \
--etbc-roles etbc_roles.csv \
--etbc-resources etbc_resources.csv \
--etbc-orgs etbc_orgs.csv \
--legacy-user legacy_user_mapping.csv \
--legacy-role legacy_role_mapping.csv \
--legacy-resource legacy_resource_mapping.csv \
--legacy-org legacy_org_mapping.csv \
--out-dir out/mapping \
--tenant-id 1001
Run to compare ETBC menu tree with IAM resources via legacy mappings. Use --ignore-name or --ignore-uri when localization differs.
Example:
python3 scripts/compare_menu_tree.py \
--etbc-resources etbc_resources.csv \
--iam-resources iam_resources.csv \
--legacy-resource legacy_resource_mapping.csv \
--out-dir out/menu \
--tenant-id 1001
Run to compare ETBC role-resource relations with IAM role-permission assignments.
Example:
python3 scripts/compare_role_permissions.py \
--etbc-role-resource etbc_role_resource.csv \
--legacy-role legacy_role_mapping.csv \
--legacy-resource legacy_resource_mapping.csv \
--iam-role-permission iam_role_permission.csv \
--out-dir out/permissions \
--tenant-id 1001
Run to validate login and portal access via auth center and portal APIs. This script uses openssl for RSA encryption.
Set portal_headers in the config if the portal requires tenant-specific headers (for example X-Iam-Tenant).
Example:
python3 scripts/portal_login_smoke.py \
--config references/portal-login-config.json \
--out-dir out/login
Use --self-test to validate RSA encryption without calling remote endpoints.
references/validation-checklist.md for detailed checks, example query shapes, and report fields.references/portal-login-config.json as the config template for portal login checks.