[412] [DFN[[[authority]]]] は、[[URL]] のうち、 [[scheme]] と [CODE(URI)[[[:]]]]
の直後の [CODE(URI)@en[[[//]]]] とその後最初の
[CODE(URI)[[[/]]]], [CODE(URI)@en[[[?]]]], [CODE(URI)[[['''#''']]]] または末尾の間にある部分です。
[413] 多くの場合 [[authority]] は[[ドメイン名]]や[[ホスト名]]や [[IPアドレス]] ([[host]]) と、
省略可能な[[利用者名]]や[[合言葉]] ([[userinfo]]) や[[ポート番号]]
([[port]]) を指定することになっています。
* authority の内容
** そもそも使わない
[416] [CODE(URI)@en[[[mailto:]]]], [CODE(URI)@en[[[about:]]]], [CODE(URI)@en[[[tel:]]]]
などではそもそも [[authority]] 部分が存在しません。
** ホスト名
[415] [CODE(URI)@en[[[http:]]]] など多くの [[URL]] では、 [[ホスト名]]を指定します。
直後に[[ポート番号]]、直前に [[userinfo]] を指定することも可能なことが多いです。
** URL のようなもの
[14] [CODE(URI)@en[[[pack:]]]] [[URI scheme]] では、 [[authority]] 部に[[パッケージURI]]
を適当に変換したものを使います。
** パッケージ名
[403] [CODE(URI)@en[[[chdome:]]]] ([[Gecko]])、
[CODE(URI)@en[[[chrome-extension:]]]]、[CODE(URI)@en[[[safari-extension:]]]]
では[[拡張機能]]のパッケージ名を [CODE(ABNF)@en[[[authority]]]]
部分に使っています。
** ファイル名
[408] [CODE(URI)@en[[[res:]]]] [[URL]] では [[Windows]] の[[ファイル名]]を [[authority]]
として使います。
** 不透明な文字列
[414] [CODE(URI)@en[[[widget:]]]] [[URL]] では不透明な文字列とされています。
** 常に空文字列
** その他独自のもの
[401] [CODE(URI)@en[[[ms-help:]]]] [[URL]]
[409] [CODE(URI)@en[[[wysisyg:]]]]
* IP アドレスを表す非標準の authority
[15]
[[Firefox]] は [[IPv4]] [[番地]] 208.77.188.166
の[[鯖]]に接続します。 [CODE(HTTP)@en[[[Host]]:]] には 208.77.188.166
という値が使われます。
[[Opera]] は [[IPv4]] [[番地]] 208.77.188.166
の[[鯖]]に接続します。 [CODE(HTTP)@en[[[Host]]:]] にはおそらく [208.77.188.166]
という値が使われるので、 [[Apache]] からは [CODE(HTTP)[[[400]]]]
が返ってきます。
[[Safari]] は[[鯖]]を探し続けます。
[[WinIE 7]] ではエラーが表示されます。
[407]
;; いずれも [[Windows Vista]] での結果です。
* authority 以外のドメイン名
- [410] [[メール・アドレス]]型の構造の後半部分
-- [CODE(URI)@en[[[mailto:]]]], [CODE(URI)@en[[[sip:]]]] など
- [411] [[path]] に埋め込まれた [[URL]] の [[authority]] 部分
-- [CODE(URI)@en[[[view-source:]]]], [CODE(URI)@en[[[jar:]]]] など
* 仕様書から
** RFC 1738 (URL) 3.1. Common Internet Scheme Syntax
> While the syntax for the rest of the URL may vary depending on the
particular scheme selected, URL schemes that involve the direct use
of an IP-based protocol to a specified host on the Internet use a
common syntax for the scheme-specific data:
>
- [CODE[//:@:/]]
> Some or all of the parts ":@", ":",
":", and "/" may be excluded. The scheme specific
data start with a double slash "//" to indicate that it complies with
the common Internet scheme syntax. The different components obey the
following rules:
>
:user:An optional user name. Some schemes (e.g., ftp) allow the specification of a user name.
:password:An optional password. If present, it follows the user name separated from it by a colon.
> The user name (and password), if present, are followed by a commercial at-sign "@". Within the user and password field, any ":", "@", or "/" must be encoded.
> Note that an empty user name or password is different than no user name or password; there is no way to specify a password without specifying a user name. E.g., has an empty user name and no password, has no user name, while has a user name of "foo" and an empty password.
>
:host The fully qualified domain name of a network host, or its IP address as a set of four decimal digit groups separated by ".". Fully qualified domain names take the form as described in Section 3.5 of RFC 1034 [13] and Section 2.1 of RFC 1123 [5]:a sequence of domain labels separated by ".", each domain label starting and ending with an alphanumerical character and possibly also containing "-" characters. The rightmost domain label will never start with a digit, though, which syntactically distinguishes all domain names from the IP addresses.
:port:The port number to connect to. Most schemes designate protocols that have a default port number. Another port number may optionally be supplied, in decimal, separated from the host by a colon. If the port is omitted, the colon is as well.
:url-path:The rest of the locator consists of data specific to the scheme, and is known as the "url-path". It supplies the details of how the specified resource can be accessed. Note that the "/" between the host (or port) and the url-path is NOT part of the url-path.
> The url-path syntax depends on the scheme being used, as does the manner in which it is interpreted.
** RFC 1808 (相対 URL) 2.4.3. Parsing the Network Location/Login
> If the parse string begins with a double-slash "//", then the
substring of characters after the double-slash and up to, but not
including, the next slash "/" character is the network location/login
() of the URL. If no trailing slash "/" is present, the
entire remaining parse string is assigned to . The double-slash and are removed from the parse string before continuing.
解析文字列が二重斜線 [CODE(URI)[//]] から始まる場合、その二重斜線から次の斜線 [CODE(URI)[/]] 文字の手前までの部分文字列が URL のネットワーク位置・ログイン ([CODE(ABNF)[[[net_loc]]]]) です。
お尻の斜線 [CODE(URI)[/]] がない場合には、解析文字列の残りの部分全体が [CODE(ABNF)[net_loc]] に割り当てられます。
二重斜線及び [CODE(ABNF)[net_loc]] は、続行する前に解析文字列から削除します。
** RFC 2396 (URI) 3.2. Authority Component
> Many URI schemes include a top hierarchical element for a naming
authority, such that the namespace defined by the remainder of the
URI is governed by that authority. This authority component is
typically defined by an Internet-based server or a scheme-specific
registry of naming authorities.
多くの URI scheme は、最上位階層要素として命名権者を含めており、 URI の残りの部分で定義される名前空間はその命名権者の領めるところとなります。
この命名権者部品は、典型的にはインターネットを基にしたサーバー又は scheme 定義の命名権者登録簿により定義されます。
>
- [CODE(ABNF)[[DFN[authority = server | reg_name]]]]
> The authority component is preceded by a double slash "//" and is
terminated by the next slash "/", question-mark "?", or by the end of
the URI. Within the authority component, the characters ";", ":",
"@", "?", and "/" are reserved.
命名権者部品は前に二重斜線 [CODE(URI)[//]] がつき、
次の斜線 [CODE(URI)[/]], 疑問符 [CODE(URI)[?]]
又は URI の末端により終端されます。
命名権者部品中では、文字 [CODE(URI)[;]],
[CODE(URI)[:]], [CODE(URI)[@]],
[CODE(URI)[?]], [CODE(URI)[/]] が[[予約]]されています。
> An authority component is not required for a URI scheme to make use
of relative references. A base URI without an authority component
implies that any relative reference will also be without an authority component.
命名権者部品は、 URI scheme が相対参照を使うために必須ではありません。
命名権者部品なしの[[基底URI]] は、
全ての相対参照が命名権者部品のやはり欠けたものであることを暗に示します。
*** 3.2.1. Registry-based Naming Authority
> The structure of a registry-based naming authority is specific to the
URI scheme, but constrained to the allowed characters for an
authority component.
登録簿を基にした命名権者は URI scheme に特有のものですが、
命名権者部品で許される文字に制約されます。
>
- [CODE(ABNF)[[DFN[reg_name]] = 1*( [[unreserved]] | [[escaped]] | "$" | "," | ";" | ":" | "@" | "&" | "=" | "+" )]]
*** 3.2.2. Server-based Naming Authority
> URL schemes that involve the direct use of an IP-based protocol to a
specified server on the Internet use a common syntax for the server
component of the URI's scheme-specific data:
インターネットの特定のサーバーに対する
IP を基にしたプロトコルの直接使用を含んだ URL scheme
は、 URI の scheme 特定データのサーバー部品に共通の構文を使います。
>
- [CODE[@:]]
> where may consist of a user name and, optionally, scheme-specific information about how to gain authorization to access the server. The parts "@" and ":" may be omitted.
ここで、 [CODE[userinfo]] は利用者の名前を入れることができて、任意選択によって、サーバーに接続するための認証の方法についての scheme 特有の情報をも入れることができます。
[CODE[@]] の部分と [CODE[:]] の部分アh省略可能です。
>
- [CODE(ABNF)[[DFN[server]] = [ [ [[userinfo]] "@" ] [[hostport]] ] ]]
> The user information, if present, is followed by a commercial at-sign "@".
利用者情報を示す場合は、その後に単価記号 [CODE(URI)[@]] が続きます。
>
- [CODE(ABNF)[[DFN[userinfo]] = *( [[unreserved]] | [[escaped]] | ";" | ":" | "&" | "=" | "+" | "$" | "," )]]
> Some URL schemes use the format "user:password" in the userinfo
field. This practice is NOT RECOMMENDED, because the passing of
authentication information in clear text (such as URI) has proven to
be a security risk in almost every case where it has been used.
URL scheme によっては、 [CODE(ABNF)[userinfo]]
欄に [CODE[[VAR[user]]:[VAR[password]]]] の書式を使います。
この慣習は、認証情報を[[平文]] (URI とか。)
で渡すことはその使用されるほとんど全ての場合に置いて安全上の危険を負うこととなるので、'''推奨しません'''。
> The host is a domain name of a network host, or its IPv4 address as a
set of four decimal digit groups separated by ".". Literal IPv6
addresses are not supported.
[CODE(ABNF)[[[host]]]] は、ネットワーク・ホストのドメイン名か、その [[IPv4アドレス]]を [CODE(URI)[.]] で分離した4つの10進数集団の集合としたものです。
生 [[IPv6アドレス]]には対応していません。
>
- [CODE(ABNF)[[DFN[[[hostport]]]] = host [ ":" [[port]] ] ]]
- [CODE(ABNF)[[DFN[host]] = hostname | [[IPv4address]]]]
- [CODE(ABNF)[[DFN[hostname]] = *( domainlabel "." ) toplabel [ "." ] ]]
- [CODE(ABNF)[[DFN[domainlabel]] = [[alphanum]] | alphanum *( alphanum | "-" ) alphanum]]
- [CODE(ABNF)[[DFN[toplabel]] = alpha | alpha *( alphanum | "-" ) alphanum]]
- [CODE(ABNF)[[DFN[IPv4address]] = 1*digit "." 1*digit "." 1*digit "." 1*digit]]
- [CODE(ABNF)[[DFN[port]] = *digit]]
> Hostnames take the form described in Section 3 of [RFC1034] and Section 2.1 of [RFC1123]: a sequence of domain labels separated by ".", each domain label starting and ending with an alphanumeric character and possibly also containing "-" characters. The rightmost domain label of a fully qualified domain name will never start with a digit, thus syntactically distinguishing domain names from IPv4 addresses, and may be followed by a single "." if it is necessary to distinguish between the complete domain name and any local domain. To actually be "Uniform" as a resource locator, a URL hostname should be a fully qualified domain name. In practice, however, the host component may be a local domain literal.
ホスト名は、 RFC 1034 の3章と RFC 1123 の2.1章で説明されている形を取りました。 [CODE[.]] で分離されたドメイン札の連続体で、それぞれのドメイン札は英数字で始まり英数字で終わり、 [CODE[-]] を含めることもできます。[[完全修飾ドメイン名]]の再右ドメイン札は数字で始まることはないので、 IPv4 アドレスとドメイン名を構文的に区別できますし、完全などメイン名と局所ドメインを区別する必要がある時には単一の [CODE[.]] を続けることができます。
真に「統一」された資源位置子であるためには、 URL
ホスト名は完全修飾名であるべきです。しかし、実際にはホスト部品は局所ドメイン札かもしれません。
> Note: A suitable representation for including a literal IPv6
address as the host part of a URL is desired, but has not yet been
determined or implemented in practice.
注意 : URL のホスト部分として生 IPv6 アドレスを含める適当な表現が望まれますが、まだ決定していませんし実際に実装されてもいません。
> The port is the network port number for the server. Most schemes
designate protocols that have a default port number. Another port
number may optionally be supplied, in decimal, separated from the
host by a colon. If the port is omitted, the default port number is assumed.
[CODE(ABNF)[port]] は、サーバーのネットワーク・ポート番号です。ほとんどの scheme は既定ポート番号のあるプロトコルを指示しています。
他のポート番号は省略可能ですが10進数で [CODE(ABNF)[host]]
とコロンで区切って指定して構いません。
[CODE(ABNF)[port]] が省略されている時には、
既定ポート番号が仮定されます。
** RFC 2774 (IPv6 アドレス in URI)
→[[RFC2774]]
** RFC の部分の License
[[RFCのライセンス]]
* メモ
- [1] ''834489 - Internet Explorer で HTTP URL と HTTPS URL のユーザー情報を処理する際のデフォルトの動作を変更するソフトウェア アップデートのリリースについて'' : [[WinIE3]]+ で対応していた [CODE(URI)[[[http]]]] および [CODE(URI)[[[https]]]] の user:password@ は、見かけ上の URI 参照を偽装することができる脆弱性が見つかりました。その対策 ([[WinIE5]]〜[[WinIE6]] 対象) で、 user:password@ が既定ではまったく使えなくされました。
[2]
[CODE(URI)[[[dcp.tcp.pft]]:]] [[URI scheme]]
は [[RFC 2396]] 的には構文的に適当でしたが、
[[RFC 3986]] で駄目になっちゃいました。
[CITE[[#XERCESJ-1060] anyURI validation is too strict - ASF JIRA]]
[CITE[Reg-name conflict between 2396 and 3986]]
([[名無しさん]])
[3]
[CITE[Computer Security Research - McAfee Avert Labs Blog]] ([CODE[2007-01-23 20:48:55 +09:00]] 版)
([[名無しさん]] [WEAK[2007-01-23 11:55:04 +00:00]])
[4]
[CITE[ITmedia エンタープライズ:8進数や16進数で検出回避する新手のスパム]] ([CODE[2007-01-23 20:46:26 +09:00]] 版)
([[名無しさん]] [WEAK[2007-01-23 11:55:38 +00:00]])
[5]
[CITE@en[IEBlog : URLs in Internet Explorer 7]] ([CODE[2007-02-22 09:21:45 +09:00]] 版)
([[名無しさん]] [WEAK[2007-02-22 00:24:26 +00:00]])
[6]
[CITE@en-us[IP Version 6 Support]] ([CODE[2007-02-22 09:23:49 +09:00]] 版)
([[名無しさん]] [WEAK[2007-02-22 00:24:58 +00:00]])
[7]
[CITE@en[IEBlog : IPv6 URIs in IE7]] ([CODE[2007-02-22 09:21:53 +09:00]] 版)
([[名無しさん]] [WEAK[2007-02-22 00:30:32 +00:00]])
[8]
[CITE@ja[Internet Explorer では Web サイト アドレス (HTTP URL および HTTPS URL) に含まれるユーザー名およびパスワードがサポートされない]] ([TIME[2009-04-12 12:20:01 +09:00]] 版)
[402] [CITE[IRC logs: freenode / #whatwg / 20100423]]
([TIME[2010-05-09 21:36:01 +09:00]] 版)
[404] [CITE@en[ドット付き 10 進数 URL の不明瞭化 | Symantec Connect Community]]
( ([TIME[2011-05-15 13:47:42 +09:00]] 版))
[405] [CITE[IPアドレスによるURL偽装手法まとめ | Rubusig]]
( ([TIME[2011-05-15 13:56:45 +09:00]] 版))
[406] [CITE@ja-JP[変なIPに書き換えても繋がるかテスト]]
( ([TIME[2011-05-15 15:55:28 +09:00]] 版))