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

namesys: Make paths with multiple segemnts work. Fixes #2059 #2116

Merged
merged 2 commits into from
Jan 5, 2016

Conversation

Kubuxu
Copy link
Member

@Kubuxu Kubuxu commented Dec 22, 2015

Also fixes non-recursive resolve erring instead showing one step.

The patch of core/commands/resolve.go could be done better but I don't know how to get access to ErrResolveRecursion.

It allows for dnslinks into sub-segments. So ie. hosting multiple blogs on just domains from one pubkey.

Fixes #2059

@jbenet jbenet added the backlog label Dec 22, 2015
@ghost ghost added the topic/ipns Topic ipns label Dec 22, 2015
@Kubuxu Kubuxu force-pushed the fix/#2059 branch 2 times, most recently from 1ba22bb to 309c70a Compare December 28, 2015 17:15
@Kubuxu
Copy link
Member Author

Kubuxu commented Dec 28, 2015

Added tests, fixed one more case and rebased.

@Kubuxu Kubuxu force-pushed the fix/#2059 branch 2 times, most recently from ead7be6 to 6dd56b5 Compare December 28, 2015 18:14
@Kubuxu
Copy link
Member Author

Kubuxu commented Dec 30, 2015

Should I recreate the PR for dev0.4.0 branch?

@@ -82,12 +82,15 @@ Resolve the value of an IPFS DAG path:
// the case when ipns is resolved step by step
if strings.HasPrefix(name, "/ipns/") && !recursive {
p, err := n.Namesys.ResolveN(req.Context(), name, 1)

if p != "" {
Copy link
Member

Choose a reason for hiding this comment

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

I dont like treating this as a special case... If we call the path resolved, the error should be nil.

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't like it too but in other case there is no reason to have resolve without recursion.

You can't use it to do step by step resolving as you just get error of recursion exceeded.
I will remove this from the PR as this is something that might require some refactoring to get right.

@Kubuxu
Copy link
Member Author

Kubuxu commented Jan 1, 2016

I've removed the change to the command.

@daviddias daviddias removed the backlog label Jan 2, 2016
 Also fixes non-recursive resolve erring instead showing one step.

 The patch of core/commands/resolve.go could be done better but I don't
 know how to get access to ErrResolveRecursion.

 It allows for dnslinks into sub-segments. So for example hosting
 multiple blogs
 on just domains from one pubkey.

 Fixes ipfs#2059

 Add tests and fix case when dnslinks references dnslink

License: MIT
Signed-off-by: Jakub (Kubuxu) Sztandera <kubuxu@gmail.com>
@Kubuxu Kubuxu closed this Jan 5, 2016
@Kubuxu Kubuxu reopened this Jan 5, 2016
@jbenet jbenet added the status/deferred Conscious decision to pause or backlog label Jan 5, 2016
@Kubuxu Kubuxu mentioned this pull request Jan 5, 2016
4 tasks
@whyrusleeping
Copy link
Member

@Kubuxu we don't seem to test for domain.tld/path/below/that. Could you add a couple of those types of tests? Also, could you add a test for the domain resolving to something like:
/ipns/HASH/ with the trailing slash, as well as /ipns/HASH/path/ also with the trailing slash

Fixed some issues with trailing slashes.

License: MIT
Signed-off-by: Jakub (Kubuxu) Sztandera <kubuxu@gmail.com>
@Kubuxu
Copy link
Member Author

Kubuxu commented Jan 5, 2016

I've added more tests and resolved issues with trailing slashes. Thanks for pointing this out.

I can squash commits if you want.

@whyrusleeping
Copy link
Member

no worries about squashing

@whyrusleeping
Copy link
Member

@Kubuxu just as a sanity check, you've tested this with real world dns resultion once or twice, right?

@whyrusleeping
Copy link
Member

this LGTM

@Kubuxu
Copy link
Member Author

Kubuxu commented Jan 5, 2016

I did. http://hastebin.com/inorefagip.txt

wget localhost:8080/ipns/ipfs2.kubuxu.ovh/main.css also works.

@whyrusleeping
Copy link
Member

awesome, this LGTM

whyrusleeping added a commit that referenced this pull request Jan 5, 2016
namesys: Make paths with multiple segemnts work. Fixes #2059
@whyrusleeping whyrusleeping merged commit 3f7d11f into ipfs:master Jan 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/deferred Conscious decision to pause or backlog topic/ipns Topic ipns
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Doesn't resolve dnslink's child link
4 participants