RFC6122

来自Jabber/XMPP中文翻译计划
(版本间的差异)
跳转到: 导航, 搜索
(术语)
(术语)
第54行: 第54行:
  
 
本文的关键字 "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", 和 "OPTIONAL" 的解释参见 RFC 2119 [[RFC6122#关键字|关键字]] .
 
本文的关键字 "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", 和 "OPTIONAL" 的解释参见 RFC 2119 [[RFC6122#关键字|关键字]] .
 +
 +
==地址==
 +
===基础===
 +
 +
一个XMPP实体就是任何可网址化并能使用XMPP通讯的东西. 由于历史原因, 一个XMPP实体的本地地址叫Jabber身份或JID. 一个合法的JID就是一个 [[RFC6122#UNICODE|UNICODE]] 代码所代表的字符串, 使用 [[RFC6122#UTF‑8|UTF‑8]] 编码, 结构顺序是 localpart(本地部分), domainpart(域部分), 和resourcepart (资源部分)(这里前两个部分使用 '@' 字符分割, 而后两个部分使用 '/' 字符分割).
 +
 +
The syntax for a JID is defined as follows using the Augmented Backus-Naur Form as specified in [ABNF] (Crocker, D., Ed. and P. Overell, “Augmented BNF for Syntax Specifications: ABNF,” January 2008.).
 +
 +
  jid          = [ localpart "@" ] domainpart [ "/" resourcepart ]
 +
  localpart    = 1*(nodepoint)
 +
                  ;
 +
                  ; a "nodepoint" is a UTF-8 encoded Unicode code
 +
                  ; point that satisfies the Nodeprep profile of
 +
                  ; stringprep
 +
                  ;
 +
  domainpart    = IP-literal / IPv4address / ifqdn
 +
                  ;
 +
                  ; the "IPv4address" and "IP-literal" rules are
 +
                  ; defined in RFC 3986, and the first-match-wins
 +
                  ; (a.k.a. "greedy") algorithm described in RFC
 +
                  ; 3986 applies to the matching process
 +
                  ;
 +
                  ; note well that reuse of the IP-literal rule
 +
                  ; from RFC 3986 implies that IPv6 addresses are
 +
                  ; enclosed in square brackets (i.e., beginning
 +
                  ; with '[' and ending with ']'), which was not
 +
                  ; the case in RFC 3920
 +
                  ;
 +
  ifqdn        = 1*(namepoint)
 +
                  ;
 +
                  ; a "namepoint" is a UTF-8 encoded Unicode
 +
                  ; code point that satisfies the Nameprep
 +
                  ; profile of stringprep
 +
                  ;
 +
  resourcepart  = 1*(resourcepoint)
 +
                  ;
 +
                  ; a "resourcepoint" is a UTF-8 encoded Unicode
 +
                  ; code point that satisfies the Resourceprep
 +
                  ; profile of stringprep
 +
                  ;
 +
 +
All JIDs are based on the foregoing structure.
 +
 +
Each allowable portion of a JID (localpart, domainpart, and resourcepart) MUST NOT be zero bytes in length and MUST NOT be more than 1023 bytes in length, resulting in a maximum total size (including the '@' and '/' separators) of 3071 bytes.
 +
 +
For the purpose of communication over an XMPP network (e.g., in the 'to' or 'from' address of an XMPP stanza), an entity's address MUST be represented as a JID, not as a Uniform Resource Identifier [URI] (Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI): Generic Syntax,” January 2005.) or Internationalized Resource Identifier [IRI] (Duerst, M. and M. Suignard, “Internationalized Resource Identifiers (IRIs),” January 2005.). An XMPP IRI [XMPP‑URI] (Saint-Andre, P., “Internationalized Resource Identifiers (IRIs) and Uniform Resource Identifiers (URIs) for the Extensible Messaging and Presence Protocol (XMPP),” February 2008.) is in essence a JID prepended with 'xmpp:'; however, the native addressing format used in XMPP is that of a mere JID without a URI scheme. [XMPP‑URI] (Saint-Andre, P., “Internationalized Resource Identifiers (IRIs) and Uniform Resource Identifiers (URIs) for the Extensible Messaging and Presence Protocol (XMPP),” February 2008.) is provided only for identification and interaction outside the context of XMPP itself, for example when linking to a JID from a web page. See [XMPP‑URI] (Saint-Andre, P., “Internationalized Resource Identifiers (IRIs) and Uniform Resource Identifiers (URIs) for the Extensible Messaging and Presence Protocol (XMPP),” February 2008.) for a description of the process for securely extracting a JID from an XMPP URI or IRI.
 +
 +
    Implementation Note: When dividing a JID into its component parts, an implementation needs to match the separator characters '@' and '/' before applying any transformation algorithms, which might decompose certain Unicode code points to the separator characters (e.g., U+FE6B SMALL COMMERCIAL AT might decompose into U+0040 COMMERCIAL AT).
 +
 +
===域部分===
 +
===本地部分===
 +
===资源部分===

2011年6月14日 (二) 07:21的版本


"本文的英文原文来自RFC 6122

互联网工程任务组(IETF) P. Saint-Andre
申请讨论: 6122 Cisco
更新: 3920 2011年3月
类别: 标准跟踪
ISSN: 2070-1721
可扩展的消息和出席信息协议 (XMPP): 地址格式

摘要

本文定义了可扩展的消息和出席信息协议(XMPP)中使用的地址的格式, 包括支持非ASCII的字符串. 本文更新了 RFC 3920.

本文的状态

这是一个互联网标准跟踪文档.
本文是互联网工程工作组(IETF)的一个成果. 它代表了IETF社区的一致意见. 它已经公开审核并由互联网工程控制组(IESG)批准发布了. 更多关于互联网标准的信息请参见RFC 5741第2章.
关于本文当前状态的信息, 任何错误, 以及如何对它提出反馈,请到 http://www.rfc-editor.org/info/rfc6122 .

版权通知

Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

目录

序论

概述

可扩展的消息和出席信息协议(XMPP)是一个 XML 应用规范,用于在任意两个或多个网络实体之间接近实时的传输XML数据流. XMPP实体的地址格式在1999年就已经 由Jabber开源社区开发出来, 第一次出现在 XEP‑0029 中是2002年, 规范化定义是2004年的 RFC3920 .

正如RFC 3920中所定义的, XMPP地址格式重用了 "stringprep" 技术来预备非ASCII字符串 STRINGPREP , 包括用于国际化域名的名字空间规范,定义于 NAMEPREPIDNA2003 ,对应于两个XMPP特有的用于 localpart(本地部分) 和resourcepart(资源部分)的规范.

由于RFC 3920的发布, IDNA2003被IDNA2008取代 (见 IDNA‑PROTO , 它不是基于stringprep的. 随着IDNA社区的倡导, 其他使用stringprep的技术社区开始讨论从stringprep迁移到更"现代的"方法. XMPP社区(主要是 PRECIS 工作组)为了寻找RFC3920中定义的stringprep中的Nodeprep和Resourceprep的替代品,参与了那些讨论. 因为XMPP修订文档的所有其他问题都合并到 XMPP 了, XMPP工作组决定暂时分离出XMPP地址格式到一个独立的文档,这样不会延迟改进的XMPP文档的发布. 一旦新的国际化地址的预备和比较方法被完成,预期本文将被废弃.

所以, 本协议提供更正过的XMPP地址格式文档,使用2004年可用的国际化技术(当时RFC 3920发布了). 尽管本文主要参考了 IDNA2003NAMEPREP , 但是鼓励XMPP软件开发者开始迁移到IDNA2008 (见 IDNA‑PROTO 以及相关文档) ,因为将来取代本协议的新协议将使用IDNA2008而不是IDNA2003.

本文更新了RFC 3920.

术语

本文使用的很多重要术语定义于 IDNA2003 , [RFC6122#STRINGPREP|STRINGPREP]] , UNICODE , 和XMPP .

本文的关键字 "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", 和 "OPTIONAL" 的解释参见 RFC 2119 关键字 .

地址

基础

一个XMPP实体就是任何可网址化并能使用XMPP通讯的东西. 由于历史原因, 一个XMPP实体的本地地址叫Jabber身份或JID. 一个合法的JID就是一个 UNICODE 代码所代表的字符串, 使用 UTF‑8 编码, 结构顺序是 localpart(本地部分), domainpart(域部分), 和resourcepart (资源部分)(这里前两个部分使用 '@' 字符分割, 而后两个部分使用 '/' 字符分割).

The syntax for a JID is defined as follows using the Augmented Backus-Naur Form as specified in [ABNF] (Crocker, D., Ed. and P. Overell, “Augmented BNF for Syntax Specifications: ABNF,” January 2008.).

  jid           = [ localpart "@" ] domainpart [ "/" resourcepart ]
  localpart     = 1*(nodepoint)
                  ;
                  ; a "nodepoint" is a UTF-8 encoded Unicode code
                  ; point that satisfies the Nodeprep profile of
                  ; stringprep
                  ;
  domainpart    = IP-literal / IPv4address / ifqdn
                  ;
                  ; the "IPv4address" and "IP-literal" rules are
                  ; defined in RFC 3986, and the first-match-wins
                  ; (a.k.a. "greedy") algorithm described in RFC
                  ; 3986 applies to the matching process
                  ;
                  ; note well that reuse of the IP-literal rule
                  ; from RFC 3986 implies that IPv6 addresses are
                  ; enclosed in square brackets (i.e., beginning
                  ; with '[' and ending with ']'), which was not
                  ; the case in RFC 3920
                  ;
  ifqdn         = 1*(namepoint)
                  ;
                  ; a "namepoint" is a UTF-8 encoded Unicode
                  ; code point that satisfies the Nameprep
                  ; profile of stringprep
                  ;
  resourcepart  = 1*(resourcepoint)
                  ;
                  ; a "resourcepoint" is a UTF-8 encoded Unicode
                  ; code point that satisfies the Resourceprep
                  ; profile of stringprep
                  ;

All JIDs are based on the foregoing structure.

Each allowable portion of a JID (localpart, domainpart, and resourcepart) MUST NOT be zero bytes in length and MUST NOT be more than 1023 bytes in length, resulting in a maximum total size (including the '@' and '/' separators) of 3071 bytes.

For the purpose of communication over an XMPP network (e.g., in the 'to' or 'from' address of an XMPP stanza), an entity's address MUST be represented as a JID, not as a Uniform Resource Identifier [URI] (Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI): Generic Syntax,” January 2005.) or Internationalized Resource Identifier [IRI] (Duerst, M. and M. Suignard, “Internationalized Resource Identifiers (IRIs),” January 2005.). An XMPP IRI [XMPP‑URI] (Saint-Andre, P., “Internationalized Resource Identifiers (IRIs) and Uniform Resource Identifiers (URIs) for the Extensible Messaging and Presence Protocol (XMPP),” February 2008.) is in essence a JID prepended with 'xmpp:'; however, the native addressing format used in XMPP is that of a mere JID without a URI scheme. [XMPP‑URI] (Saint-Andre, P., “Internationalized Resource Identifiers (IRIs) and Uniform Resource Identifiers (URIs) for the Extensible Messaging and Presence Protocol (XMPP),” February 2008.) is provided only for identification and interaction outside the context of XMPP itself, for example when linking to a JID from a web page. See [XMPP‑URI] (Saint-Andre, P., “Internationalized Resource Identifiers (IRIs) and Uniform Resource Identifiers (URIs) for the Extensible Messaging and Presence Protocol (XMPP),” February 2008.) for a description of the process for securely extracting a JID from an XMPP URI or IRI.

   Implementation Note: When dividing a JID into its component parts, an implementation needs to match the separator characters '@' and '/' before applying any transformation algorithms, which might decompose certain Unicode code points to the separator characters (e.g., U+FE6B SMALL COMMERCIAL AT might decompose into U+0040 COMMERCIAL AT).

域部分

本地部分

资源部分

个人工具