Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3999518
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:40:03+00:00 2026-05-20T07:40:03+00:00

I spent a long time yesterday to configure for my CouchDB instance in order

  • 0

I spent a long time yesterday to configure for my CouchDB instance in order to create a little app and letting CouchDB manage authentication and authorizations for me.

So I ended up with something like that :

On top of everything I’ve got a server admin, who basically is god on my CouchBD instance.

Then I created a database named “mydatabase” (for example) and added the role “mydatabase_dba” as admin and also the role “mydatabase_user” as reader.

I also created a database named “_users” which contains all the database admins and users with their roles and also a design document named “_auth” which manages authorizations.

Only the server admin is admin of this database, and I added users with role “mydatabase_dba” as readers. Then, for those of you who knows about it, I modified the “validate_doc_update” field o the “_auth” document so that users with role “mydatabase_dba” can only deals with users with role “mydatabase_user”.

So, to summarize at this point :

  • server admin is still god
  • users with role “mydatabase_user” can connect to “mydatabase” but they are just readers
  • users with role “mydatabase_dba” are admins of “mydatabase”
  • users with role “mydatabase_dba” can connect to database “_users” where they are readers
  • users with role “mydatabase_dba” can only manage users of role “mydatabase_user” in “_users”

Hope this is clear 😀

What I can do now is create an application that will not manage users itself, but let users connect to CouchDB directly (transparently).

The problem come when it deals with users creation/update/deletion.

Because only users with role “mydatabase_dba” can access to the “_users” database and work on users with roles “mydatabase_user”, I need at some point to connect to CouchDB as this db admin.

I have two solutions :

  • Create a user interface into my app that will let the admin connect and do what he has to do

or

  • Make some more code and let the app do it automatically, this is the solution I prefer, but the problem is : I have to store the admin credentials…

Sorry for the long introduction but I had to describe the landscape first 🙂

I created a post yesterday about how I could secure the connection between my app and the CouchDB instance : here

The solution I was given is to use HTTP over SSL (/TLS) to secure the communication. I’m okay with that, but now I have another concern, maybe I’m paranoid, but because my app will need to connect as “mydatabase_dba”, I have to store its credential somewhere.

But how to store them securely ? As said in my previous post, even if I store the hashed password instead of the plain text password, if an attacker access my app source code, he’ll have my admin credentials…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:40:03+00:00Added an answer on May 20, 2026 at 7:40 am

    An application should never have an administrative rights. It should only be given the bare minim rights it needs to function. If the application needs some administrative rights, make sure it has as few as possible. Other than that, most of the time these credentials are stored in plain text in some file that only your application can access.

    Never commit this text file into your source code manager (Subversion, Git, etc.)! Placing the file into a running system must be a step in the installation procedure.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

yesterday I spent some time trying to find a bug. Long story short, finally
I've spent a long time building stochastic simulations in Java. They work great, but
I spent a long time learning how to customise WCF from the point of
I just spent a very long time debugging an issue in python, using the
It's been a very long time since I coded in C, and I've spent
I've just spent a long time trying to figure out why my Javascript for()
Uploading a Magento install I have spent a long time building a store with
I have spent hours trying to work this out, and spent a long time
I spent a very long time trying to locate the error but I can't
I have some questions about cakePHP, I spent long time Googling for a solution

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.