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

CLI tools should take username/password from the environment.

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: Legacy C++ Implementation
    • Component/s: All Tools

      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.

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

              Created:
              Updated:
              Resolved: