Subject: Re: WebDAV methods: safe and idempotent

From: John Stracke <[email-masked]>
Date: Wed, 11 Aug 1999 14:20:51 -0400

Jim Whitehead wrote:

> Off-list, I was asked about the "idempotence" and "safety" of WebDAV
> methods [...] (Basically, "safe"
> = does not harm the state of the resource, "idempotent" = the effect of N >
> 0 identical requests is the same as a single request) [...]
>
> PROPFIND: safe, idempotent
> PROPPATCH: unsafe, idempotent

...*provided* you're not using any funky live properties.  Live properties are
behavior, not state, so they have safeness and idempotency, too.  So, really,
you have to assume that both PROPFIND and PROPPATCH are unsafe and
non-idempotent unless you know the safeness and idempotency of all the
properties in use.

(This is the same issue as CGIs in base HTTP/1.1; a CGI script could be built
that reacts unsafely to GET, but it wouldn't be HTTP/1.1-compliant; it's
supposed to use POST if it's unsafe.  But we don't have PROPFIND-GET and
PROPFIND-POST.)

--
/=============================================================\
|John Stracke    | My opinions are my own | S/MIME & HTML OK  |
[email-masked]|============================================|
|Chief Scientist | NT's lack of reliability is only surpassed |
|eCal Corp.      |  by its lack of scalability. -- John Kirch |
\=============================================================/

---

From: "Larry Masinter" <[email-masked]>
Date: Fri, 13 Aug 1999 12:26:47 PDT

> non-idempotent unless you know the safeness and idempotency of all the

I think it's more appropriate to define 'live properties' such that
they have the same relationship to safety and idempotency of PROPFIND
and PROPPATCH as 'resources' have to GET and PUT. That is:

 even though the property is live, PROPFIND of any property
SHOULD be safe and idempotent, and PROPPATCH should be idempotent.

> supposed to use POST if it's unsafe.  But we don't have PROPFIND-GET and

We should make the correspondence of PROPFIND-GET and PROPPATCH-PUT
(not POST). Not having done so is an flaw in the WebDAV spec that
SHOULD be corrected, not celebrated.

Larry

---

From: Jim Whitehead <[email-masked]>
Date: Sun, 15 Aug 1999 16:12:52 -0700

Since some systems allow GET to perform non-safe, non-idempotent operations
via URL munging (e.g., http://www.docmgmtsys.com/doc-guid;action=CHECKOUT)
it seems to me the best a spec. can do is state what the intended behavior
is wrt safety and idempotence, and assume that people won't break it without
a very good reason.

- Jim

---

From: "Larry Masinter" <[email-masked]>
Date: Sun, 15 Aug 1999 17:04:42 PDT

> is wrt safety and idempotence, and assume that people won't break it without

Yes, PROPFIND SHOULD be safe and idempotent, and PROPPATCH SHOULD be
idempotent, under the sense of SHOULD (from RFC 2119):

3. SHOULD   This word, or the adjective "RECOMMENDED", mean that there
   may exist valid reasons in particular circumstances to ignore a
   particular item, but the full implications must be understood and
   carefully weighed before choosing a different course.

in the same way that HTTP 1.1 identifies this for GET and HEAD in RFC 2616:

   In particular, the convention has been established that the GET and
   HEAD methods SHOULD NOT have the significance of taking an action
   other than retrieval. These methods ought to be considered "safe".
   This allows user agents to represent other methods, such as POST, PUT
   and DELETE, in a special way, so that the user is made aware of the
   fact that a possibly unsafe action is being requested.

   Naturally, it is not possible to ensure that the server does not
   generate side-effects as a result of performing a GET request; in
   fact, some dynamic resources consider that a feature. The important
   distinction here is that the user did not request the side-effects,
   so therefore cannot be held accountable for them.

....