Subject: [Simple] Response to an Invalid XCAP URI?

From: "Eduardo Martins" <[email-masked]>
Date: Sun, 4 Mar 2007 21:12:20 +0000

Hi all, I have some doubts on what response error should be returned, by the
server, when it receives a request with an invalid resource selector.

Possible reasons for an invalid xcap uri:

1. Invalid document selector or node selector

draft says, in Server Behavior:

"... When the server receives a request, the treatment depends on the URI.
  If the URI refers to an application usage not understood by the
  server, the server MUST reject the request with a 404 (Not Found)
  response.  If the URI refers to a user that is not recognized by the
  server, it MUST reject the request with a 404 (Not Found).

... Next, the server makes sure that it can properly evaluate the request
   URI.  The server MUST check the node selector in the request URI, if
   present.  If any qualified names are present that use a namespace
   prefix, and that prefix is not defined in an xmlns() expression in
   the query component of the request URI, the server MUST reject the
   request with a 400 response.
"
So what should be returned if after the auid comes something else besides
global or users?

then in PUT handling

"  ... The first step the server performs is to locate the parent, whether
   it is a directory or element, in which the resource is to be placed.
   To do that, the server removes the last path segment from the URI.
   The rest of the URI refers to the parent.  This parent can be a
   document, element, or prefix of a document selector (called a
   directory, even though this specification does not mandate that
   documents are actually stored in a filesystem).  This URI is called
   the parent URI.  The path segment that was removed is called the
   target selector, and the node (element, document or attribute) it
   describes is called the target node.

   ... If the parent URI has a node selector separator, the document
   selector is extracted, and that document is retrieved.  If the
   document does not exist, the server MUST return a 409 response, and
   SHOULD include a detailed conflict report including the <no-parent>
   element.  If it does exist, the node selector is extracted, and
   decoded (recall that the node selector is percent-encoded).  The node
   selector is applied to the document based on the matching operations
   discussed in Section 6.3.  If the result is a no-match or invalid,
   the server MUST return a 409 response, and SHOULD include a detailed
   conflict report including the <no-parent> element."

This mean that if an invalid node selector is received the server should
find an
existing ancestor.

As an example, consider a node selector like

/resource-lists//list[@id='example']

Considering also that resource-lists exists in the document this means it
will
return it as the ancestor, but I'm not sure it such a reply would make sense
to the client.
Wouldn't be better to have an invalid URI XCAP error?

Now lets check the GET handling:

"... If the request URI contains a node selector, the server obtains the
   document specified by the document selector, and if it is found,
   evaluates the node-selector within that document.  If no document is
   found, or if the node-selector is a no-match or invalid, the server
   returns a 404 response."

then in DELETE handling:

"... If the request URI contains only a document selector, the server
   deletes the document specified by the URI if it exists and returns a
   200 OK, else returns a 404 response.

   If the request URI contains a node selector, the server obtains the
   document specified by the document selector, and if it is found,
   evaluates the node-selector within that document.  If no document is
   found, or if the node-selector is a no-match or invalid (note that it
   will be invalid if multiple elements or attributes are selected), the
   server returns a 404 response."

Ok, for GET and DELETE the error on an invalid document and node selector
it's always a 404.

2. Invalid query component

Nothing is said here, what would be the expected error for an xpointer diff
than xmlns?

Best regards,

Eduardo Martins
_______________________________________________
Simple mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/simple