feat(certificate): batch export certificates for ZIP download - #517
Merged
LaGodxy merged 4 commits intoJun 9, 2026
Merged
Conversation
- Add BatchExportEntry type with certificate, compliance, revocation, and filename fields - Add batch_export_certificates function (admin-only, max 100 certs) - Emits BatchCompleted event with succeeded/failed counts - Add 5 tests covering happy path, missing certs, revocation metadata, empty list, and non-admin access
|
@blessingernest54 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
- Add OptionalCompliance/OptionalRevocation wrapper enums to replace Option<ComplianceRecord>/Option<RevocationRecord> in BatchExportEntry (Soroban #[contracttype] does not support Option<CustomType>) - Remove invalid 'use soroban_sdk::format' import (not exported in v22) - Use String::from_str for filename instead of format! macro - Remove .unwrap() calls on Soroban client Vec return values in tests - Fix test assertion to use enum variant match instead of .is_some()
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 #398
Description
Allow administrators to download multiple certificates as a ZIP file.
Changes
types.rs: AddedBatchExportEntrystruct bundling certificate + compliance + revocation metadata + suggested filenamelib.rs: Addedbatch_export_certificates(section 14) — admin-only, accepts up to 100 cert IDs, returnsVec<BatchExportEntry>, emitsBatchCompletedeventtest.rs: 5 tests covering happy path, missing cert skipping, revocation metadata, empty list error, and non-admin rejectionAcceptance Criteria
batch_export_certificatesreturns all requested certs in one callfilenamefield for client-side ZIP assembly; cert_id available for deduplicationMAX_BATCH_SIZE = 100capNotes
ZIP generation is an off-chain concern; the contract returns structured data that the admin client packages into a ZIP archive.