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

Bug: Migrated Identity resolution #1474

Merged

Conversation

UMR1352
Copy link
Contributor

@UMR1352 UMR1352 commented Dec 3, 2024

Description of change

  • Fixes a bug in the resolution of a migrated Identity and introduces a new feature that populates the alsoKnownAs property of the resolved DID Document.
  • Changed the type of the argument required to create a new Identity from raw bytes to IotaDocument.

Bug description

When resolving an Identity through its ObjectID foo a document with DID foo is resolved. If Identity foo is a migrated Identity from AliasOutput bar, DID bar will appear in the DID document's alsoKnownAs property.

When resolving a DID if foo is requested the resolver produces the same document obtaining by querying foo as an ObjectID but if DID bar is requested a DID Document with bar as DID and foo in alsoKnownAs is returned.

Schematically:

Identity { id: foo, legacy_id: bar } // Identity with ID foo that had been migrated from AliasOutput with ID bar

let identity_foo = client.get_identity(foo).await?;
assert_eq!(identity_foo.id(), foo);
assert!(identity_foo.also_known_as().contains(bar));

let did_doc = client.resolve_did(foo).await?;
assert_eq!(did_doc.id(), foo);
assert!(did_doc.also_known_as().contains(bar));

let did_doc = client.resolve_did(bar).await?;
assert_eq!(did_doc.id(), bar);
assert!(did_doc.also_known_as().contains(foo));

Type of change

  • 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

@UMR1352 UMR1352 added Bug Something isn't working. Rust Related to the core Rust code. Becomes part of the Rust changelog. Patch Change without affecting the API that requires a patch release. Part of "Patch" section in changelog Move Changes to Move packages labels Dec 3, 2024
@UMR1352 UMR1352 self-assigned this Dec 3, 2024
@UMR1352 UMR1352 requested a review from a team as a code owner December 3, 2024 12:11
@UMR1352 UMR1352 changed the base branch from main to feat/identity-rebased-alpha December 3, 2024 12:12
@eike-hass eike-hass self-requested a review December 3, 2024 12:21
@eike-hass eike-hass requested a review from a team December 3, 2024 12:42
@UMR1352 UMR1352 merged commit d8911a4 into feat/identity-rebased-alpha Dec 4, 2024
2 checks passed
@UMR1352 UMR1352 deleted the fix/migrated-identity-resolution branch December 4, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working. Move Changes to Move packages Patch Change without affecting the API that requires a patch release. Part of "Patch" section in changelog Rust Related to the core Rust code. Becomes part of the Rust changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants