|
8 | 8 | //
|
9 | 9 | // Additionally, the /ipns/ namespace can also be used with domain names that
|
10 | 10 | // use DNSLink (/ipns/<dnslink_name>, https://docs.ipfs.io/concepts/dnslink/)
|
11 |
| -// and proquint strings. |
12 | 11 | //
|
13 | 12 | // The package provides implementations for all three resolvers.
|
14 | 13 | package namesys
|
@@ -38,15 +37,14 @@ import (
|
38 | 37 | // Uses several Resolvers:
|
39 | 38 | // (a) IPFS routing naming: SFS-like PKI names.
|
40 | 39 | // (b) dns domains: resolves using links in DNS TXT records
|
41 |
| -// (c) proquints: interprets string as the raw byte data. |
42 | 40 | //
|
43 | 41 | // It can only publish to: (a) IPFS routing naming.
|
44 | 42 | //
|
45 | 43 | type mpns struct {
|
46 | 44 | ds ds.Datastore
|
47 | 45 |
|
48 |
| - dnsResolver, proquintResolver, ipnsResolver resolver |
49 |
| - ipnsPublisher Publisher |
| 46 | + dnsResolver, ipnsResolver resolver |
| 47 | + ipnsPublisher Publisher |
50 | 48 |
|
51 | 49 | staticMap map[string]path.Path
|
52 | 50 | cache *lru.Cache
|
@@ -125,7 +123,6 @@ func NewNameSystem(r routing.ValueStore, opts ...Option) (NameSystem, error) {
|
125 | 123 | ns.dnsResolver = NewDNSResolver(madns.DefaultResolver.LookupTXT)
|
126 | 124 | }
|
127 | 125 |
|
128 |
| - ns.proquintResolver = new(ProquintResolver) |
129 | 126 | ns.ipnsResolver = NewIpnsResolver(r)
|
130 | 127 | ns.ipnsPublisher = NewIpnsPublisher(r, ns.ds)
|
131 | 128 |
|
@@ -188,7 +185,6 @@ func (ns *mpns) resolveOnceAsync(ctx context.Context, name string, options opts.
|
188 | 185 | // Resolver selection:
|
189 | 186 | // 1. if it is a PeerID/CID/multihash resolve through "ipns".
|
190 | 187 | // 2. if it is a domain name, resolve through "dns"
|
191 |
| - // 3. otherwise resolve through the "proquint" resolver |
192 | 188 |
|
193 | 189 | var res resolver
|
194 | 190 | ipnsKey, err := peer.Decode(key)
|
@@ -228,11 +224,9 @@ func (ns *mpns) resolveOnceAsync(ctx context.Context, name string, options opts.
|
228 | 224 | } else if _, ok := dns.IsDomainName(key); ok {
|
229 | 225 | res = ns.dnsResolver
|
230 | 226 | } else {
|
231 |
| - // TODO: remove proquint? |
232 |
| - // dns.IsDomainName(key) will return true for proquint strings, |
233 |
| - // so this block is a dead code. |
234 |
| - // (alternative is to move this before DNS check) |
235 |
| - res = ns.proquintResolver |
| 227 | + out <- onceResult{err: fmt.Errorf("invalid IPNS root: %q", key)} |
| 228 | + close(out) |
| 229 | + return out |
236 | 230 | }
|
237 | 231 |
|
238 | 232 | resCh := res.resolveOnceAsync(ctx, key, options)
|
|
0 commit comments