decentralized-identity / decentralized-identity/did-common-dotnet

Consolidate and or integrate spikes (or previous work) into new architectural structure main

Open
#5 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
18
Forks
8
PR merge metrics
No merged PRs in 30d

Description

There has been previous work to start the dotnet dids libraries, this is how this project has started. So the first part of the project is to validate / move and convert these spikes / prototypes into the new main project.

Steps:
- [x] Create branches with spike projects, removing most of the obsolete code
- [x] Create a new skeleton architecture to start implementation
- [x] Move simple non obsolete components from Nethereum spike (url parser, tests).
- [X] Move the most up to date functional model from (@veikkoeeva ) spike into a temporary spike folder to keep history and ease migration, redesing or refactoring (@veikkoeeva Dotdecentralized) and testing.

Note: Whilst both spikes could have been ported directly (although the Nethereum was older). The Dotdecentralised introduced json convertors and other initial crypto, the only major issue is the general dependencies that both implementations had on specific libraries, this is a common problem in .net so a more abstract design is required, nevertheless the model will remain unchanged and specific libraries implementation can be moved into their projects.

- [x] First we can move the model from the spike as it is the latest. Following the conversation and research to remove the dependencies to System.Text.Json and Newtonsoft we will use DataMember attribute instead. Note I have found this to be an issue also on the ExtendedAttributes so that will need a common deserialiser for that type of object. A base class can be created to detect this.

System.Text.Json does not support yet DataMember to be decoupled this is coming maybe in .Net 6. For reference : This is going to be a major issue for decoupling. https://github.com/dotnet/runtime/issues/29975 and https://github.com/dotnet/runtime/issues/30009#issuecomment-697936065

Edit: see https://github.com/decentralized-identity/did-common-dotnet/issues/5#issuecomment-783080103 for further discussion, this might have to become its own issue.

- [x] Public key formats, the spike implements a specific converter to avoid having a attributes per each key type, this will need to be also implemented in Json.Net as the model has to follow the same pattern, Another alternative although simpler but not as clean, will be to refactor the model to include all the attributes as per the Java and other spike implementation, but that will mean including extra information in some public keys and probably not have the capability to plug extra key formats with different attributes. Something to think about or to note for clarification / documentation as both the Java and Javasript includes them internally https://github.com/decentralized-identity/did-common-java/blob/

- [x] New projects will be created to support System.Text.Json and Newtonsoft a common interface will be created in the common model project and implementations on specific projects.

- [x] The unit tests data utilized in System.Text.Json can be then reused for both, so that will be moved straight away.

- [ ] All the crypto in the spike has dependencies to Azure libraries, this need to be removed or have an specific implementation. The current new structure has the new DidNet.Crypto that can hold all the common interfaces. The dependencies I have seen are JsonWebKeyConverter, AsymmetricSignatureProvider and ICryptoProvider all part of Azure Microsoft.IdentityModel.Tokens that need to be removed or decoupled. The pattern followed is similar to the JWT https://github.com/decentralized-identity/did-common-dotnet/blob/did-url-parser/spikes/did-url-parser/DID/Did.Jwt.Tests/JwtTests.cs#L29-L50 which will be necessary anyway for other interoperability both functional and a library perspective, but this might be a truly bigger topic to discuss.

More...

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.