identity.rs
identity.rs copied to clipboard
[Task] Add Import Functionality for existing `IotaDocument` + private keys to `Account`
Description
EDIT: Description outdated as most tasks where finished long ago. Last to-do item still is open though.
As was discussed in #419, the low-level API will be accessible via "Option 2", a mutable DID Document to be returned by the Account
. This function will return either an IotaDocument
directly or an IdentityState
, depending on #462.
Additionally, a publish_unchecked
method is needed, to publish a mutated document directly, to bypass the regular account functionality, like automatic signing and figuring out whether to publish as diff or int. It should be possible to force publish as an integration message, but not as a diff message. This should also allow modifying the document's metadata.
In addition, the Account
will need to be able to import a DID Document, publish it to the Tangle, storing it in the Storage
adapter and loading it back into the Account
. All these actions should try to avoid putting restrictions on the state of the DID Document, such that developers have more freedom than just the Account
. It needs to be researched how we can allow DID Documents with a state that the Account
doesn't understand to once again become part of the Account
.
Motivation
Right now, the low-level API for DID Document management does not overlap with the Account
API. This means that either API must be chosen for the management of the Identity for the entire application. This Issue helps to make the API that is used interchangeable.
Resources
- #419
To-do list
Create a task-specific to-do list . Please link PRs that match the To-do list item behind the item after it has been submitted.
- [x] Add a method to access the document stored in the account, and be able to modify it ((#522)
- [x] Add a method to publish the document without the typical account functionality and which exposes more options for how to publish (#522)
- [ ] Add import functionality that can take an existing
IotaDocument
with a list of its private keys and make it managable by theAccount