Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-151

CLI tools should take username/password from the environment.

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed
    • Major - P3
    • Resolution: Won't Fix
    • Legacy C++ Implementation
    • None
    • All Tools

    Description

      The CLI tools (mongo, mongodump, mongorestore, etc) should look for the specific environment variables MONGODB_USERNAME and MONGODB_PASSWORD and authenticate to the database using that credential. If only MONGODB_PASSWORD is given in the environment variables, the CLI tools should use the username passed in on the command line and replace the password passed in on the command line and use the password from the environment variable instead.

      export MONGODB_USERNAME="my-mongodb-username"
      export MONGODB_PASSWORD="my-mongodb-password"
       
      host="example.com"
      port="27017"
      db="my-pile-of-data"
       
      mongo $host:$port/$db --quiet ~/some-advanced-mongo-script.js

      This way the username/password will never show up in the command-line of a process.

      Attachments

        Issue Links

          Activity

            People

              backlog-server-platform DO NOT USE - Backlog - Platform Team
              y_feldblum Jay Feldblum
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: