[PATCH] compliance with section 9.2.3 of RFC 3920 (IQ Semantics)
Peter Saint-Andre
stpeter at jabber.org
Wed Jan 17 16:32:14 UTC 2007
Pedro Melo wrote:
> Hi,
>
> On Jan 16, 2007, at 8:56 PM, Peter Saint-Andre wrote:
>> Pedro Melo wrote:
>>> Hi,
>>> On Jan 13, 2007, at 12:50 PM, Martin Atkins wrote:
>>>> Pedro Melo wrote:
>>>>> Hi,
>>>>> See http://rfc.net/rfc3920.html#s9. for reference, search for 9.2.3.
>>>>> Basically, to match an IQ with a semantic meaning, we must look at
>>>>> the namespace and not at the tag the first child is using. The
>>>>> relevant text of the RFC:
>>>>> "The data content of the request and response is defined by the
>>>>> namespace
>>>>> declaration of a direct child element of the IQ element"
>>>>> That means for example, that as long as I use xmlns='vcard-temp' in
>>>>> the first child, the tag name can be vCard, query, or even
>>>>> sometagnobodyneedstoknow.
>>>>> The attached patch fixes the signature method of the IQ class, and
>>>>> changes all the occurences of a set/get-{ns}tag I could find.
>>>>
>>>> Hmm.
>>>>
>>>> While I agree with you that the XMPP RFC section you referenced
>>>> gives the impression that the element's local name is to be
>>>> disregarded, I'm not convinced that this was the intention.
>>> Well, when we question the intention, the better way to solve it is
>>> to question the author :)
>>> Peter, can you weight in on this? When matching IQ's, should we just
>>> use the namespace or is the node name also relevant?
>>
>> The primary identifier is the namespace, by which we really mean the
>> schema associated with the namespace. Naturally there may be different
>> elements qualified by that namespace, which have different semantics,
>> so IMHO it is probably most accurate to say:
>>
>> The data content of the request and response is defined by the
>> schema or other structural definition associated with the XML
>> namespace that qualifies the direct child element of the IQ
>> element.
>
> Ah, ok. So if someone for example sends:
>
> <iq type="get" id="1" to="melo at simplicidade.org">
> <query xmlns="vcard-temp" />
> </iq>
>
> the server should return not found, then? Because the vcard-temp schema
> would say <vCard> must be used?
Well, it depends on how much you believe in Postel's Law -- be
conservative in what you send and liberal in what you accept. :)
Peter
--
Peter Saint-Andre
XMPP Standards Foundation
http://www.xmpp.org/xsf/people/stpeter.shtml
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 7358 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.danga.com/pipermail/djabberd/attachments/20070117/4a072250/smime.bin
More information about the Djabberd
mailing list