Feature/batch passport revocation#181
Open
akinboyewaSamson wants to merge 4 commits into
Open
Conversation
… revoking, and expiring passports
…ebhooks, and audit logging
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.
closes #110
Description
This PR introduces a batch processing route for passport revocations ($N$ serial deletion tasks spikes round-trip overhead. This batch approach executes atomic updates per passport ID while collecting detailed metric classifications.
POST /api/protocol/passport/revoke-batch). When managing massive agent fleets (e.g., decommission cycles), executing singleWhat was Implemented
src/api/passportBatch.tsto handle isolated array mutations securely.400status.400response payload:{ error: 'batch_too_large', max: 50 }.State & Processing Pipeline**:
'revoked', logs the action dynamically, appends a dedicated structured audit tracking log, and fires off a sequentialpassport.revokedwebhook event.notFoundsummary catalog.alreadyRevokedto prevent duplicate writes or double-emitted event triggers.API Specification
Route
POST /api/protocol/passport/revoke-batchRequest Payload Structure
{ "passportIds": ["pp_aaa", "pp_bbb", "pp_ccc"], "reason": "fleet_decommission" }Response Payload Structure (Success
200){ "ok": true, "revoked": ["pp_aaa"], "notFound": ["pp_bbb"], "alreadyRevoked": ["pp_ccc"], "total": 1 }Acceptance Criteria Checklist
revoked: [2],notFound: [1]).400 Bad Requestwith structured error keys).alreadyRevokedwithout duplicated execution).passport.revokedhook payload).