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

Feature/emit did peer 4 #2696

Merged
merged 14 commits into from
Jan 9, 2024

Conversation

Jsyro
Copy link
Contributor

@Jsyro Jsyro commented Jan 4, 2024

Open for comments on how to update the long form with the short form. The resolver handles its own mapping, however i'm storing a duplicate DIDInfo, one where the did is long form and another where it's short form (for the same verkey).

Jsyro added 8 commits January 3, 2024 11:38
Signed-off-by: Jason Syrotuck <jasyrotuck@gmail.com>
Signed-off-by: Jason Syrotuck <jasyrotuck@gmail.com>
Signed-off-by: Jason Syrotuck <jasyrotuck@gmail.com>
Signed-off-by: Jason Syrotuck <jasyrotuck@gmail.com>
Signed-off-by: Jason Syrotuck <jasyrotuck@gmail.com>
Signed-off-by: Jason Syrotuck <jasyrotuck@gmail.com>
Signed-off-by: Jason Syrotuck <jasyrotuck@gmail.com>
Signed-off-by: Jason Syrotuck <jasyrotuck@gmail.com>
@Jsyro Jsyro marked this pull request as ready for review January 5, 2024 19:51
@Jsyro Jsyro requested review from dbluhm, swcurran and esune January 5, 2024 19:53
dbluhm
dbluhm previously approved these changes Jan 5, 2024
Copy link
Contributor

@dbluhm dbluhm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor suggestion and a minor comment but I think this looks good!

Comment on lines +847 to +849
# The long format I sent has been acknoledged, use short form now.
if LONG_PATTERN.match(conn_rec.my_did or ""):
conn_rec.my_did = await self.long_did_peer_4_to_short(conn_rec.my_did)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think as a community we need to formalize this a bit more but I think this is a logical starting point.

Jsyro added 3 commits January 5, 2024 13:26
Signed-off-by: Jason Syrotuck <jasyrotuck@gmail.com>
Signed-off-by: Jason Syrotuck <jasyrotuck@gmail.com>
@swcurran
Copy link
Contributor

swcurran commented Jan 5, 2024

Regards the issue of updating the long form to the short.

I would think that from the start on received DIDs, we want to store the short form on the connection ID, and when we need to resolve a long form, we convert it before looking it up. Since it is impossible to look up a short form via its long form, I think we should always do that.

I guess on creation its trickier, since we need to send it to the other party as the long form. Do we ever need to use the long form again after we send it to the other party? Especially if we assume the other party stores it as a short form (per comment above).

Also, do we store the DIDDoc? If so, is there a DIDDoc to Long Form transformation that would provide a way to get the long form back if ever needed?

@Jsyro
Copy link
Contributor Author

Jsyro commented Jan 5, 2024

Ready for final review.

@swcurran we currently need the protocol manager class to manage the ins and outs of each protocols behaviour, but that's still going to have maintenance issues if there are interleaved blocks of code handling unqualified, did:peer:2/3 and did:peer:4.

There is no code access at the point in time you are referring to, outbound queuing system uses the same values that we are manipulating. so doing any changes after we have gotten a response after sending the long form seems like the best and safest. Sending out the long form and then trying to change the agent's connection record may result in more convoluted behaviour than it's worth.

This is definitely something to keep an eye on.

We are not storing the did documents at all in storage. The short form did looks up the long form did, resolves that long form did into the document and then makes the appropriate substitutions to make it behave like the specification.

@swcurran
Copy link
Contributor

swcurran commented Jan 5, 2024

Got it — thanks. Sounds good.

Comment on lines 1249 to +1252
if args.emit_did_peer_2:
settings["emit_did_peer_2"] = True
if args.emit_did_peer_4:
settings["emit_did_peer_4"] = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering when one of these will become the new default, rather than having to specify the behaviour at startup (I am a bit out of the loop on this so I am likely missing some background info).

Copy link

sonarqubecloud bot commented Jan 8, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Contributor

@dbluhm dbluhm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dbluhm dbluhm merged commit 1cfd492 into openwallet-foundation:main Jan 9, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants