smartcontractkit / chainlink

node of the decentralized oracle network, bridging on and off-chain computation
https://chain.link
Other
7.02k stars 1.71k forks source link

Underscore not allowed in Bridge URL #1699

Closed boxhock closed 5 years ago

boxhock commented 5 years ago

Currently it is not possible to create bridges with an underscore _ in the domain name. Error given with domain http://chainlink_cmc-adapter_1:8080:

{"errors":[{"detail":"Invalid URL format"}]}

In Go, net/url's url.Parse(s) does not give an error on this domain format. Underscores in domain names is common practice when working with docker-compose networks.

thodges-gh commented 5 years ago

Created #168685731 for this.

Alkhara commented 5 years ago

Root hostnames of a DNS address do not allow underscore per RFC-952 (https://tools.ietf.org/html/rfc952).

" A "name" (Net, Host, Gateway, or Domain name) is a text string up to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus sign (-), and period (.)."

They are however permitted in subdomains.

boxhock commented 5 years ago

@Alkhara I understand underscores are not necessarily "legal" in domain names, but since this restriction blocks Docker Compose setups, it does not make sense to have it in place.

It also does not make sense to put too much validation in place for something like a bridge URL. As long as it can reach it, that should be good enough. This URL format is perfectly fine for e.g. DATABASE_URL.

Alkhara commented 5 years ago

@boxhock I guess my concern is by allowing it, it would enable an HTTP request to an invalid hostname that would fail. But I suppose there is nothing stopping someone from putting a valid syntax URL that is a dead end as well.

whatsadebugger commented 5 years ago

WIP

boxhock commented 5 years ago

Fixed by #1824. Thanks @whatsadebugger!