Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoreDocument & Service and VerificationMethod are now in the document and verification modules respectively #1104

Merged
merged 40 commits into from
Jan 19, 2023

Conversation

olivereanderson
Copy link
Contributor

Description of change

This PR splits the identity_did crate as follows:

  • The did module is moved into a new dedicated crate.
  • The revocation bitmap functionality is moved to identity_credential (since it mainly concerns credentials).
  • The verification module is moved to a new crate identity_verification that we expect to grow over time and perhaps take ownership over some of the things in identity_core::crypto .

Motivation

The identity_did crate was getting large and hard to maintain. By splitting functionality into smaller more dedicated crates we encourage more modular code which is easier to understand (one of the advantages listed in the prefer small crates pattern).

Furthermore since we have roughly speaking one (enum) error per module in the main identity_iota crate, we obtain more errors by having more crates (as these correspond to modules at that level) which then lowers the amount of variants in each error enum and makes it easier for users to reason about what can fail.

What not to expect

I did not spend much time on improving on the errors/error variants that were split out (and some may in fact be less helpful now) . The reason is that I expect there to be quite some more refactoring to be done before the next release, and it is better not to waste time making errors for code that is likely to change significantly in the near future.

Links to any relevant issues

Sub-task of #1103 .

Type of change

Add an x to the boxes that are relevant to your changes.

  • Bug fix (a non-breaking change which fixes an issue)
  • Enhancement (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Fix

How the change has been tested

Describe the tests that you ran to verify your changes.
Make sure to provide instructions for the maintainer as well as any relevant configurations.

Change checklist

Add an x to the boxes that are relevant to your changes.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@olivereanderson olivereanderson self-assigned this Jan 18, 2023
@olivereanderson olivereanderson added Breaking change A change to the API that requires a major release. Part of "Changed" section in changelog Rust Related to the core Rust code. Becomes part of the Rust changelog. labels Jan 18, 2023
@olivereanderson olivereanderson added this to the v0.7 Features milestone Jan 18, 2023
Copy link
Contributor

@PhilippGackstatter PhilippGackstatter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Couple of comments on the workspace feature and other minor stuff.

examples/0_basic/7_revoke_vc.rs Outdated Show resolved Hide resolved
identity_agent/Cargo.toml Outdated Show resolved Hide resolved
identity_did/Cargo.toml Outdated Show resolved Hide resolved
identity_did/src/error.rs Outdated Show resolved Hide resolved
identity_document/Cargo.toml Outdated Show resolved Hide resolved
identity_resolver/Cargo.toml Outdated Show resolved Hide resolved
identity_verification/Cargo.toml Outdated Show resolved Hide resolved
identity_verification/README.md Outdated Show resolved Hide resolved
identity_verification/Cargo.toml Outdated Show resolved Hide resolved
identity_verification/src/error.rs Outdated Show resolved Hide resolved
Oliver E. Anderson and others added 13 commits January 19, 2023 15:00
Co-authored-by: Philipp Gackstatter <philipp.gackstatter@iota.org>
Co-authored-by: Philipp Gackstatter <philipp.gackstatter@iota.org>
Co-authored-by: Philipp Gackstatter <philipp.gackstatter@iota.org>
Co-authored-by: Philipp Gackstatter <philipp.gackstatter@iota.org>
Co-authored-by: Philipp Gackstatter <philipp.gackstatter@iota.org>
Co-authored-by: Philipp Gackstatter <philipp.gackstatter@iota.org>
Co-authored-by: Philipp Gackstatter <philipp.gackstatter@iota.org>
Co-authored-by: Philipp Gackstatter <philipp.gackstatter@iota.org>
Co-authored-by: Philipp Gackstatter <philipp.gackstatter@iota.org>
Co-authored-by: Philipp Gackstatter <philipp.gackstatter@iota.org>
Co-authored-by: Philipp Gackstatter <philipp.gackstatter@iota.org>
@olivereanderson olivereanderson merged commit 6e3d899 into main Jan 19, 2023
@olivereanderson olivereanderson deleted the chore/split-did-crate branch January 19, 2023 17:00
@olivereanderson olivereanderson changed the title Split identity_did. CoreDocument &Service and VerificaitonMethod are now in the document and verification modules respectively Feb 15, 2023
@eike-hass eike-hass changed the title CoreDocument &Service and VerificaitonMethod are now in the document and verification modules respectively CoreDocument & Service and VerificaitonMethod are now in the document and verification modules respectively Feb 15, 2023
@eike-hass eike-hass changed the title CoreDocument & Service and VerificaitonMethod are now in the document and verification modules respectively CoreDocument & Service and VerificationMethod are now in the document and verification modules respectively Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking change A change to the API that requires a major release. Part of "Changed" section in changelog Rust Related to the core Rust code. Becomes part of the Rust changelog.
Projects
Development

Successfully merging this pull request may close these issues.

2 participants