broker: remove dead IdempotencyStore (post-issue-#72)#105
Merged
Conversation
Issue #72 / PR #96 deleted POST /v1/mint-aws-creds and the crates/agentkeys-broker-server/src/handlers/mint.rs handler, which was the only production consumer of IdempotencyStore. The store remained wired through boot.rs -> AppState but no live code path read or wrote through it. Removed: - crates/agentkeys-broker-server/src/storage/idempotency.rs (the store + tests). - pub mod / pub use lines in storage/mod.rs. - idempotency_store field on AppState (state.rs). - idempotency_store field on BootArtifacts + open() block + idempotency_path() helper in boot.rs. - Assignment in main.rs AppState constructor. - agentkeys_broker_idempotency_hits / _conflicts AtomicU64 counters and their /metrics array entries (no live path bumped them); test assertion for help/type-line count updated from 10 to 8. - IdempotencyStore::open_in_memory() boilerplate in six integration tests. - Idempotency-Key sub-section + bullet in docs/operator-runbook-stage7.md and docs/stage7-demo-and-verification.md (only the parts that documented the removed metric counters + dedup feature; other /v1/mint-aws-creds doc residue from PR #96 stays for a separate doc-cleanup PR). cargo build + cargo test -p agentkeys-broker-server + cargo clippy -p agentkeys-broker-server -- -D warnings all exit 0.
92e46ef to
230c18d
Compare
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
Issue #72 / PR #96 deleted
POST /v1/mint-aws-credsand thecrates/agentkeys-broker-server/src/handlers/mint.rshandler, which was the only production consumer ofIdempotencyStore. The store remained wired throughboot.rs → AppStatebut no live code path read or wrote through it.What landed
IdempotencyOutcome, the 4 unit tests).pub mod idempotency;+pub use idempotency::{IdempotencyOutcome, IdempotencyStore};from storage/mod.rs.idempotency_storefield + doc comment fromAppState(state.rs).idempotency_storefield fromBootArtifacts, theIdempotencyStore::open(...)block, theOk(BootArtifacts { … })assignment, and theidempotency_path()helper from boot.rs.idempotency_store: boot_artifacts.idempotency_store,from theAppStateconstructor in main.rs.idempotency_hits+idempotency_conflictsAtomicU64counters and their/metricsarray entries from metrics.rs; no live code path bumped them. Updated the help/type-line-count test assertion from 10 → 8.IdempotencyStore::open_in_memory()boilerplate in the six integration tests that constructedAppState: auth_wallet_flow.rs, email_flow.rs, grant_flow.rs, oauth2_flow.rs, oidc_flow.rs, wallet_flow.rs.Idempotency-Keysubsection + theagentkeys_broker_idempotency_hits_total / _conflicts_totalbullet from docs/operator-runbook-stage7.md and the## 12. Metrics + idempotencysection +### 12.2 Idempotency-Keysubsection from docs/stage7-demo-and-verification.md. TheBROKER_REQUEST_BODY_LIMIT_BYTESparagraph was preserved (it documents an unrelated router-level cap, not the Idempotency-Key feature).What did NOT land
The two remaining
Idempotency-Keymentions in operator-runbook-stage7.md:391 + line 407 are inside/v1/mint-aws-credsendpoint documentation that PR #96 already made stale (the endpoint itself was deleted). Cleaning those up is part of the broader/v1/mint-aws-creds-doc-residue cleanup, not specific toIdempotencyStore, and belongs to a separate follow-up PR.No
BROKER_IDEMPOTENCY_*env vars existed in env.rs (audit returned zero hits), so none to remove there.Verification
Post-edit audit confirms no
IdempotencyStore/idempotency_storereferences remain incrates/agentkeys-broker-server/src/orcrates/agentkeys-broker-server/tests/.Test plan
-D warnings