dlazarus commented on a change in pull request #324: MESOS-9499 extended URI
syntax to support any Zookeeper authentication schemes
URL: https://github.com/apache/mesos/pull/324#discussion_r247926266
##########
File path: include/mesos/zookeeper/url.hpp
##########
@@ -101,16 +102,35 @@ inline Try<URL> URL::parse(const std::string& url)
// Look for the trailing '@' (if any), that's where servers starts.
size_t index = s.find_last_of('@');
- if (index != std::string::npos) {
- return URL(s.substr(0, index), s.substr(index + 1), path);
- } else {
+ if (index == std::string::npos)
return URL(s, path);
+
+ std::string servers = s.substr(index + 1);
+ std::string auth = s.substr(0, index);
+
+ size_t schemeDelimiter = auth.find_first_of('!');
+
+ // If there is not '!' in URL scheme is "digest" and everything before '@'
is credentials
+ std::string scheme = "digest";
+ std::string credentials = auth;
Review comment:
It is not in the hostname. Look:
example: zk://simple!login:password@host:port/path
hostname starts after '@'.
Everything after zk:// and before '@' has nothing to do with DNS and
hostnames.
Check https://tools.ietf.org/html/rfc3986
Page 49 describes allowed delimiters in this part, explicitly including '!'.
Section 3.2.1 describes this part as "User Information".
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services