Repository navigation
feat(SC-010): did:stellar string validation, owner key revocation, wire dead test suite - #1713
Open
esthertitilayo-dev wants to merge 1 commit into
Conversation
…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
|
@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! 🚀 |
|
@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
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 #1631
Summary
contracts/did_registry/src/types.rs(ContributorProof,DIDDocument,DataKey) andcontracts/did_registry/src/verification.rs— puredid:stellarstring parsing/formatting (is_valid_did_string,parse_did_string,did_to_string) plus the sharedis_owner_or_controllerauthorization predicate now used byupdate/add_contributor_proof.register_string/resolve_stringaccept only canonicaldid:stellar:<64 hex>and fail with the typedDIDError::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).revoke_verification_key(owner-only, clears the Ed25519 key, rebinding allowed) complements the existing owner-onlyset_verification_key.bind_github,bind_social,set_verification_key,revoke_verification_key,add_contributor_proof) and that none of the attempts mutate the document.src/test.rs(19 tests) was never compiled; renamed the inlinemod testinlib.rstomod testsand declared#[cfg(test)] mod test;, enabling all 19 previously dead tests.verification.rsadds 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 inlinetest_did_registry_flow).cargo check -p did_registry— no warnings.rustfmt --checkclean onlib.rs,types.rs,verification.rs,test.rs.