Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-9280

Exporting aggregation to language with driver syntax includes password in plaintext

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • No version
    • Affects Version/s: 1.46.0
    • Component/s: Export to Language
    • None
    • Environment:
      OS: macos 15.4
      node.js / npm versions:
      Additional info:
    • Not Needed
    • None
    • Developer Tools

      Problem Statement/Rationale

      When exporting an aggregation to a languauge, do not include password details in plain text.

      Steps to Reproduce

      1. Create an aggregation in the aggregation builder
      2. Click Export to languauge
      3. Ensure "Include Driver Syntax" is checked
      4. Copy paste the query to a slack channel and ask an admin to run it on a production server.
      5. Panic as you realize you've just pasted a password in plain text
      6. Edit the Slack message to remove the password.

      Expected Results

      The pasted driver syntax should not include a password. Perhaps MONGO_URI or `mongodb+srv://<username>:<password>@hostname.org/dbname`

      Actual Results

      A password in plain text.

      Additional Notes

      It would be helpful if we had `mongosh` as a driver language since the existing export left hand side doesn't include `db['collectionName'].aggregate([...])` This would skip the need for the driver syntax for lazy people who don't want to add the needed info for admins to run a command/aggregation on prod.

            Assignee:
            rhys.howell@mongodb.com Rhys Howell
            Reporter:
            ewan.higgs@deliverect.com Ewan Higgs
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: