Skip to content

feat(SC-010): did:stellar string validation, owner key revocation, wire dead test suite - #1713

Open
esthertitilayo-dev wants to merge 1 commit into
StellarDevHub:mainfrom
esthertitilayo-dev:fix/1631-did-registry-validation
Open

esthertitilayo-dev wants to merge 1 commit into
StellarDevHub:mainfrom
esthertitilayo-dev:fix/1631-did-registry-validation

Conversation

@esthertitilayo-dev

Copy link
Copy Markdown
Contributor

Closes #1631

Summary

  • Spec key files split out: new contracts/did_registry/src/types.rs (ContributorProof, DIDDocument, DataKey) and contracts/did_registry/src/verification.rs — pure did:stellar string parsing/formatting (is_valid_did_string, parse_did_string, did_to_string) plus the shared is_owner_or_controller authorization predicate now used by update/add_contributor_proof.
  • AC — reject malformed DID strings: new string entry points:
    • register_string / resolve_string accept only canonical did:stellar:<64 hex> and fail with the typed DIDError::MalformedDID (error 1) on anything else (empty, wrong/uppercase/missing prefix, wrong method, 63/65-hex, non-hex payload, trailing suffix).
    • validate_did — non-panicking bool view for untrusted resolver input.
    • did_to_string — exact inverse formatter (lowercase hex canonical form).
  • AC — owner-only delegated signing keys: new revoke_verification_key (owner-only, clears the Ed25519 key, rebinding allowed) complements the existing owner-only set_verification_key.
  • AC — unauthorized key binding rejected: new test proves a non-owner is rejected from every binding operation (bind_github, bind_social, set_verification_key, revoke_verification_key, add_contributor_proof) and that none of the attempts mutate the document.
  • Bonus — wire the dead test suite: src/test.rs (19 tests) was never compiled; renamed the inline mod test in lib.rs to mod tests and declared #[cfg(test)] mod test;, enabling all 19 previously dead tests. verification.rs adds 5 unit tests, plus 4 new contract tests (string round-trip, malformed rejection matrix, unauthorized bindings, owner revocation).

Test plan

  • cargo test -p did_registry — 29 tests pass (was 1 before this PR: only the inline test_did_registry_flow).
  • cargo check -p did_registry — no warnings.
  • rustfmt --check clean on lib.rs, types.rs, verification.rs, test.rs.

…t suite (StellarDevHub#1631)

- Split spec key files: types.rs (ContributorProof, DIDDocument, DataKey)
  and verification.rs (pure did:stellar string parsing/formatting and the
  shared owner-or-controller authorization predicate)
- AC: reject malformed DID strings — new string entry points register_string
  and resolve_string accept only canonical 'did:stellar:<64 hex>' and fail
  with typed DIDError::MalformedDID (1); validate_did is a non-panicking
  view for resolver input; did_to_string is the exact inverse formatter
- AC: owner-only delegated key lifecycle — new revoke_verification_key
  (owner-only, clears and allows rebinding of the Ed25519 signing key)
  alongside the existing owner-only set_verification_key
- AC: unauthorized key binding attempts rejected — new tests prove a
  non-owner cannot bind github/social handles, set or revoke the
  verification key, or add contributor proofs, with no state mutation
- Wire the previously dead src/test.rs (19 tests) by renaming the inline
  lib.rs module to 'tests' and declaring 'mod test'; 4 new contract tests
  cover string round-trip, malformed rejection, unauthorized bindings,
  and owner revocation
@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@esthertitilayo-dev 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! 🚀

Learn more about application limits

@vercel

vercel Bot commented Oct 18, 2026

Copy link
Copy Markdown

@esthertitilayo-dev is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

[SC-010] Decentralized Identity (DID) Registry on Soroban with Key Delegation & Claims

1 participant