<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="6" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[6]</anchor-end> <dfn><code class="URI" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">opaquelocktoken:</anchor></code></dfn> は、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ロック</anchor>を表す <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">URL</anchor>
に使うことができる <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">URL scheme</anchor> です。</p><section><h1>仕様書</h1><refs xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><ul xmlns="http://www.w3.org/1999/xhtml"><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[5]</anchor-end> <strong><cite xml:lang="en">RFC 4918 - HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)</cite> (<time>2014-09-21 17:04:59 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://tools.ietf.org/html/rfc4918#appendix-C">http://tools.ietf.org/html/rfc4918#appendix-C</anchor-external></strong></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="16" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[16]</anchor-end> <cite xml:lang="en">RFC 4918 - HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)</cite> (<time>2014-09-21 17:04:59 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://tools.ietf.org/html/rfc4918#section-6.5">http://tools.ietf.org/html/rfc4918#section-6.5</anchor-external></li></ul></refs></section><section><h1>意味</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[7]</anchor-end> <code class="URI" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">opaquelocktoken:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">URL scheme</anchor> は、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">UUID</anchor> から構文的に正しく生成しやすい <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">URL</anchor> を作り、
すべての<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">資源</anchor>にわたってすべての<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">時間</anchor>に関して固有である<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ロックトークン</anchor>として使うために定義されたものです <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;5</anchor-internal></src>。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="8" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[8]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 2518</anchor> で標準的な方法として規定されていましたが、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 4918</anchor> では <code class="URI" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">urn:uuid:</anchor></code> が<rubyb xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">推奨<rt xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">encourage</rt></rubyb>
<src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="16" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;16</anchor-internal></src> されているようで、
<code class="URI" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">opaquelocktoken:</anchor></code> は代替として定義されているに過ぎません。</p></section><section><h1>構文</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[9]</anchor-end> <code class="URI" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">opaquelocktoken:</anchor></code> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">URL</anchor> は、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">URL scheme</anchor>、<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">UUID</anchor>、省略可能な<rubyb xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">拡張<rt xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">extension</rt></rubyb>により構成されます
<src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;5</anchor-internal></src>。</p><figure class="railroad"><ol><li><code class="URI" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">opaquelocktoken:</anchor></code></li><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">UUID</anchor></li><li>?<ol><li><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">パス</anchor></li></ol></li></ol></figure><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="10" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[10]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">UUID</anchor> は、 <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 4122</anchor> 第3章の定義が参照されています <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;5</anchor-internal></src>。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="12" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[12]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ロックトークン</anchor>それぞれに新しい <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">UUID</anchor> を作ることができます <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;5</anchor-internal></src>。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="11" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[11]</anchor-end> 拡張は、 <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">RFC 3986</anchor> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">パス</anchor>です <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;5</anchor-internal></src>。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="13" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[13]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>は <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">UUID</anchor> を再利用する場合には、拡張を追加しなければ<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">なりません</strong></anchor>。
同じ拡張をもう一度使うことがないよう保証する方法を使わなければ<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><strong xmlns="http://www.w3.org/1999/xhtml">なりません</strong></anchor>。 <src xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-internal xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">&gt;&gt;5</anchor-internal></src></p></section><section><h1>処理</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="14" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[14]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ロックトークン</anchor>は<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">不透明</anchor>な文字列として処理されることになっていて、
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">クライアント</anchor>その他の受信者が <code class="URI" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">opaquelocktoken:</anchor></code>
<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">URL</anchor> を構文解析して処理することは想定されていません。</p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="15" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[15]</anchor-end> <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>は、自身が発行した<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ロックトークン</anchor>を何らかの方法で解釈して<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ロック</anchor>を識別するよう実装することもできますが、
だとしても特定の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>の内部の実装に限られた話であり、その方法は規定されていませんし、
他の<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">鯖</anchor>で発行した<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">ロックトークン</anchor>をその方法で解釈できる保証はまったくありません。</p></section><section><h1>歴史</h1><figure class="quote"><figcaption><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[4]</anchor-end> RFC 2518 (WebDAV) 6.4 opaquelocktoken Lock Token URI Scheme</p></figcaption><blockquote><p>The opaquelocktoken URI scheme is designed to be unique across all
resources for all time.  Due to this uniqueness quality, a client may
submit an opaque lock token in an If header on a resource other than
the one that returned it.</p></blockquote><p><code class="URI">opaquelocktoken</code> URI
scheme は、全ての資源が全ての時刻に渡って固有であるように設計されています。
この固有性の品質のために、
クライアントは <code class="HTTP">If</code>
頭中の不透明固定字句をそれが返された資源以外の資源に送信してもかまいません。</p><blockquote><p>All resources MUST recognize the opaquelocktoken scheme and, at
minimum, recognize that the lock token does not refer to an
outstanding lock on the resource.</p></blockquote><p>全ての資源は
<code class="URI">opaquelocktoken</code> scheme
を認識し、少なくてもその固定字句がその資源についての未解決固定を参照していないことを認識しなければ<strong>なりません</strong>。</p><blockquote><p>In order to guarantee uniqueness across all resources for all time
the opaquelocktoken requires the use of the Universal Unique
Identifier (UUID) mechanism, as described in [ISO-11578].</p></blockquote><p>全ての資源の全ての時刻についての固有性を保証するために、
<code class="URI">opaquelocktoken</code>
は ISO 11578 で説明されている普遍固有識別子
(<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">UUID</anchor>) の使用を必要とします。</p><blockquote><p>Opaquelocktoken generators, however, have a choice of how they create
these tokens.  They can either generate a new UUID for every lock
token they create or they can create a single UUID  and then add
extension characters.  If the second method is selected then the
program generating the extensions MUST guarantee that the same
extension will never be used twice with the associated UUID.</p></blockquote><p>しかし、 <code class="URI">opaquelocktoken</code>
の生成者はこれらの字句をどう生成するかを選択できます。
生成者はその生成する各固定字句毎に
UUID を生成しても構いませんし、単一の
UUID を生成して拡張文字を加えても構いません。
二番目の方法を選択するときは、
拡張を生成する応用は関連付けられた
UUID に対して同じ拡張が二度と使われないことを保証しなければ<strong>なりません</strong>。</p><blockquote><ul><li>OpaqueLockToken-URI = &quot;opaquelocktoken:&quot; UUID [Extension]  ; The UUID production is the string representation of a UUID, as defined in [ISO-11578]. Note that white space (LWS) is not allowed between elements of this production.</li><li>Extension = path  ; path is defined in section 3.2.1 of RFC 2068 [RFC2068]</li></ul></blockquote><section><h1>6.4.1 Node Field Generation Without the IEEE 802 Address</h1><blockquote><p>UUIDs, as defined in [ISO-11578], contain a &quot;node&quot; field that
contains one of the IEEE 802 addresses for the server machine.  As
noted in section 17.8, there are several security risks associated
with exposing a machine's IEEE 802 address. This section provides an
alternate mechanism for generating the &quot;node&quot; field of a UUID which
does not employ an IEEE 802 address.  WebDAV servers MAY use this
algorithm for creating the node field when generating UUIDs.  The
text in this section is originally from an Internet-Draft by Paul
Leach and Rich Salz, who are noted here to properly attribute their
work.</p></blockquote><p>(要約) <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">IEEE802</anchor> address
を使いたくないなら、この代案を使え。</p><blockquote><p>The ideal solution is to obtain a 47 bit cryptographic quality random
number, and use it as the low 47 bits of the node ID, with the most
significant bit of the first octet of the node ID set to 1.  This bit
is the unicast/multicast bit, which will never be set in IEEE 802
addresses obtained from network cards; hence, there can never be a
conflict between UUIDs generated by machines with and without network
cards.</p></blockquote><p>(要約) 乱数の最上位ビットを 1
にすれば 802 アドレスから生成した
UUID と絶対衝突しない。</p><blockquote><p>If a system does not have a primitive to generate cryptographic
quality random numbers, then in most systems there are usually a
fairly large number of sources of randomness available from which one
can be generated. Such sources are system specific, but often
include:</p></blockquote><p>(要約) 乱数源の例:</p><pre>     - the percent of memory in use
     - the size of main memory in bytes
     - the amount of free main memory in bytes
     - the size of the paging or swap file in bytes
     - free bytes of paging or swap file
     - the total size of user virtual address space in bytes
     - the total available user address space bytes
     - the size of boot disk drive in bytes
     - the free disk space on boot drive in bytes
     - the current time
     - the amount of time since the system booted
     - the individual sizes of files in various system directories
     - the creation, last read, and modification times of files in
       various system directories
     - the utilization factors of various system resources (heap, etc.)
     - current mouse cursor position
     - current caret position
     - current number of running processes, threads
     - handles or IDs of the desktop window and the active window
     - the value of stack pointer of the caller
     - the process and thread ID of caller
     - various processor architecture specific performance counters
       (instructions executed, cache misses, TLB misses)</pre><blockquote><p>(Note that it is precisely the above kinds of sources of randomness
that are used to seed cryptographic quality random number generators
on systems without special hardware for their construction.)</p></blockquote><blockquote><p>In addition, items such as the computer's name and the name of the
operating system, while not strictly speaking random, will help
differentiate the results from those obtained by other systems.</p></blockquote><blockquote><p>The exact algorithm to generate a node ID using these data is system
specific, because both the data available and the functions to obtain
them are often very system specific. However, assuming that one can
concatenate all the values from the randomness sources into a buffer,
and that a cryptographic hash function such as MD5 is available, then
any 6 bytes of the MD5 hash of the buffer, with the multicast bit
(the high bit of the first byte) set will be an appropriately random
node ID.</p></blockquote><blockquote><p>Other hash functions, such as SHA-1, can also be used. The only
requirement is that the result be suitably random _ in the sense that
the outputs from a set uniformly distributed inputs are themselves
uniformly distributed, and that a single bit change in the input can
be expected to cause half of the output bits to change.</p></blockquote></section></figure></section><section><h1>メモ</h1><ul><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> 例: <samp class="URI"><anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="opaquelocktoken:f81d4fae-7dec-11d0-a765-00a0c91e6bf6">opaquelocktoken:f81d4fae-7dec-11d0-a765-00a0c91e6bf6</anchor-external></samp></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> <samp class="URI">opaquelocktoken:fe184f2e-6eec-41d0-c765-01adc56e6bb4</samp></li><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end> <samp class="URI">opaquelocktoken:e454f3f3-acdc-452a-56c7-00a5c91e4b77</samp></li></ul></section></body></html>