fix: accept HIGH security level keys for profile updates#762
fix: accept HIGH security level keys for profile updates#762thepastaclaw wants to merge 1 commit intodashpay:v1.0-devfrom
Conversation
The profile update code only accepted CRITICAL level authentication keys, but Platform's default document security level requirement is HIGH. This caused 'missing authentication key' errors for identities imported from wallets, which typically have HIGH level keys. Accept both CRITICAL and HIGH security level keys, consistent with how contact_requests.rs already handles this. Fixes dashpay#760
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe identity signing key selection logic in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
claw please find and quote documents (eg. DIP) defining which keys we should use |
Security Level Requirements — DIP-0011 + Platform Contract DefaultsDIP-0011 (Identities) — Key Security LevelsDIP-0011 § Keys defines the security levels and their intended use:
DIP-0011 also states:
Platform Default Security LevelIn the Platform codebase, the document type schema parser sets a default when no // packages/rs-dpp/src/data_contract/document_type/class_methods/try_from_schema/v0/mod.rs
let security_level_requirement = schema
.get_optional_integer::<u8>(property_names::SECURITY_LEVEL_REQUIREMENT)
.map_err(consensus_or_protocol_value_error)?
.map(SecurityLevel::try_from)
.transpose()?
.unwrap_or(SecurityLevel::HIGH); // <-- default is HIGHDashPay Contract — Profile Document TypeThe DashPay contract schema ( This means ConsistencyThis PR aligns HashSet::from([SecurityLevel::CRITICAL, SecurityLevel::HIGH]), |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Issue
Closes #760 — Editing a profile with a wallet-imported identity fails with "This identity is missing an authentication key required for this operation."
Root Cause
update_profile()insrc/backend_task/dashpay/profile.rsonly looked for authentication keys atSecurityLevel::CRITICAL, but Platform's default document security level requirement isHIGH. Wallet-imported identities typically haveHIGH-level keys, notCRITICAL, so the key lookup failed.Fix
Accept both
CRITICALandHIGHsecurity levels when searching for a signing key inupdate_profile(), consistent with howcontact_requests.rsalready handles authentication key lookup (line 639).Testing
cargo check,cargo clippy— cleanSummary by CodeRabbit