Skip to content

refactor: added admin specifications and resolved key validation issue#65

Merged
aguilar1x merged 2 commits into
devfrom
audit/fix-did-spec-admin-a2
Jun 20, 2026
Merged

refactor: added admin specifications and resolved key validation issue#65
aguilar1x merged 2 commits into
devfrom
audit/fix-did-spec-admin-a2

Conversation

@aguilar1x

@aguilar1x aguilar1x commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Features

    • Allowed the same public key to be used across different DID relationship types (e.g., authentication and assertion_method simultaneously), while maintaining duplicate prevention within individual relationship lists.
  • Documentation

    • Documented contract admin role as a contract-level governance function with no authority over individual DID operations in v0.1.
    • Clarified admin responsibilities, authorization policies, and event lifecycle.

@almanax-ai

almanax-ai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Plan expired

Your subscription has expired. Please renew your subscription to continue using CI/CD integration and other features.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2843ef37-e446-490d-a38f-bd2949eae43d

📥 Commits

Reviewing files that changed from the base of the PR and between 7083ea5 and 5e383e3.

📒 Files selected for processing (3)
  • contracts/did-stellar-registry/src/contract.rs
  • contracts/did-stellar-registry/src/test.rs
  • docs/did-spec/did-stellar-v0.1.md
💤 Files with no reviewable changes (1)
  • contracts/did-stellar-registry/src/contract.rs

📝 Walkthrough

Walkthrough

Removes validate_keys_cross_duplicates from the DID Stellar registry contract so the same public key may appear in multiple relationship arrays; updates the test accordingly. Separately expands the DID Stellar v0.1 spec to document contract admin role, ABI operations, authorization policy, events, and immutability model.

Changes

Cross-relationship duplicate key validation removal

Layer / File(s) Summary
Remove cross-relationship key validation and update test
contracts/did-stellar-registry/src/contract.rs, contracts/did-stellar-registry/src/test.rs
validate_keys_cross_duplicates is deleted and its three call sites removed from validate_record. The test that expected a DuplicateKey panic for cross-relationship duplicate keys is replaced with test_same_key_across_relations_allowed, which asserts that the same key in both authentication and assertion_method is stored successfully with matching multibase values.

Contract admin documentation in DID spec

Layer / File(s) Summary
Spec: contract admin actors, ABI, authorization, events, security, and trust
docs/did-spec/did-stellar-v0.1.md
Adds "Contract admin" to the architecture actors table. Expands the Public ABI section with a contract admin operations table (constructor/init, propose/accept/get_admin). Updates the authorization policy with admin operation entries and a statement that contract admin is not a DID authorization override. Reworks the events list to typed names including ContractInitialized and AdminTransferred. Replaces the "Contract Immutability" subsection with "Contract Admin and Immutability" covering propose/accept workflow, pending proposal expiry, v0.1 limitations, and no WASM upgrade operation. Adds a trust-section bullet on admin's lack of v0.1 authority over DID records.

Possibly related PRs

  • ACTA-Team/contracts-acta#11: Introduced the validate_keys_cross_duplicates function and cross-relationship duplicate key enforcement that this PR removes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 A key may hop from auth to assert,
No longer caught, no longer hurt!
The cross-check rule has hopped away,
One key in many lists may stay.
And admin's role is written clear —
No DID control, have no fear! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title references two distinct changes: admin specifications and multikey validation. The file summaries show the PR includes admin documentation in the spec, contract validation logic removal, and test updates—matching both parts of the title.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch audit/fix-did-spec-admin-a2

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@aguilar1x aguilar1x merged commit ead3630 into dev Jun 20, 2026
4 checks passed
@aguilar1x aguilar1x changed the title refactor: added admin specifications and resolved multikey validation issue refactor: added admin specifications and resolved key validation issue Jun 20, 2026
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.

2 participants