-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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 support for IPLD over IPNS #5602
Conversation
It's not *perfect* but at least `ipfs name resolve` can resolve IPNS records pointing to IPLD paths. `ipfs dag get /ipns` still doesn't work but we can *make* it work once we switch to CoreAPI. License: MIT Signed-off-by: Steven Allen <[email protected]>
@@ -25,15 +25,6 @@ func resolve(ctx context.Context, r resolver, name string, options *opts.Resolve | |||
} | |||
log.Debugf("resolved %s to %s", name, p.String()) | |||
|
|||
if strings.HasPrefix(p.String(), "/ipfs/") { |
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've changed this check to "is not /ipns/". That way, we continue resolving until we can no longer resolve.
if !strings.HasPrefix(name, "/") { | ||
return path.ParsePath("/ipfs/" + name) | ||
} | ||
// TODO: Forbid this case. |
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.
Can't do this now but I'd rather require complete paths (forbidding a raw "Qm..."). However, that'll be a harder change.
This code is mostly rewritten in #5404. We should also consider dropping the |
Let's block this on that PR then. |
Fixed in #5404. |
It's not perfect but at least
ipfs name resolve
can resolve IPNS records pointing to IPLD paths.ipfs dag get /ipns
still doesn't work but we can make it work once we switch to CoreAPI.I thought this would be difficult, apparently not...