permissions.csv integrity: 8 duplicate key UUIDs; 17 cloud-seeded keys missing from the registry
While landing the key-based authorization refactor in meshery-cloud (layer5io/meshery-cloud#5477, design doc `docs/authorization-key-based-refactor.md`), the new seed↔registry drift guard surfaced two integrity problems in the permissions registry (`models/permissions/permissions.go`, generated from `build/permissions.csv`, IndexID `723d8ad7…`):
### 1. Eight UUIDs are assigned to more than one permission key
437 generated constants map to only 428 distinct UUIDs. Duplicates:
```
045fad17-d2cc-46e8-bb10-f9ee026c799f
4726da45-2108-409b-b94f-45bd1e199a78
72066352-d09b-494a-b02e-846676bd7a0a
81287ea7-5e3f-480c-8b2e-211d62d08797
9225d5a7-7255-49be-9233-daeabefae306
9a84a5d0-0a16-11ee-be56-0242ac120002 <- e.g. IdentityAccessManagementRoles AND ConfigurationManagementVirtualservice
9f236c99-b2ec-4474-9ec8-7c3f8a09e63e
faa0cb66-af78-4a6f-84f0-3bfae7254276
```
A key UUID is the authorization identity of a permission: two constants sharing one UUID means granting either silently grants both. Each duplicate needs a fresh uuidv4 minted for one of its rows (and a decision about which row keeps the original, since DB seeds may already reference it).
Suggested guard: make `make validate-schemas` (or the permissions generator) fail on duplicate `Key ID` values in `permissions.csv`.
### 2. Seventeen key UUIDs seeded in meshery-cloud are absent from the CSV registry
These rows exist in meshery-cloud's DB seed (`database/migrations/20190402165034_seed_reference_data.postgres.up.sql`) and are live in deployments, but have no row in `permissions.csv` / no generated constant:
```
141a5f3d-b5e2-4f36-8f83-df7f73744ee1
17447fb0-be46-1497-1366-c34e24920f22 (UI ALL_ORG_SELECTOR)
41a9eb36-b99b-4715-8140-780f97d3c6a0 (Create Team)
4b3117e6-176c-4d9b-8e09-4278d2f48280
5385852a-8cb7-498c-b3a6-9a0059c25017
595b921a-ea1e-4611-83f0-503db0eeb94d
5a26b21b-bf15-4622-9681-d907fc5154fd
5b48eded-15d8-4c51-9ac4-b11097dbdd75
69179641-6c41-40d8-87a0-81dd99bcb396
7116c095-d7b4-4ab8-9d55-f33bf9d13ecd
a7392c29-34af-4ee9-af1c-71e83876a8aa
b2b9c027-0f39-4a26-b3ed-5b30aaf82060
bbb691b6-8664-44c7-8ea7-9c46b1ca1e8b (Delete Team)
ddba5064-ac3c-470e-b405-d2a0e99db477
e996c998-a50f-4cb8-ae7b-77127073a6ca (Remove User from Team)
f224ecf3-b105-4d81-9886-77127073a6ca (Invite User to Team)
f2e04b59-42ee-4af6-b488-7bc7047fc01b
```
meshery-cloud now carries this list as a SHRINK-ONLY allowlist in `server/dao/seed_registry_drift_test.go`; once a UUID is registered in the CSV, that test forces the consumer-side entry to be deleted. Registering them upstream is the convergence path (CSV is the source of truth per `AGENTS.md`).
1 条评论