You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ja...@apache.org on 2018/07/13 17:49:12 UTC

[couchdb] branch master updated: hook up proxy auth handler to chttpd

This is an automated email from the ASF dual-hosted git repository.

jan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/couchdb.git


The following commit(s) were added to refs/heads/master by this push:
     new e928b88  hook up proxy auth handler to chttpd
e928b88 is described below

commit e928b886252467189909bea6721a173eb2695aac
Author: Jan Lehnardt <ja...@apache.org>
AuthorDate: Fri Jul 13 17:17:59 2018 +0200

    hook up proxy auth handler to chttpd
---
 rel/overlay/etc/default.ini    | 5 +++++
 src/chttpd/src/chttpd_auth.erl | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini
index 5f77e7b..0f0d547 100644
--- a/rel/overlay/etc/default.ini
+++ b/rel/overlay/etc/default.ini
@@ -93,6 +93,11 @@ prefer_minimal = Cache-Control, Content-Length, Content-Range, Content-Type, ETa
 ; _dbs_info in a request
 max_db_number_for_dbs_info_req = 100
 
+; authentication handlers
+; authentication_handlers = {chttpd_auth, cookie_authentication_handler}, {chttpd_auth, default_authentication_handler}
+; uncomment the next line to enable proxy authentication
+; authentication_handlers = {chttpd_auth, proxy_authentication_handler}, {chttpd_auth, cookie_authentication_handler}, {chttpd_auth, default_authentication_handler}
+
 [database_compaction]
 ; larger buffer sizes can originate smaller files
 doc_buffer_size = 524288 ; value in bytes
diff --git a/src/chttpd/src/chttpd_auth.erl b/src/chttpd/src/chttpd_auth.erl
index be12148..6602468 100644
--- a/src/chttpd/src/chttpd_auth.erl
+++ b/src/chttpd/src/chttpd_auth.erl
@@ -17,6 +17,7 @@
 
 -export([default_authentication_handler/1]).
 -export([cookie_authentication_handler/1]).
+-export([proxy_authentication_handler/1]).
 -export([party_mode_handler/1]).
 
 -export([handle_session_req/1]).
@@ -47,6 +48,9 @@ default_authentication_handler(Req) ->
 cookie_authentication_handler(Req) ->
     couch_httpd_auth:cookie_authentication_handler(Req, chttpd_auth_cache).
 
+proxy_authentication_handler(Req) ->
+    couch_httpd_auth:proxy_authentication_handler(Req).
+
 party_mode_handler(Req) ->
     case config:get("chttpd", "require_valid_user", "false") of
     "true" ->