Return-Path: X-Original-To: apmail-couchdb-commits-archive@www.apache.org Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AAF2DC157 for ; Fri, 14 Jun 2013 08:25:25 +0000 (UTC) Received: (qmail 87683 invoked by uid 500); 14 Jun 2013 08:25:11 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 87221 invoked by uid 500); 14 Jun 2013 08:25:10 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 85710 invoked by uid 99); 14 Jun 2013 08:25:00 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jun 2013 08:25:00 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id ECC34816C37; Fri, 14 Jun 2013 08:24:58 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: kxepal@apache.org To: commits@couchdb.apache.org Date: Fri, 14 Jun 2013 08:25:15 -0000 Message-Id: <2e727fdb330c4966aeec77548415c2d8@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [18/32] git commit: updated refs/heads/1781-reorganize-and-improve-docs to 11fd32a Describe oauth and couch_httpd_oauth config sections. Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/16defb18 Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/16defb18 Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/16defb18 Branch: refs/heads/1781-reorganize-and-improve-docs Commit: 16defb18dd0b88fb1bfbecff35cd2f0b761e40f4 Parents: 0037292 Author: Alexander Shorin Authored: Wed Jun 12 15:21:08 2013 +0400 Committer: Alexander Shorin Committed: Wed Jun 12 16:06:30 2013 +0400 ---------------------------------------------------------------------- share/doc/build/Makefile.am | 3 ++ share/doc/src/config/index.rst | 1 + share/doc/src/config/oauth.rst | 90 +++++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/16defb18/share/doc/build/Makefile.am ---------------------------------------------------------------------- diff --git a/share/doc/build/Makefile.am b/share/doc/build/Makefile.am index d1baa84..d9bb43d 100644 --- a/share/doc/build/Makefile.am +++ b/share/doc/build/Makefile.am @@ -64,6 +64,7 @@ html_files = \ html/_sources/config/httpd.txt \ html/_sources/config/index.txt \ html/_sources/config/native-query-servers.txt \ + html/_sources/config/oauth.txt \ html/_sources/config/os-daemons.txt \ html/_sources/config/query-servers.txt \ html/_sources/config/replicator.txt \ @@ -127,6 +128,7 @@ html_files = \ html/config/httpd.html \ html/config/index.html \ html/config/native-query-servers.html \ + html/config/oauth.html \ html/config/os-daemons.html \ html/config/query-servers.html \ html/config/replicator.html \ @@ -188,6 +190,7 @@ src_files = \ ../src/config/httpd.rst \ ../src/config/index.rst \ ../src/config/native-query-servers.rst \ + ../src/config/oauth.rst \ ../src/config/os-daemons.rst \ ../src/config/query-servers.rst \ ../src/config/replicator.rst \ http://git-wip-us.apache.org/repos/asf/couchdb/blob/16defb18/share/doc/src/config/index.rst ---------------------------------------------------------------------- diff --git a/share/doc/src/config/index.rst b/share/doc/src/config/index.rst index 2eec13c..0cf0da4 100644 --- a/share/doc/src/config/index.rst +++ b/share/doc/src/config/index.rst @@ -57,6 +57,7 @@ Content: daemons httpd native-query-servers + oauth os-daemons query-servers replicator http://git-wip-us.apache.org/repos/asf/couchdb/blob/16defb18/share/doc/src/config/oauth.rst ---------------------------------------------------------------------- diff --git a/share/doc/src/config/oauth.rst b/share/doc/src/config/oauth.rst new file mode 100644 index 0000000..91bc276 --- /dev/null +++ b/share/doc/src/config/oauth.rst @@ -0,0 +1,90 @@ +.. Licensed under the Apache License, Version 2.0 (the "License"); you may not +.. use this file except in compliance with the License. You may obtain a copy of +.. the License at +.. +.. http://www.apache.org/licenses/LICENSE-2.0 +.. +.. Unless required by applicable law or agreed to in writing, software +.. distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +.. WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +.. License for the specific language governing permissions and limitations under +.. the License. + +.. highlight:: ini + +.. _config/oauth: + +``[oauth]`` :: OAuth Configuration +================================== + +.. _config/oauth/oauth_consumer_secrets: +.. _config/oauth/oauth_token_secrets: +.. _config/oauth/oauth_token_users: + +Store credentials within config +------------------------------- + +To let users be authenticated by `OAuth` (:rfc:`5849`) method there is need to +setup three special sections in :ref:`configuration ` file: + +1. Consumer secret: + +:: + + [oauth_consumer_secrets] + example.com = sekr1t + +2. Token secrets: + +:: + + [oauth_token_secrets] + token1 = tokensekr1t + +3. Tokens to users mapping: + +:: + + [oauth_token_users] + token1 = couchdb_username + + +.. _config/couch_httpd_oauth: +.. _config/couch_httpd_oauth/use_users_db: + +Store OAuth credentials within auth database +-------------------------------------------- + +.. versionadded:: 1.2: CouchDB is able to store OAuth credentials within users + documents instead of config file. + +:: + + [couch_httpd_oauth] + use_users_db = true + +If set to ``true``, OAuth token and consumer secrets will be looked up +in the authentication database (``_user``). These secrets are stored in +a top level field named ``"oauth"`` in user documents. Example: + +.. code-block:: javascript + + { + "_id": "org.couchdb.user:joe", + "type": "user", + "name": "joe", + "password_sha": "fe95df1ca59a9b567bdca5cbaf8412abd6e06121", + "salt": "4e170ffeb6f34daecfd814dfb4001a73" + "roles": ["foo", "bar"], + "oauth": { + "consumer_keys": { + "consumerKey1": "key1Secret", + "consumerKey2": "key2Secret" + }, + "tokens": { + "token1": "token1Secret", + "token2": "token2Secret" + } + } + } +