-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add DidDht create, publish and resolve, add unit tests #308
Conversation
import web5.sdk.rust.Signer as RustCoreSigner | ||
|
||
data class DidDhtCreateOptions( | ||
val publish: Boolean? = false, |
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.
so we don't publish by default? Should maybe talk to gabe, I think a while back we defaulted to published by default?
I'm 95% sure we will run into user error on this a lot. people will do default did dht create and wonder why it is not working for resolve
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.
people will do default did dht create and wonder why it is not working for resolve
I would argue it is good for people to notice it is not working as they might expect and wonder why, causing them to learn that did:dht is a published did. If they do not understand that aspect of did:dht, they cannot make an informed choice of which did method to use.
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.
it actually is set to publish by default as you can see here
I was following the web5-js design
but perhaps here I should reinforce that experience by seeing = true
? what do we think? Rust doesn't have the equivalent syntax so I was following Rust
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.
alright, that's changed in the latest commit. I think we should set it as true
at that layer, even though the default is true
inside the rust core code (as I linked to above), because developers often look at the function signature to determine default behavior. good catch!
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.
FWIW I have both separated in the server impl
create - https://github.com/TBD54566975/did-dht/blob/main/impl/internal/did/did.go#L119
publish - https://github.com/TBD54566975/did-dht/blob/main/impl/internal/did/client.go#L65
I'd create them as two different methods, but perhaps better to keep this as defaulting to true
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.
oh I just realized the way I had it before, there are code paths where the default value you be false actually, even tho I'm using the default value of true inside the rust core code. jumping across languages is hard! thanks for the spot @nitro-neal
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.
looks great!
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.
are these test vectors implemented? https://did-dht.com/#test-vectors
@nitro-neal is following behind with test vectors it's an interesting question tho, because those specific test vectors are distinct from our web5-spec test vectors, but maybe they shouldn't be? |
@decentralgabe brought the receipts! 😆 We'll get 'er done here #310 |
No description provided.