)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":34120,"name":"Andre Aranha","display_name":"Andre Aranha","email":"afariasa@redhat.com","username":"afariasa"},"change_message_id":"155760f769e90be4809120e5de5184077b9d1948","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"68149e95_b21ea2d1","updated":"2026-09-18 14:57:39.000000000","message":"Sorry, I didn\u0027t read properly the code, not I get it and it was my mistake","commit_id":"119e0eef701a37f7a78289a965df8d22d856a5b6"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"1607a3327209d4631b66ce006e5cc30fcdc31862","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"d65c47aa_f4e86fbc","updated":"2026-09-18 10:08:04.000000000","message":"While it may not be as important to be so precise in the spec, but it\u0027s IMO very important for the user facing documentation to be explicit and precise about the security claims.","commit_id":"119e0eef701a37f7a78289a965df8d22d856a5b6"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"e3e6ba96a9bd6689bcfb29426d662dce575ed794","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"8632faf1_9a243ad8","updated":"2026-09-18 15:35:51.000000000","message":"Qwen3.8 findings\n\nBlocking / major\n1. Domain-delete cascade is undefined (biggest gap). Today _delete_domain (keystone/resource/core.py:908) recursively hard-deletes all projects/subprojects in the domain, then the _domain_deleted notification (keystone/identity/core.py:619) deletes all groups and users in it. The spec only says delete_domain() will \"mark as deleted\" — it never says what happens to the domain\u0027s contents. If only the domain row is marked, its projects and users stay deleted\u003dFALSE but become unreachable zombies (domain no longer resolves). The spec must define whether domain soft-delete cascades to soft-deleting all contained projects and users (each with its own deleted_at).\n2. Cross-spec conflict with the explicit-IDs spec (same cycle, 2026.2).\n- References (line 861) points to specs/keystone/2026.2/explicit-resource-ids.rst, which doesn\u0027t exist; the actual spec is explicit-project-domain-ids.rst (on review/997320), and it covers projects and domains only — not users. The dependency wording (\"explicit ID creation\" as motivation for user ID reuse) overstates the dependent spec\u0027s scope.\n- Config-option clash: that spec plans [resource] soft_delete_projects; this spec defines [resource] soft_delete_enabled + [identity] soft_delete_enabled. Both can\u0027t own project soft delete.\n- That spec\u0027s phased plan says soft delete is \"Phase 2 (next release)\"; this spec implements it in 2026.2 and depends on it. The dependency direction and ownership need to be reconciled before either lands.\n- Work item 5 references check_id_uniqueness() and id_in_use() in keystone/common/id_utils.py — none of these exist in keystone. The explicit spec defines validate_global_uniqueness(resource_id, resource_type), and it goes through API-level get_user()/get_project(), which this spec will make filter out soft-deleted rows. That function needs an include-deleted path; the cross-spec dependency should be stated explicitly.\n3. Work item 2 cites a non-existent filter. \"Remove local_user.id IS NULL exemption from list_users()\" — no such exemption exists; list_users (keystone/identity/backends/sql.py:184) only outer-joins LocalUser for the password_expires_at filter. Likely a misread; drop or rewrite the bullet.\nModerate\n4. Group namespace omitted from ID-reuse checks. The pseudocode checks project and user only; Keystone user/group/project IDs share one namespace. Either include group or state explicitly it\u0027s out of scope (note the explicit spec\u0027s validate_global_uniqueness also omits it — worth aligning).\n5. Missing DROP statements in DDL. The existing UniqueConstraint(\u0027domain_id\u0027, \u0027name\u0027) on both project and local_user must be dropped when replacing with the name_active indexes — otherwise soft-deleted names stay blocked. The federated_user section says \"replace\" but the MySQL DDL blocks for project/local_user/federated_user only show ADD/CREATE.\n6. name_active maintenance on rename. User names are updatable (update_user accepts name; keystone/identity/core.py:1345). The app-maintained local_user.name_active must be updated on the rename path and re-uniqueness-checked, but the spec only describes create/soft-delete transitions.\n7. Default-on is an upgrade behavior change that\u0027s under-discussed. soft_delete_enabled \u003d True by default means every upgrading deployment changes delete semantics (names/IDs no longer immediately reusable, unbounded storage growth if no purge). The Alternatives section considers \"mandatory\", but Other Deployer Impact never calls out the default-on change or the opt-out (\u003d False to keep today\u0027s behavior).\nMinor\n 8. Reference Implementation: keystone already ships soft delete for trusts (trust.deleted_at, filtered deleted_at\u003dNone in keystone/trust/backends/sql.py:162) plus a purge command (keystone-manage trust_flush, keystone/cmd/cli.py:972). That\u0027s a closer in-tree precedent than Barbican and gives a naming precedent for the new purge commands.\n 9. CLI flag --age-in-days vs config auto_purge_age_days — naming inconsistency, cosmetic.\n10. Purge of a user leaves dangling trust/role references — same as today\u0027s hard delete, and \"purge affects only the Keystone database\" covers it; a one-line explicit note would prevent reviewer questions.\nVerified accurate (no action needed)\n- nonlocal_user PK is indeed (domain_id, name) with unique user_id; surrogate-PK migration is justified\n- federated_user has the unconditional UniqueConstraint(\u0027idp_id\u0027,\u0027protocol_id\u0027,\u0027unique_id\u0027)\n- expiring_user_group_membership is a real table; shadow_users_api.delete_user() is a real path used during domain deletion (keystone/identity/core.py:646)\n- get_user/get_federated_user/get_federated_users exist in identity/shadow_backends/sql.py\n- Re-auth flow (shadow_federated_user → update_federated_user_display_name → get_federated_user → create) matches the \"create new shadow\" behavior described\n- FK ondelete\u003d\u0027CASCADE\u0027 on local_user/federated_user/nonlocal_user means purge cascades as claimed","commit_id":"0668f7f9abec4de31a5babfd33c2cfed9f7e907f"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"035ae6c5edc91be5687220202ba6f8e065825966","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"a4690fad_ab7270ab","updated":"2026-10-02 17:17:35.000000000","message":"The reasoning is very clear to me, but the more I dive into details the more problems I see. The spec is written as if mysql is the only DB (it mentions postgres, but breaks it in lot of places) and DB driver is the only one existing - both are wrong. The spec need to be written from the provider pov addressing potential external drivers. In addition to that a change like that makes keystone-rs co-existence much harder since till now there were no major DB changes (I agree that we need changes, but we need to keep overall strategy in focus).\n\n## 1. [HIGH] Migration never backfills `local_user.name_active`\n\nUniqueness Constraints (local_user DDL, ~:707-735) adds `name_active` as a\nplain NULL column. Migration section (:1244-1264) and work item 1 have no\npopulation step. NULLs are distinct in a unique index, so once the old\n`UNIQUE (domain_id, name)` is dropped, `UNIQUE (domain_id, name_active)`\nallows duplicate *active* names for every pre-existing user. Uniqueness stops\nholding the moment the migration lands.\n\n**Rename is not propagated either.** Verified: `update_user`\n(identity/backends/sql.py:262-272) `setattr`s `model.User.attributes`; `name`\ngoes through the `User.name` hybrid setter, which writes only `local_user.name`\n(sql_model.py:107-114). Nothing touches `name_active`, and the spec only\nmentions sync in a 4-line comment (:711-713) with no code anchor. After a\nrename `name_active` keeps the old name, so:\n- the old name stays reserved (cannot be reused by a new user), and\n- the new name is not in the index, so a second active user can take it,\n  which silently defeats the uniqueness guarantee the index exists for.\nThe spec\u0027s own \"re-checked\" wording (:716) has no mechanism either. See issue\n6 for where the sync must live.\n\nFix:\n- Update `name_active` in the same write as `local_user.name` on rename\n  (create and soft-delete too), and add a rename test: rename A→B, then create\n  A (must succeed) and create B (must conflict).\n- `UPDATE local_user SET name_active \u003d name WHERE name_active IS NULL` in the\n  migration and work item 1 (both PG and MySQL; `local_user` is\n  app-maintained on both). Project/group generated columns and PG partial\n  indexes self-populate.\n- Do backfill and constraint swap in the same revision, or backfill in expand\n  and swap later (see issue 6).\n- Regression test: duplicate-name insert still rejected after migration.\n\n## 2. [HIGH] `mapping_purge` + `mapping_populate` no longer restores mapped-LDAP IDs\n\nSpec :292-295 calls this \"intentional\". Verified: `id_mapping` public IDs are\nminted by `id_generator_api.generate_public_ID` (mapping_backends/sql.py:74-79),\na deterministic hash, so `mapping_purge` + `mapping_populate` (cmd/cli.py:1054,\n:1605) reproduces the same IDs and role assignments keep working. With\nrandom UUIDs, purge/populate yields new IDs and every assignment, ACL, and\ncross-service reference to mapped-LDAP users/groups is orphaned.\n\nAlso unrelated to the spec\u0027s goal: LDAP delete is `Forbidden`, so no ID-reuse\nrisk exists for mapped LDAP. Drop mapped LDAP from scope, or give a concrete\nreuse scenario and a recovery story.\n\n## 3. [HIGH] `nonlocal_user` schema work is unreachable\n\nPer the spec\u0027s own carve-outs (:255-268, :609-616) nonlocal users are never\nsoft-deleted. Verified: individual `DELETE /users` is `Forbidden`\n(identity/backends/ldap/core.py:169-176); LDAP-domain delete hard-deletes SQL\nshadows via `shadow_users_api.delete_user` (`_domain_deleted`,\nidentity/core.py:619-648). Yet the spec adds a surrogate PK, `mapping_active`,\ngenerated columns and a new unique index to `nonlocal_user` (:779-814) and\nlists `nonlocal_user.mapping_active \u003d FALSE` in Delete Operations step 2\n(:570-571). Only conceivable path is a domain reconfigured LDAP→SQL, which the\nspec never mentions. Document the scenario or drop the schema work (real\nmigration risk for a dead path).\n\n## 4. [HIGH] Rolling upgrade / expand-contract not addressed\n\nKeystone migrations follow expand/migrate/contract\n(`doc/source/contributor/database-migrations.rst`). The spec does not say\nwhich phase each step belongs to. Old nodes during a rolling upgrade\nhard-delete and do not filter `deleted`, so they see soft-deleted rows as live.\nSpecify the phase for each DDL step and gate soft-delete behavior until\ncontract completes. \"Online, no downtime\" and the \"based on Barbican\nexperience\" timings (:1266-1270) are unsupported; MySQL `STORED` generated\ncolumns rebuild the table.\n\n## 5. [HIGH] PostgreSQL DDL wrong; constraint names wrong\n\n- Spec uses MySQL backticks in PG DDL (:449, :464, :823, :826). PG needs\n  `\"group\"`.\n- Verified in `27e647c0fad4_initial_version.py`: project and group unique\n  constraints are named `ixu_project_name_domain_id` (:266) and\n  `ixu_group_name_domain_id` (:159). Spec drops `project_domain_id_name_key` /\n  `group_domain_id_name_key` (:687, :824), which do not exist.\n- `local_user (domain_id, name)` is **unnamed** (sql_model.py:319; initial\n  migration :819), so the PG default name and the MySQL index name (typically\n  `domain_id`) are not `local_user_domain_id_name_key`.\n- `nonlocal_user` PK is `(domain_id, name)` (sql_model.py:452).\n- MySQL uses generated columns in the migration, while Postgres is kept empty breaking the the support (since we currently do not have tests with postgres in CI this wouldn\u0027t even be noticed).\n- Fix: drop via the SQLAlchemy/alembic inspector by column set, not by a\n  guessed name.\n\n## 6. [HIGH] `name_active` is not specified as a model attribute\n\nBeyond the backfill (issue 1), the spec never says how `name_active` enters\nthe model. Verified:\n- `LocalUser.attributes \u003d [\u0027id\u0027,\u0027user_id\u0027,\u0027domain_id\u0027,\u0027name\u0027]`\n  (sql_model.py:302). If `name_active` is added, serialization\n  (`to_dict`/`filter_user`) must exclude it from the API payload.\n- `User.name` is a hybrid property; the setter writes `local_user.name`\n  (sql_model.py:107-114). `update_user` does `setattr` over\n  `model.User.attributes` (identity/backends/sql.py:262-272). The sync point\n  for rename is therefore that setter / `LocalUser`, which the spec never\n  names. Same for create (`LocalUser.from_dict`).\n- State why the column must be app-maintained for `local_user`: `deleted`\n  lives on the parent `user` table, so neither a partial index nor a MySQL\n  generated column on `local_user` can see it.\n- Spec out: attribute, serialization exclusion, create/rename/soft-delete\n  sync points. Test rename.\n\n## 7. [MED] Federated and mapped-LDAP ID minting change not gated on `soft_delete_enabled`\n\nThe SHA-256→UUID switch (:203-212) is unconditional. Opt-out deployments\n(`soft_delete_enabled \u003d False`) still stop getting a deterministic ID on\nre-login after hard delete (`create_federated_user` uses `generate_public_ID`,\nshadow_backends/sql.py:34-42). Either gate the rule or state it in Other\nDeployer Impact (:1230-1242).\n\n## 8. [MED] Deterministic federated IDs lost; external consumers break\n\nThe SHA-256 of `(domain_id, unique_id, entity_type)` is stable across regions\nand DR rebuilds, and external tooling may pre-compute it or correlate IdP\nidentities to Keystone IDs. First-login UUIDs end that. This also partly\nconflicts with the multi-region/DR motivation of explicit IDs (997320). The\n\"keep SHA-256 until occupied\" alternative (:1083-1089) is rejected on\nconsistency grounds only; weigh the operational cost. Add to End User /\nDeployer Impact.\n\n## 9. [MED] Mixed `soft_delete_enabled` flags: decision left open\n\n:548-558 offers two behaviors and says \"Implementation must pick one\". A spec\nshould pick. Simplest: a single flag (removes the coupling rule, refusal path,\nand one test case). Otherwise choose one behavior and specify the error.\n\n## 10. [MED] Default-on needs explicit justification\n\n`soft_delete_enabled \u003d True` (:1001-1027) flips delete semantics on upgrade\n(names/IDs not reusable, unbounded growth without purge). Justify\ndefault-True vs default-False for 2026.2; flag as a community decision point.\n\n## 11. [MED] Non-SQL drivers: contract missing\n\nSoft delete is only implementable in the SQL backend, but identity/resource\ndrivers are pluggable. Verified: `IdentityDriverBase.delete_user`\n(identity/backends/base.py:345), `delete_group` (:469),\n`ResourceDriverBase.delete_project` (resource/backends/base.py:119);\n`_domain_deleted` only branches on `driver.is_sql` (identity/core.py:619).\nThe spec does not say whether interfaces change. Decide: (a) SQL-internal, no\ninterface change, non-SQL drivers keep hard-delete and ID reservation is only\nguaranteed for SQL-backed domains (document the mixed-deployment caveat); or\n(b) interface change with defaults and a deprecation story for third-party\ndrivers.\n\n## 12. [MED] `deleted` boolean redundant with `deleted_at`; \"trust pattern\" claim inaccurate\n\nSpec cites trust as precedent (:96-98), but trust uses `deleted_at` only\n(trust/backends/sql.py:49; filter :117). Every use in the spec works with\n`deleted_at IS NULL` (list filter, purge, PG partial index, MySQL generated\ncolumn). The boolean adds row width and an inconsistency state\n(`deleted\u003dTRUE`, `deleted_at\u003dNULL`). Either drop it, or justify it and name\nthe authoritative column plus where the invariant is enforced. Alternative\nto evaluate: a single lifecycle `status` column; note `enabled`\n(reversible, visible) is orthogonal to deleted. If `status` is chosen, every\nindex/uniqueness expression must be re-derived.\n\n## 13. [MED] \"API Changes: None\" undermines the audit-integrity claim\n\nSpec claims audit integrity (:1121-1122) while soft-deleted rows are\ninvisible to every get/list and return the same `*NotFound` as unknown IDs.\nOperators cannot see name or `deleted_at` through Keystone; `--dry-run` is the\nonly visibility. Either add admin-only visibility (e.g. `deleted_at`, a list\nfilter behind a microversion, or a distinguishable error) or weaken the claim\nto \"row retained in DB\".\n\n## 14. [MED] Password hashes (and PII) retained until purge for no reason\n\nSpec :1140-1143 keeps `password` rows until `user_purge`. Restore is out of\nscope (:1149), so nothing needs them. Scrub hashes, `user_option`, and\nextra/PII at soft-delete; keep only the ID tombstone.\n\n## 15. [LOW] `id_mapping.public_id` not in the ID-reuse namespace\n\nID reuse checks (:855-895) cover project/user/group (roles noted). `id_mapping`\npublic IDs share the identity namespace and a new UUID can collide with one.\nInclude it or state why not.\n\n## 16. [LOW] Toggling `soft_delete_enabled` True→False leaves invisible rows\n\nExisting soft-deleted rows stay but are hidden; purge is a separate flag.\nState the behavior (purge still applies? IDs still reserved?).\n\n## 17. [LOW] References to non-existent code\n\n- `generate_unique_id()` (:204, :396, :604, :1390) does not exist. Users and\n  groups use inline `uuid.uuid4().hex` (identity/core.py:1172, :1435). Say the\n  helper is introduced.\n- `_sort_project_ids_for_hard_delete` (:943) does not exist in-tree.\n- `keystone/common/id_utils.py` (work item 5) does not exist; it appears only\n  if 997320 lands first. Work item should say \"introduce\".\n\n## 18. [LOW] ID-reuse pseudocode partly redundant\n\n:855-885: soft-deleted rows keep their PK, so duplicate inserts fail at the DB\nanyway; the SELECT loop only adds friendly 409s. State that PK uniqueness is\nthe primary protection.\n\n## 19. [LOW / nits]\n\n- `auto_purge` is cron/systemd-invoked, not an in-process scheduler\n  (:914-917); say so.\n- User purge relies on existing `ON DELETE CASCADE` FKs (`local_user`,\n  `nonlocal_user`, `federated_user`, `user_option`, `password`; verified in\n  identity/backends/sql_model.py:320, :341, :397, :410, :428, :500). Note\n  `user_group_membership` / `expiring_user_group_membership` FKs to\n  `user.id`/`group.id` have **no** cascade (:460-475), so memberships must be\n  removed at soft-delete (spec does) and purge should assert it.\n- Project purge ordering is the only real FK constraint\n  (`project.parent_id`/`domain_id`, resource/backends/sql_model.py:70-76).\n  `trust` has no FKs to user/project (trust/backends/sql.py:44-47).\n- :103 \"tend to hold\" is vague; say \"must hold\".\n- Federated/LDAP explanations repeat across Identifier Assignment,\n  Soft-delete behavior, Federated Users, End User, and Security Impact;\n  consolidate.\n- :1260-1264 refers to unmerged \"earlier 2026.2 patches\" adding\n  `local_user.deleted`; remove if WIP only.\n\n## Context for reviewers\n\n- `create_federated_user` mints SHA-256 via `generate_public_ID`\n  (shadow_backends/sql.py:40); mapped-LDAP `id_mapping` mints via\n  `id_generator_api.generate_public_ID` (mapping_backends/sql.py:74-79).\n- `federated_user` unique on `(idp_id, protocol_id, unique_id)`\n  (sql_model.py:409).\n- `Project`: name String(64), `UNIQUE(domain_id, name)`, FKs on\n  `parent_id`/`domain_id` (resource/backends/sql_model.py:56-99).\n- `delete_user` today: driver delete + `delete_user_assignments` +\n  `delete_credentials_for_user` + `delete_id_mapping` + `Audit.deleted`\n  (identity/core.py:1394-1416), matching the spec\u0027s \"same as hard delete\".\n- Domain delete cascade shape matches Delete Operations :524-530.\n- Trust precedent: `deleted_at` only + `keystone-manage trust_flush`\n  (cmd/cli.py:972).\n- `Audit.deleted` listeners exist: revoke, application_credential, trust,\n  `_unset_default_project` (resource/core.py:936; identity/core.py:614-616).\n- Default domain id \u003d `CONF.identity.default_domain_id`\n  (cmd/bootstrap.py:81-92).\n- RST builds cleanly; template sections present; `doc/source/index.rst`\n  toctree entry placed correctly. No long lines or trailing whitespace.","commit_id":"99d57b5be538966b8b0972fbab21b26a6cde869e"},{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"2336bbd2ad0d02a52ba0de06fab8b17306a78c47","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"f6417565_983e25d4","updated":"2026-10-02 17:34:29.000000000","message":"just to give a more concrete case that I would like to see clearly addressed: you can have different identity backend drivers per domain, so what is the logic to apply for domains which use some external (non-sql based) driver? There are 100% CSPs using custom identity drivers and they would be broken with this spec silently","commit_id":"99d57b5be538966b8b0972fbab21b26a6cde869e"}],"specs/keystone/2026.2/soft-delete.rst":[{"author":{"_account_id":27900,"name":"Artem Goncharov","email":"artem.goncharov@gmail.com","username":"gtema"},"change_message_id":"f279cec028951effc7837b82edfae8c21e7a058f","unresolved":true,"context_lines":[{"line_number":98,"context_line":"    ALTER TABLE project ADD COLUMN deleted BOOLEAN DEFAULT FALSE;"},{"line_number":99,"context_line":"    ALTER TABLE project ADD COLUMN deleted_at DATETIME DEFAULT NULL;"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"**local_user table**::"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    ALTER TABLE local_user ADD COLUMN deleted BOOLEAN DEFAULT FALSE;"},{"line_number":104,"context_line":"    ALTER TABLE local_user ADD COLUMN deleted_at DATETIME DEFAULT NULL;"}],"source_content_type":"text/x-rst","patch_set":4,"id":"e885c202_674d154e","line":101,"updated":"2026-08-14 15:27:57.000000000","message":"I think we should better have it on the main \"user\" table and not the local_user, otherwise we also need it on nonlocal_user, federated_user","commit_id":"2e1e857fc7f013c747ce060e27f35f72251e6385"},{"author":{"_account_id":34120,"name":"Andre Aranha","display_name":"Andre Aranha","email":"afariasa@redhat.com","username":"afariasa"},"change_message_id":"ae62074a0a0be3b3d02f38bcd09771c6b854d6e3","unresolved":true,"context_lines":[{"line_number":171,"context_line":"        raise Conflict(\"ID already used\")"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    # For auto-generated ID"},{"line_number":174,"context_line":"    while True:"},{"line_number":175,"context_line":"        new_id \u003d uuid.uuid4().hex"},{"line_number":176,"context_line":"        existing \u003d SELECT id FROM project WHERE id \u003d new_id;  # No deleted filter"},{"line_number":177,"context_line":"        if not existing:"}],"source_content_type":"text/x-rst","patch_set":4,"id":"5cbc2f45_59a575bd","line":174,"updated":"2026-08-19 12:56:42.000000000","message":"Do we need this while True here?\nShouldn\u0027t we just try to insert directly? As this will be rare to happen, we could just send a error message and ask to try to create the resource again, or just limit it to try: \u0027insert the uuid\u0027 except: try \u0027insert a new uuid again\u0027 except: failure, user should try again.\nAlso, this should be rare, but many things could happen between the select and then the insert.","commit_id":"2e1e857fc7f013c747ce060e27f35f72251e6385"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"461b4c62fe0ed07df18f0d3e20916ba2e4c13469","unresolved":true,"context_lines":[{"line_number":171,"context_line":"        raise Conflict(\"ID already used\")"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    # For auto-generated ID"},{"line_number":174,"context_line":"    while True:"},{"line_number":175,"context_line":"        new_id \u003d uuid.uuid4().hex"},{"line_number":176,"context_line":"        existing \u003d SELECT id FROM project WHERE id \u003d new_id;  # No deleted filter"},{"line_number":177,"context_line":"        if not existing:"}],"source_content_type":"text/x-rst","patch_set":4,"id":"0cd96a1c_832457f0","line":174,"in_reply_to":"5cbc2f45_59a575bd","updated":"2026-09-17 18:54:22.000000000","message":"This is just psuedo code really,  This cmoment is better suited for the implementation patches.  But while True here just loops until we find an ID that is unused.  It might even be what\u0027s already there.","commit_id":"2e1e857fc7f013c747ce060e27f35f72251e6385"},{"author":{"_account_id":34120,"name":"Andre Aranha","display_name":"Andre Aranha","email":"afariasa@redhat.com","username":"afariasa"},"change_message_id":"ae62074a0a0be3b3d02f38bcd09771c6b854d6e3","unresolved":true,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"**Manual purge via keystone-manage**::"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    keystone-manage resource purge --days 90"},{"line_number":188,"context_line":"    keystone-manage identity purge --days 90"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"**Automatic purge via periodic task**::"}],"source_content_type":"text/x-rst","patch_set":4,"id":"2324954e_82ce7b8e","line":187,"updated":"2026-08-19 12:56:42.000000000","message":"Should we throw a warning about purging keystone resources, that this should be done to the others databases as well, since purging keystone and not the others, could lead to problems previously mentioned?","commit_id":"2e1e857fc7f013c747ce060e27f35f72251e6385"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"461b4c62fe0ed07df18f0d3e20916ba2e4c13469","unresolved":true,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"**Manual purge via keystone-manage**::"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    keystone-manage resource purge --days 90"},{"line_number":188,"context_line":"    keystone-manage identity purge --days 90"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"**Automatic purge via periodic task**::"}],"source_content_type":"text/x-rst","patch_set":4,"id":"099f108a_3c1be053","line":187,"in_reply_to":"2324954e_82ce7b8e","updated":"2026-09-17 18:54:22.000000000","message":"This command is an administrative function to handle what is in the keystone DB.  We should document perhaps the possible implications, but I think a warning is unnecessary.  We don\u0027t have similar warnings on other cleanup scripts - for example, the script to clean up barbican resources.\n\nBut I have no objection if keystone cores think this necessary.","commit_id":"2e1e857fc7f013c747ce060e27f35f72251e6385"},{"author":{"_account_id":34120,"name":"Andre Aranha","display_name":"Andre Aranha","email":"afariasa@redhat.com","username":"afariasa"},"change_message_id":"ae62074a0a0be3b3d02f38bcd09771c6b854d6e3","unresolved":true,"context_lines":[{"line_number":260,"context_line":""},{"line_number":261,"context_line":"**Positive Security Impacts**"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"* **Prevents ID reuse attacks**: Attackers cannot recreate a resource with"},{"line_number":264,"context_line":"  a previously used ID to gain access to orphaned resources in other services."},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"* **Audit log integrity**: Historical audit entries continue to reference"}],"source_content_type":"text/x-rst","patch_set":4,"id":"0409e34b_3c3d3dcd","line":263,"updated":"2026-08-19 12:56:42.000000000","message":"Depends on how they use the purge mechanism","commit_id":"2e1e857fc7f013c747ce060e27f35f72251e6385"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"461b4c62fe0ed07df18f0d3e20916ba2e4c13469","unresolved":true,"context_lines":[{"line_number":260,"context_line":""},{"line_number":261,"context_line":"**Positive Security Impacts**"},{"line_number":262,"context_line":""},{"line_number":263,"context_line":"* **Prevents ID reuse attacks**: Attackers cannot recreate a resource with"},{"line_number":264,"context_line":"  a previously used ID to gain access to orphaned resources in other services."},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"* **Audit log integrity**: Historical audit entries continue to reference"}],"source_content_type":"text/x-rst","patch_set":4,"id":"fe4c3f9c_1d549f66","line":263,"in_reply_to":"0409e34b_3c3d3dcd","updated":"2026-09-17 18:54:22.000000000","message":"sure.  There is always that caveat.  Admins have to balance keeping the DB a manageable size vs. preventing uuid reuse.","commit_id":"2e1e857fc7f013c747ce060e27f35f72251e6385"},{"author":{"_account_id":34120,"name":"Andre Aranha","display_name":"Andre Aranha","email":"afariasa@redhat.com","username":"afariasa"},"change_message_id":"ae62074a0a0be3b3d02f38bcd09771c6b854d6e3","unresolved":true,"context_lines":[{"line_number":263,"context_line":"* **Prevents ID reuse attacks**: Attackers cannot recreate a resource with"},{"line_number":264,"context_line":"  a previously used ID to gain access to orphaned resources in other services."},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"* **Audit log integrity**: Historical audit entries continue to reference"},{"line_number":267,"context_line":"  the correct resource, even if it has been deleted."},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"* **Recovery capability**: Accidentally deleted resources can potentially be"}],"source_content_type":"text/x-rst","patch_set":4,"id":"78a3965e_dfcffc91","line":266,"updated":"2026-08-19 12:56:42.000000000","message":"Same issue as mentioned before.","commit_id":"2e1e857fc7f013c747ce060e27f35f72251e6385"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"461b4c62fe0ed07df18f0d3e20916ba2e4c13469","unresolved":true,"context_lines":[{"line_number":263,"context_line":"* **Prevents ID reuse attacks**: Attackers cannot recreate a resource with"},{"line_number":264,"context_line":"  a previously used ID to gain access to orphaned resources in other services."},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"* **Audit log integrity**: Historical audit entries continue to reference"},{"line_number":267,"context_line":"  the correct resource, even if it has been deleted."},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"* **Recovery capability**: Accidentally deleted resources can potentially be"}],"source_content_type":"text/x-rst","patch_set":4,"id":"57aeed45_f814d173","line":266,"in_reply_to":"78a3965e_dfcffc91","updated":"2026-09-17 18:54:22.000000000","message":"same as above.","commit_id":"2e1e857fc7f013c747ce060e27f35f72251e6385"},{"author":{"_account_id":34120,"name":"Andre Aranha","display_name":"Andre Aranha","email":"afariasa@redhat.com","username":"afariasa"},"change_message_id":"ae62074a0a0be3b3d02f38bcd09771c6b854d6e3","unresolved":true,"context_lines":[{"line_number":320,"context_line":"Soft-deleted resources remain in the database until purged:"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"* Default 90-day retention means ~3 months of deleted resources"},{"line_number":323,"context_line":"* Large deployments may see 10-20% database size increase"},{"line_number":324,"context_line":"* Mitigated by regular purging (manual or automatic)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"Other Deployer Impact"}],"source_content_type":"text/x-rst","patch_set":4,"id":"97d4f7ab_eb0c6a4c","line":323,"updated":"2026-08-19 12:56:42.000000000","message":"Where do these 10-20% numbers come from? Do we have some statistics on users operations?","commit_id":"2e1e857fc7f013c747ce060e27f35f72251e6385"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"461b4c62fe0ed07df18f0d3e20916ba2e4c13469","unresolved":true,"context_lines":[{"line_number":320,"context_line":"Soft-deleted resources remain in the database until purged:"},{"line_number":321,"context_line":""},{"line_number":322,"context_line":"* Default 90-day retention means ~3 months of deleted resources"},{"line_number":323,"context_line":"* Large deployments may see 10-20% database size increase"},{"line_number":324,"context_line":"* Mitigated by regular purging (manual or automatic)"},{"line_number":325,"context_line":""},{"line_number":326,"context_line":"Other Deployer Impact"}],"source_content_type":"text/x-rst","patch_set":4,"id":"84ab5686_b85980d9","line":323,"in_reply_to":"97d4f7ab_eb0c6a4c","updated":"2026-09-17 18:54:22.000000000","message":"Yeah , thats probably a number made up by AI to sound more impressive.  I\u0027ll revise this just to say that the DB size will be bigger.","commit_id":"2e1e857fc7f013c747ce060e27f35f72251e6385"},{"author":{"_account_id":34120,"name":"Andre Aranha","display_name":"Andre Aranha","email":"afariasa@redhat.com","username":"afariasa"},"change_message_id":"c085d50420d94f3d8be427fb23475dc3c2004518","unresolved":true,"context_lines":[{"line_number":408,"context_line":"        new_id \u003d uuid.uuid4().hex"},{"line_number":409,"context_line":"        existing \u003d SELECT id FROM project WHERE id \u003d new_id"},{"line_number":410,"context_line":"        if not existing:"},{"line_number":411,"context_line":"            existing \u003d SELECT id FROM user WHERE id \u003d new_id"},{"line_number":412,"context_line":"        if not existing:"},{"line_number":413,"context_line":"            break"},{"line_number":414,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"1496cad5_7ececf59","line":411,"updated":"2026-09-18 10:44:32.000000000","message":"I don\u0027t understand what this if is doing; If the new_id doesn\u0027t exist then we just try to select it again?","commit_id":"119e0eef701a37f7a78289a965df8d22d856a5b6"},{"author":{"_account_id":34120,"name":"Andre Aranha","display_name":"Andre Aranha","email":"afariasa@redhat.com","username":"afariasa"},"change_message_id":"155760f769e90be4809120e5de5184077b9d1948","unresolved":false,"context_lines":[{"line_number":408,"context_line":"        new_id \u003d uuid.uuid4().hex"},{"line_number":409,"context_line":"        existing \u003d SELECT id FROM project WHERE id \u003d new_id"},{"line_number":410,"context_line":"        if not existing:"},{"line_number":411,"context_line":"            existing \u003d SELECT id FROM user WHERE id \u003d new_id"},{"line_number":412,"context_line":"        if not existing:"},{"line_number":413,"context_line":"            break"},{"line_number":414,"context_line":""}],"source_content_type":"text/x-rst","patch_set":7,"id":"90852aec_a011caf2","line":411,"in_reply_to":"1496cad5_7ececf59","updated":"2026-09-18 14:57:39.000000000","message":"Done","commit_id":"119e0eef701a37f7a78289a965df8d22d856a5b6"},{"author":{"_account_id":34120,"name":"Andre Aranha","display_name":"Andre Aranha","email":"afariasa@redhat.com","username":"afariasa"},"change_message_id":"c085d50420d94f3d8be427fb23475dc3c2004518","unresolved":true,"context_lines":[{"line_number":410,"context_line":"        if not existing:"},{"line_number":411,"context_line":"            existing \u003d SELECT id FROM user WHERE id \u003d new_id"},{"line_number":412,"context_line":"        if not existing:"},{"line_number":413,"context_line":"            break"},{"line_number":414,"context_line":""},{"line_number":415,"context_line":"``check_id_uniqueness()`` must treat any ``user`` row with ``deleted\u003dTRUE``"},{"line_number":416,"context_line":"as blocking ID reuse, regardless of whether the user has ``local_user``,"}],"source_content_type":"text/x-rst","patch_set":7,"id":"e576cd1f_2dc6e3ea","line":413,"updated":"2026-09-18 10:44:32.000000000","message":"If the second selection, without a generating a new id, doesn\u0027t exist then we break the while?\nMaybe we should keep like on the previous patch?\nif not existing:\n    break\notherwise go back to the start of the loop and generate a new id.","commit_id":"119e0eef701a37f7a78289a965df8d22d856a5b6"},{"author":{"_account_id":34120,"name":"Andre Aranha","display_name":"Andre Aranha","email":"afariasa@redhat.com","username":"afariasa"},"change_message_id":"155760f769e90be4809120e5de5184077b9d1948","unresolved":false,"context_lines":[{"line_number":410,"context_line":"        if not existing:"},{"line_number":411,"context_line":"            existing \u003d SELECT id FROM user WHERE id \u003d new_id"},{"line_number":412,"context_line":"        if not existing:"},{"line_number":413,"context_line":"            break"},{"line_number":414,"context_line":""},{"line_number":415,"context_line":"``check_id_uniqueness()`` must treat any ``user`` row with ``deleted\u003dTRUE``"},{"line_number":416,"context_line":"as blocking ID reuse, regardless of whether the user has ``local_user``,"}],"source_content_type":"text/x-rst","patch_set":7,"id":"a952f6b2_907fbb4c","line":413,"in_reply_to":"e576cd1f_2dc6e3ea","updated":"2026-09-18 14:57:39.000000000","message":"Done","commit_id":"119e0eef701a37f7a78289a965df8d22d856a5b6"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"1607a3327209d4631b66ce006e5cc30fcdc31862","unresolved":true,"context_lines":[{"line_number":551,"context_line":"Security Impact"},{"line_number":552,"context_line":"\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d\u003d"},{"line_number":553,"context_line":""},{"line_number":554,"context_line":"**Positive Security Impacts**"},{"line_number":555,"context_line":""},{"line_number":556,"context_line":"* **Prevents ID reuse attacks**: Attackers cannot recreate a resource with"},{"line_number":557,"context_line":"  a previously used ID to gain access to orphaned resources in other services."}],"source_content_type":"text/x-rst","patch_set":7,"id":"b65ff287_0b83e470","line":554,"updated":"2026-09-18 10:08:04.000000000","message":"I think this needs to be very expilicit: Change the Security Impact claim that soft delete “prevents ID reuse attacks” — that is only true until purge","commit_id":"119e0eef701a37f7a78289a965df8d22d856a5b6"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"1607a3327209d4631b66ce006e5cc30fcdc31862","unresolved":true,"context_lines":[{"line_number":562,"context_line":"* **Recovery capability**: Accidentally deleted resources can potentially be"},{"line_number":563,"context_line":"  recovered (though this spec does not implement recovery UI/API)."},{"line_number":564,"context_line":""},{"line_number":565,"context_line":"**Negative Security Impacts**"},{"line_number":566,"context_line":""},{"line_number":567,"context_line":"* **Increased database size**: Soft-deleted resources remain in the database"},{"line_number":568,"context_line":"  until purged, increasing storage requirements."}],"source_content_type":"text/x-rst","patch_set":7,"id":"910311b7_33df44ef","line":565,"updated":"2026-09-18 10:08:04.000000000","message":"purge section should say explicitly that purge re-enables ID reuse, including deliberate recreate via explicit IDs, and that operators must treat purge as a security-sensitive step (dry-run + confirm no orphans, or never purge if they cannot).","commit_id":"119e0eef701a37f7a78289a965df8d22d856a5b6"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"1607a3327209d4631b66ce006e5cc30fcdc31862","unresolved":true,"context_lines":[{"line_number":565,"context_line":"**Negative Security Impacts**"},{"line_number":566,"context_line":""},{"line_number":567,"context_line":"* **Increased database size**: Soft-deleted resources remain in the database"},{"line_number":568,"context_line":"  until purged, increasing storage requirements."},{"line_number":569,"context_line":""},{"line_number":570,"context_line":"* **Potential for enumeration**: An attacker with database access could"},{"line_number":571,"context_line":"  enumerate soft-deleted resources. However, database access already provides"}],"source_content_type":"text/x-rst","patch_set":7,"id":"36d89b6e_74d09201","line":568,"updated":"2026-09-18 10:08:04.000000000","message":"after that you are back to today’s model, just with a delayed fuse — and worse once explicit IDs make deliberate reuse easy","commit_id":"119e0eef701a37f7a78289a965df8d22d856a5b6"}]}
