This repository has been archived by the owner on Apr 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 59
[V2.0] DID fragments instead of MethodID #266
Merged
kwek20
merged 24 commits into
iotaledger:v2.0-dev
from
kwek20:v2.0/did-verification-method2
Aug 29, 2022
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
12e67ab
fds
b082114
Update identity imports
DyrellC 50714d7
remove exchange keys mapping from user, wip
DyrellC f4164d6
fix signing key discrepancies
DyrellC 9f059cb
remove ed key -> x key conversion in identifier
DyrellC 179ea59
unused imports
DyrellC f37edc4
add subscribers via binary search pattern
DyrellC 811b422
added resolver = 2
7f7e5f9
reorganised id, fmt and fixed imports
2f606e9
moved verify to DIDInfo to clean imports to package
a5dfbcf
Merge branch 'v2.0-dev' into v2.0/did-verification-method2
7b287b7
updated identity to latest rev
e766b84
Merge branch 'v2.0-dev' into v2.0/did-verification-method2
1b59fa3
Correct lifetime parameters in `Keyload::Wrap` to avoid unnecessary c…
96dc57d
Dyrell feedback
eec365b
restructured more of did
c11a7e6
Merge branch 'v2.0/did-verification-method2' into improve-lifetime-of…
kwek20 e9d941c
Merge pull request #4 from arnauorriols/improve-lifetime-of-subscribe…
kwek20 2179985
Arnau feedback
26ca4cb
Merge branch 'v2.0/did-verification-method2' of https://github.com/kw…
c47fc36
clippy
8584df8
Merge branch 'v2.0-dev' into v2.0/did-verification-method2
9f2655f
merge fix
0d13ad9
fixed permissions error
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,5 +6,7 @@ members = [ | |
"streams", | ||
] | ||
|
||
resolver = "2" | ||
|
||
[profile.dev] | ||
incremental = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ tangle-client = ["iota-client/async", "futures", "iota-crypto/blake2b"] | |
# Enable the wasm-compatible IOTA-Tangle transport client (incompatile with `tangle-client` feature due to `iota-client/async` using `tokio`. Implies `std` feature) | ||
tangle-client-wasm = ["iota-client/wasm", "futures"] | ||
# Enable Iota Identity for use with Streams | ||
did = ["identity", "serde"] | ||
did = ["identity_iota", "serde"] | ||
|
||
[dependencies] | ||
# Local dependencies | ||
|
@@ -37,6 +37,6 @@ hex = {version = "0.4", default-features = false} | |
|
||
# Optional dependencies | ||
futures = {version = "0.3.8", default-features = false, optional = true} | ||
identity = {git = "https://github.com/iotaledger/identity.rs", rev = "86edaad", default-features = false, features = ["async"], optional = true} | ||
identity_iota = {git = "https://github.com/iotaledger/identity.rs", rev = "d3920c2", default-features = false, optional = true} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seeing that this rev already takes the new package name used for releasing to crates.io, I wonder if we couldn't actually use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This didnt work due to an identity error internally when compiling :P
|
||
iota-client = {version = "1.1.1", default-features = false, optional = true} | ||
serde = {version = "1.0", default-features = false, features = ["derive"], optional = true} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// 3rd-party | ||
use serde::Serialize; | ||
|
||
use identity_iota::{ | ||
crypto::{GetSignature, GetSignatureMut, Proof, SetSignature}, | ||
did::{MethodUriType, TryMethod}, | ||
}; | ||
|
||
#[derive(Serialize)] | ||
pub(crate) struct DataWrapper<'a> { | ||
data: &'a [u8], | ||
signature: Option<Proof>, | ||
} | ||
|
||
impl<'a> DataWrapper<'a> { | ||
pub(crate) fn new(data: &'a [u8]) -> Self { | ||
Self { data, signature: None } | ||
} | ||
|
||
pub(crate) fn with_signature(mut self, signature: Proof) -> Self { | ||
self.signature = Some(signature); | ||
self | ||
} | ||
|
||
pub(crate) fn into_signature(self) -> Option<Proof> { | ||
self.signature | ||
} | ||
} | ||
|
||
impl<'a> GetSignature for DataWrapper<'a> { | ||
fn signature(&self) -> Option<&Proof> { | ||
self.signature.as_ref() | ||
} | ||
} | ||
|
||
impl<'a> GetSignatureMut for DataWrapper<'a> { | ||
fn signature_mut(&mut self) -> Option<&mut Proof> { | ||
self.signature.as_mut() | ||
} | ||
} | ||
|
||
impl<'a> SetSignature for DataWrapper<'a> { | ||
fn set_signature(&mut self, signature: Proof) { | ||
self.signature = Some(signature) | ||
} | ||
} | ||
|
||
impl<'a> TryMethod for DataWrapper<'a> { | ||
const TYPE: MethodUriType = MethodUriType::Absolute; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required because of an identity feature (Identity also needs this now)