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

fix: mediation webhook routing keys #2502

Conversation

anwalker293
Copy link
Contributor

Re: #2357 and #2492

Indicio PR: Indicio-tech#153

Tagging and credit due to @dbluhm

@anwalker293 anwalker293 changed the title fix/mediation webhook routing keys fix: mediation webhook routing keys Sep 21, 2023
@dbluhm dbluhm requested a review from swcurran September 21, 2023 19:02
@dbluhm dbluhm force-pushed the fix/mediation-webhook-routing-keys branch from 86ad52e to 3f0d1a6 Compare September 21, 2023 19:03
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Comment on lines +1 to +2
v0.11.0:
update_routing_keys: true
Copy link
Contributor

Choose a reason for hiding this comment

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

Assuming this is merged in for 0.11.0, I believe this is the correct way to specify that our upgrade routine should be run? @shaangill025

Comment on lines +407 to +420
async def update_routing_keys(profile: Profile):
"""Update routing keys previously stored in wallet.

This update step will transform the stored routing keys into did:key values
from raw base58 encoded values.

Steps:
for each mediation record stored in the wallet:
ensure the stored routing_keys list is formated as did:keys
save the record if modified
for each routing record stored in the wallet:
ensure the stored recipient keys are formated as did:keys
save the record if modified
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

This is the routine we've added for updating the routing keys. The goal of doing the upgrade this way was to ensure that we don't have to keep base58 -> did:key translation code on the MediationRecord and RouteRecord hydration methods from now until the rest of forever. Is this the right approach? Do we anticipate the upgrade script will continue to be used in this way in the future? Does this logic belong here or should it go somewhere else?

cc @shaangill025 @swcurran

@dbluhm
Copy link
Contributor

dbluhm commented Sep 21, 2023

Marking as draft temporarily: I need to review a couple of instances of these values being used.

@dbluhm dbluhm marked this pull request as draft September 21, 2023 19:38
@dbluhm
Copy link
Contributor

dbluhm commented Sep 25, 2023

I believe I was overzealous with my recommended changes. To address the linked issues, we need only modify the mediation record. It is probably a good idea to limit this PR to just addressing the mediation record routing key representation. Changing route record would support changing over to sending and receiving did:keys in routing/1.0/forward messages but I think that's a discussion for another time.

@dbluhm
Copy link
Contributor

dbluhm commented Sep 25, 2023

Closing this PR; the upgrade process was an interesting exercise but ultimately the two issues are better addressed by a smaller change set found in #2516. We'll hold onto these changes in this branch in case they become relevant (if we needed to update the to field behavior in routing/1.0/forward).

@dbluhm dbluhm closed this Sep 25, 2023
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.

Routing keys for public DIDs should be published as did:keys Mediation webhook routing keys aren't did:keys
2 participants