On Fri, Sep 28, 2012 at 12:32 PM, <[email protected]> wrote:
> Updated Branches:
> refs/heads/master 03598c2f4 -> ac3204790
>
>
> COUCHDB-1537 Include user_ctx.name in show/list ETag
>
>
> Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
> Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/ac320479
> Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/ac320479
> Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/ac320479
>
> Branch: refs/heads/master
> Commit: ac320479035ac7a844686f2efb5b314baa33e14c
> Parents: 03598c2
> Author: Robert Newson <[email protected]>
> Authored: Fri Sep 28 18:17:46 2012 +0100
> Committer: Robert Newson <[email protected]>
> Committed: Fri Sep 28 18:19:18 2012 +0100
>
> ----------------------------------------------------------------------
> CHANGES | 1 +
> NEWS | 1 +
> src/couch_mrview/src/couch_mrview_show.erl | 5 +++--
> 3 files changed, 5 insertions(+), 2 deletions(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/couchdb/blob/ac320479/CHANGES
> ----------------------------------------------------------------------
> diff --git a/CHANGES b/CHANGES
> index 94f2c17..f2b5ca9 100644
> --- a/CHANGES
> +++ b/CHANGES
> @@ -20,6 +20,7 @@ HTTP Interface:
> * Added Server-Sent Events protocol to db changes API.
> See http://www.w3.org/TR/eventsource/ for details.
> * Make password hashing synchronous when using the /_config/admins API.
> + * Include user name in show/list ETags.
>
> Storage System:
>
>
> http://git-wip-us.apache.org/repos/asf/couchdb/blob/ac320479/NEWS
> ----------------------------------------------------------------------
> diff --git a/NEWS b/NEWS
> index 08088a7..2abf0d5 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -24,6 +24,7 @@ This version has not been released yet.
> * Make password hashing synchronous when using the /_config/admins API.
> * Added utc_id UUID algorithm.
> * encode database name during URL rewriting.
> + * Include user name in show/list ETags.
>
> Version 1.2.1
> -------------
>
> http://git-wip-us.apache.org/repos/asf/couchdb/blob/ac320479/src/couch_mrview/src/couch_mrview_show.erl
> ----------------------------------------------------------------------
> diff --git a/src/couch_mrview/src/couch_mrview_show.erl
> b/src/couch_mrview/src/couch_mrview_show.erl
> index 426b431..3bfa035 100644
> --- a/src/couch_mrview/src/couch_mrview_show.erl
> +++ b/src/couch_mrview/src/couch_mrview_show.erl
> @@ -99,7 +99,7 @@ show_etag(#httpd{user_ctx=UserCtx}=Req, Doc, DDoc, More) ->
> Doc -> couch_httpd:doc_etag(Doc)
> end,
> couch_httpd:make_etag({couch_httpd:doc_etag(DDoc), DocPart, Accept,
> - UserCtx#user_ctx.roles, More}).
> + {UserCtx#user_ctx.name, UserCtx#user_ctx.roles}, More}).
>
Why not just use the whole UserCtx?
> % updates a doc based on a request
> % handle_doc_update_req(#httpd{method = 'GET'}=Req, _Db, _DDoc) ->
> @@ -191,9 +191,10 @@ handle_view_list(Req, Db, DDoc, LName, VDDoc, VName,
> Keys) ->
> Args0 = couch_mrview_http:parse_qs(Req, Keys),
> ETagFun = fun(BaseSig, Acc0) ->
> UserCtx = Req#httpd.user_ctx,
> + Name = UserCtx#user_ctx.name,
> Roles = UserCtx#user_ctx.roles,
> Accept = couch_httpd:header_value(Req, "Accept"),
> - Parts = {couch_httpd:doc_etag(DDoc), Accept, Roles},
> + Parts = {couch_httpd:doc_etag(DDoc), Accept, {Name, Roles}},
> ETag = couch_httpd:make_etag({BaseSig, Parts}),
> case couch_httpd:etag_match(Req, ETag) of
> true -> throw({etag_match, ETag});
>