Hi,
I am endeavoring to register the de facto "redis://" URI scheme with
IANA's Uniform Resource Identifier (URI) Schemes registry
(
http://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml ). I have
written a draft of the registration and am currently seeking feedback on
it prior to officially submitting it to IANA. So I would love to hear
any comments y'all might have on it.
See
http://tools.ietf.org/html/rfc3986#section-3 for explanations of
some of the URI terminology that's used in the document.
Please note that the registration is intended merely to describe
existing practice in the wild, rather than to set forth any normative
standard, hence why its Status is Provisional rather than Permanent. (I
think the creation of a normative standard would be great, but it's
beyond the scope of my present work.)
Thanks.
Cheers,
Chris
********
Scheme name: redis
Status: Provisional
Applications/protocols that use this scheme name:
This scheme is used by some Redis database client libraries to
designate the Redis database to connect to, and in some cases to set
additional connection parameters of the client library. Redis client
libraries implement the RESP (REdis Serialization Protocol) defined
in "Redis Protocol specification". This URI scheme is not part of
that specification.
Contact:
Registering party:
Chris Rebert <
iana.url.sc...@chrisrebert.com>
Change controller:
Either the registering party, or
Salvatore Sanfilippo <
http://invece.org/>
References:
Redis, "Redis Protocol specification", 2015,
<
http://redis.io/topics/protocol>.
Redis, "SELECT index", 2015, <
http://redis.io/commands/select>.
Redis, "AUTH password", 2015, <
http://redis.io/commands/auth>.
Zygmuntowicz, E. and Contributors, "Getting started", 2015, redis-rb,
<
https://github.com/redis/redis-rb#getting-started>.
McCurdy, A. and Contributors, "redis.connection.ConnectionPool
.from_url(url, db=None, **kwargs)", redis-py, August 2014,
<
https://github.com/andymccurdy/redis-py/blob/2.10.3/redis/connection.py#L733>.
Solem, A. and Contributors, "Using Redis - Celery 3.0.25
documentation", April 2013,
<
http://celery.readthedocs.org/en/3.0/getting-started/brokers/redis.html>.
Driessen, V. and Contributors, "Workers: Using a config file - RQ:
Simple job queues for Python", 2015,
<
http://python-rq.org/docs/workers/>.
Service Stack LLC and Contributors, "Redis Connection Strings", 2015,
ServiceStack.Redis,
<
https://github.com/ServiceStack/ServiceStack.Redis#redis-connection-strings>.
Dollar, D. and Contributors, "redis-url: URL format", 2015,
<
https://www.npmjs.com/package/redis-url#url-format>.
Scheme syntax:
Example: redis://:secret@localhost:6379/0?foo=bar&qux=baz
This scheme uses a profile of the RFC 3986 generic URI syntax.
All URI fields after the scheme are optional.
The "userinfo" field uses the traditional "user:password" format.
Expressed using RFC 5234 ABNF, the "path" grammar production from
RFC 3986 is overridden as follows:
path = [ path-slashed ]
; path is optional
path-slashed = "/" [ db-number ]
; exactly zero or one path segments
db-number = "0" / nz-num
; nonnegative decimal integer with no leading zeros
nz-num = NZDIGIT *DIGIT
; positive decimal integer with no leading zeros
NZDIGIT = %x31-39
; the digits 1-9
Scheme semantics:
This scheme is used to designate Redis databases that may be accessed
via RESP.
URIs using this scheme are dereferenced by connecting to the
designated Redis server via RESP and then issuing corresponding AUTH
and/or SELECT commands if a password and/or database number
(respectively) were specified.
If absent, the default value of the "host" URI field is:
"localhost" (or equivalent)
If absent, the default value of the "port" URI field is:
6379
(see the corresponding entry in the Service Name and Transport
Protocol Port Number Registry)
The database number to use for the Redis SELECT command comes from
either the "db-number" portion of the URI (described in the previous
section) or the value from the key-value pair from the "query" URI
field with the key "db". If neither of these are present, the
default database number is 0.
The password to use for the Redis AUTH command comes from either the
password portion of the "userinfo" URI field or the value from the
key-value pair from the "query" URI field with the key "password".
If neither of these are present, the client ought not to issue an
initial AUTH command.
The semantics of other "query" URI field key-value pairs are
implementation-defined.
Encoding considerations:
Unknown, use with care.
Interoperability considerations:
The "fragment" URI field has no known meaning or usage. Unless it
becomes meaningful in the future, omitting it is strongly advised.
Likewise, the username portion of the "userinfo" URI field has no
clear meaning since Redis' optional password-based authentication
does not employ a username. Unless Redis' authentication mechanism
changes in the future, using only the password portion of the
"userinfo" URI field is strongly advised.
The "query" URI field is used to specify client-library-
implementation-specific connection parameters and is therefore not
portable. Using it without knowledge of which specific client
library is going to be used ought to be avoided.
The meaning of "path" URI field values that do not conform to the
"db-number" grammar have no known meaning or usage. Using such
values ought to be avoided.
If both a "db-number" value and a "query" URI field key-value pair
with the key "db" are present, the semantics for what Redis database
number to use are not well-defined. Such situations therefore ought
to be avoided.
If both the password portion of the "userinfo" URI field and a
"query" URI field key-value pair with the key "password" are present,
the semantics for what password to use for authentication are not
well-defined. Such situations therefore ought to be avoided.
Security considerations:
Not fully known, use with care.
As these URIs might contain authentication credentials or designate
Redis servers which allow unauthenticated access, care ought to be
taken to not leak the credentials to unauthorized persons, e.g. by
outputting the URIs in logs or error messages.