-
Notifications
You must be signed in to change notification settings - Fork 208
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(connections): allow ; to convert legacy did #882
fix(connections): allow ; to convert legacy did #882
Conversation
Signed-off-by: Timo Glastra <timo@animo.id>
Codecov Report
@@ Coverage Diff @@
## main #882 +/- ##
=======================================
Coverage 87.58% 87.58%
=======================================
Files 468 468
Lines 11092 11095 +3
Branches 1745 1746 +1
=======================================
+ Hits 9715 9718 +3
Misses 1377 1377
Continue to review full report at Codecov.
|
Signed-off-by: Timo Glastra <timo@animo.id>
const [, id] = fullId.split('#') | ||
// Some old dids use `;` as the delimiter for the id. If we can't find a `#` | ||
// and a `;` exists, we will parse everything after `;` as the id. | ||
if (!fullId.includes('#') && fullId.includes(';')) { |
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.
This parser only works if there is a single ;
in the id. Is that correct?
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.
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.
I think leaving them behind, which follows the url parser you showed, is good. I am very unaware of the security implications (likely none) here though.
packages/core/src/modules/connections/__tests__/ConnectionService.test.ts
Show resolved
Hide resolved
Signed-off-by: Timo Glastra <timo@animo.id>
Older dids use
;
as an identifier separator instead of the now used#
. So an id ofdid:sov:123;indy
would be normalized to#did:sov:123;indy
. We now check when converting a legacy did doc to a new did doc whether an;
character is in place and the#
isn't and we will handle it correclty so it parses to#indy