-
Notifications
You must be signed in to change notification settings - Fork 5
Adapt Identity Create / Deanonymize and Identity Proofs #745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements email confirmation functionality for identity creation and deanonymization, requiring Ident-type identities to have a confirmed email address before being created or deanonymized. The changes introduce new APIs for confirming and verifying emails, adapt the IdentityProof block structure to include email confirmation data signed by the mint, and add persistence support. A dev mode flag allows bypassing mandatory email confirmations for easier testing.
Key changes:
- New email confirmation/verification API endpoints (
confirm_email,verify_email,get_email_confirmations) - Modified identity creation and deanonymization flows to validate email confirmations for Ident users
- Refactored IdentityProof block data to use
SignedIdentityProofandSignedEmailIdentityDatainstead of the oldIdentityProofStampapproach - Added persistence layer support for storing and retrieving email confirmations
Reviewed Changes
Copilot reviewed 29 out of 29 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/bcr-ebill-wasm/src/lib.rs | Added disable_mandatory_email_confirmations config flag for dev mode |
| crates/bcr-ebill-wasm/src/error.rs | Added new error type NoConfirmedEmailForIdentIdentity |
| crates/bcr-ebill-wasm/src/data/identity.rs | Added IdentityEmailConfirmationWeb data structure for WASM API |
| crates/bcr-ebill-wasm/src/context.rs | Updated service initialization to pass email client and notification store |
| crates/bcr-ebill-wasm/src/api/identity.rs | Added three new API methods for email confirmation workflow |
| crates/bcr-ebill-wasm/main.js | Updated test harness to use window-scoped APIs and added email confirmation test functions |
| crates/bcr-ebill-wasm/index.html | Added UI elements for testing email confirmation features |
| crates/bcr-ebill-transport/src/test_utils.rs | Updated mock and added helper for signed identity proof testing |
| crates/bcr-ebill-transport/src/handler/mod.rs | Added mock methods for email confirmation persistence |
| crates/bcr-ebill-transport/src/handler/identity_chain_event_processor.rs | Implemented handling of IdentityProof blocks to persist email confirmations |
| crates/bcr-ebill-transport/src/handler/company_chain_event_processor.rs | Updated test to use new identity proof structure |
| crates/bcr-ebill-persistence/src/tests/mod.rs | Added test helper for signed identity proof |
| crates/bcr-ebill-persistence/src/lib.rs | Added PublicKeyDoesNotMatch error variant |
| crates/bcr-ebill-persistence/src/identity.rs | Added trait methods for email confirmation persistence |
| crates/bcr-ebill-persistence/src/db/identity.rs | Implemented email confirmation storage and retrieval with validation |
| crates/bcr-ebill-persistence/src/db/email_notification.rs | Changed from create to upsert for email notification preferences |
| crates/bcr-ebill-core/src/protocol/tests/mod.rs | Added test helper for signed identity proof |
| crates/bcr-ebill-core/src/protocol/mod.rs | Updated exports to new identity proof types |
| crates/bcr-ebill-core/src/protocol/mint/mod.rs | Removed obsolete MintSignature struct |
| crates/bcr-ebill-core/src/protocol/blockchain/identity/mod.rs | Updated IdentityProofBlockData structure to use new types |
| crates/bcr-ebill-core/src/protocol/blockchain/company/mod.rs | Updated CompanyIdentityProofBlockData structure to use new types |
| crates/bcr-ebill-core/src/protocol/base/identity_proof.rs | Complete rewrite to implement new signing/verification model |
| crates/bcr-ebill-core/src/application/mod.rs | Removed old identity_proof module and added new validation error |
| crates/bcr-ebill-core/src/application/identity_proof.rs | File deleted (old implementation removed) |
| crates/bcr-ebill-api/src/tests/mod.rs | Added mock methods and test helper for email confirmations |
| crates/bcr-ebill-api/src/service/identity_service.rs | Implemented email confirmation validation in create/deanonymize flows and added new API methods |
| crates/bcr-ebill-api/src/lib.rs | Added disable_mandatory_email_confirmations field to DevModeConfig |
| crates/bcr-ebill-api/src/external/email.rs | Refactored email client to use new signing model and updated API endpoints |
| CHANGELOG.md | Documented the changes |
4d8e426 to
208e626
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
📝 Description
window, so requests can be made even if init failsRelates to #730
✅ Checklist
Please ensure the following tasks are completed before requesting a review:
cargo fmt.cargo clippy.🚀 Changes Made
See above.
💡 How to Test
Please provide clear instructions on how reviewers can test your changes:
🤝 Related Issues
List any related issues, pull requests, or discussions:
📋 Review Guidelines
Please focus on the following while reviewing: