couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject [04/11] chttpd commit: updated refs/heads/master to 238b8c4
Date Wed, 12 Aug 2015 15:54:28 GMT
Add `chttpd_auth:authorize/2` hook


Project: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/commit/cf58b04e
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/tree/cf58b04e
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/diff/cf58b04e

Branch: refs/heads/master
Commit: cf58b04e96fde0ba012a2aa339f9dc322c2d2f4e
Parents: 8d0fe1c
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Wed Jul 29 10:15:50 2015 -0700
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Tue Aug 11 09:14:28 2015 -0700

----------------------------------------------------------------------
 src/chttpd.erl      | 4 +++-
 src/chttpd_auth.erl | 4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/cf58b04e/src/chttpd.erl
----------------------------------------------------------------------
diff --git a/src/chttpd.erl b/src/chttpd.erl
index d1e07e9..215f509 100644
--- a/src/chttpd.erl
+++ b/src/chttpd.erl
@@ -220,7 +220,9 @@ handle_request_int(MochiReq) ->
             #httpd{} = Req ->
                 HandlerFun = chttpd_handlers:url_handler(
                     HandlerKey, fun chttpd_db:handle_request/1),
-                HandlerFun(chttpd_auth_request:authorize_request(possibly_hack(Req)));
+                AuthorizedReq = chttpd_auth:authorize(possibly_hack(Req),
+                    fun chttpd_auth_request:authorize_request/1),
+                HandlerFun(AuthorizedReq);
             Response ->
                 Response
             end;

http://git-wip-us.apache.org/repos/asf/couchdb-chttpd/blob/cf58b04e/src/chttpd_auth.erl
----------------------------------------------------------------------
diff --git a/src/chttpd_auth.erl b/src/chttpd_auth.erl
index 6683892..35a4bd5 100644
--- a/src/chttpd_auth.erl
+++ b/src/chttpd_auth.erl
@@ -13,6 +13,7 @@
 -module(chttpd_auth).
 
 -export([authenticate/2]).
+-export([authorize/2]).
 
 -export([default_authentication_handler/1]).
 -export([cookie_authentication_handler/1]).
@@ -32,6 +33,9 @@
 authenticate(HttpReq, Default) ->
     maybe_handle(authenticate, [HttpReq], Default).
 
+authorize(HttpReq, Default) ->
+    maybe_handle(authorize, [HttpReq], Default).
+
 
 %% ------------------------------------------------------------------
 %% Default callbacks


Mime
View raw message