Skip to content

Conversation

@zupzup
Copy link
Collaborator

@zupzup zupzup commented Nov 19, 2025

📝 Description

  • Small fixes in the email client
  • Add config flag to disable mandatory email confirmation for ident users (for quick local and dev testing)
  • Add APIs to confirm and verify email and to get existing email confirmations (currently only one, since we use the default mint only)
  • Adapt IdentityProof block data
  • Adapt IdentityProof data model and move to protocol
  • Set APIs in test harness on window, so requests can be made even if init fails
  • Add persistence for email confirmations
  • Fix setting email notification link to upsert instead of insert
  • Implement check that Ident identities can only be created (or deanonymized) if the given email is confirmed
    • If the above mentioned config flag is enabled - we create a self-signed email confirmation instead

Relates to #730


✅ Checklist

Please ensure the following tasks are completed before requesting a review:

  • My code adheres to the coding guidelines of this project.
  • I have run cargo fmt.
  • I have run cargo clippy.
  • I have added or updated tests (if applicable).
  • All CI/CD steps were successful.
  • I have updated the documentation (if applicable).
  • I have checked that there are no console errors or warnings.
  • I have verified that the application builds without errors.
  • I've described the changes made to the API. (modification, addition, deletion).

🚀 Changes Made

See above.


💡 How to Test

Please provide clear instructions on how reviewers can test your changes:

  1. cargo test
  2. Try to create an identity without and with confirmed email
  3. Try to deanonymize with and without confirmed email
  4. Important: you have to enable/disable the config flag to disable mandatory email confirmation

🤝 Related Issues

List any related issues, pull requests, or discussions:


📋 Review Guidelines

Please focus on the following while reviewing:

  • Does the code follow the repository's contribution guidelines?
  • Are there any potential bugs or performance issues?
  • Are there any typos or grammatical errors in the code or comments?

@zupzup zupzup self-assigned this Nov 19, 2025
Copilot finished reviewing on behalf of zupzup November 19, 2025 15:29
Copy link
Contributor

Copilot AI left a 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 SignedIdentityProof and SignedEmailIdentityData instead of the old IdentityProofStamp approach
  • 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

@zupzup zupzup force-pushed the 730-create-identity-adaptions branch from 4d8e426 to 208e626 Compare November 19, 2025 15:38
@codecov
Copy link

codecov bot commented Nov 19, 2025

@zupzup zupzup merged commit b6fb107 into master Nov 20, 2025
6 of 7 checks passed
@zupzup zupzup deleted the 730-create-identity-adaptions branch November 20, 2025 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants