Skip to content

Commit e036c10

Browse files
authored
DOCSP-26281 Add protectConnectionStrings option (#471)
* DOCSP-26281 Add protectConnectionStrings option * add ref * add to toc * JA edits * remove period * JA nit edits
1 parent aeafb56 commit e036c10

File tree

5 files changed

+101
-2
lines changed

5 files changed

+101
-2
lines changed

source/config-file.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ When you configure settings with a configuration file:
5757
Tasks
5858
-----
5959

60+
- :ref:`compass-protect-connection-strings`
61+
6062
- :ref:`compass-configure-network-traffic`
6163

6264
- :ref:`specify-read-preference-tags`
@@ -69,5 +71,6 @@ Tasks
6971
:titlesonly:
7072

7173
/config-file/config-file-options
74+
/config-file/protect-connection-strings
7275
/config-file/restrict-outgoing-connections
7376
/config-file/specify-read-preference-tags

source/config-file/config-file-options.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ You can configure the following settings in a configuration file:
6161
* - :ref:`networkTraffic <compass-configure-network-traffic>`
6262
- Configure |compass| to not perform outgoing network operations other
6363
than those to the database.
64+
65+
* - :ref:`protectConnectionStrings <compass-protect-connection-strings>`
66+
- .. include:: /includes/fact-protect-connection-strings.rst
6467

6568
Example
6669
-------
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
.. _compass-protect-connection-strings:
2+
.. _hide-connection-string-credentials:
3+
4+
==========================================
5+
Hide Credentials in Your Connection String
6+
==========================================
7+
8+
.. default-domain:: mongodb
9+
10+
.. contents:: On this page
11+
:local:
12+
:backlinks: none
13+
:depth: 2
14+
:class: singlecol
15+
16+
When you paste a connection string into the |compass| connection form,
17+
|compass-short| shows credentials in plaintext by default. To hide credentials in
18+
the connection string, use the ``protectConnectionStrings`` option.
19+
20+
About This Task
21+
---------------
22+
23+
When ``protectConnectionStrings`` is enabled, users cannot perform the following
24+
actions:
25+
26+
- Edit the connection string in the |compass-short| connection form.
27+
28+
- Copy the connection string in the |compass-short| interface.
29+
30+
- See the credentials when :ref:`exporting a query <compass-export-query>`.
31+
32+
Procedure
33+
---------
34+
35+
To hide your your connection string credentials, enable the
36+
``protectConnectionStrings`` option.
37+
38+
You can set the ``protectConnectionStrings`` option in either:
39+
40+
- The |compass-short| :guilabel:`Settings` panel
41+
42+
- The :ref:`command line <cli-options>`
43+
44+
- A :ref:`configuration file <config-file>`
45+
46+
Command Line Example
47+
~~~~~~~~~~~~~~~~~~~~
48+
49+
The following command starts |compass-short| from the command line and sets
50+
the ``--protectConnectionStrings`` option:
51+
52+
.. code-block:: sh
53+
54+
<path-to-Compass-executable> --protectConnectionStrings
55+
56+
.. note::
57+
58+
The name and filepath of the |compass-short| executable depend on your
59+
operating system.
60+
61+
Configuration File Example
62+
~~~~~~~~~~~~~~~~~~~~~~~~~~
63+
64+
You can specify the |compass-short| configuration file in either EJSON
65+
or YAML format. The following configurations set the
66+
``protectConnectionStrings`` option to ``true``:
67+
68+
EJSON
69+
`````
70+
71+
.. code-block:: json
72+
73+
{ "protectConnectionStrings": true }
74+
75+
YAML
76+
````
77+
78+
.. code-block:: yaml
79+
80+
protectConnectionStrings: true
81+
82+
Learn More
83+
----------
84+
85+
To learn more about the |compass| configuration file, see
86+
:ref:`config-file`.

source/connect/connect-from-the-command-line/command-line-options.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,16 +106,21 @@ value in the :guilabel:`Settings` panel.
106106
.. option:: --forceConnectionOptions
107107

108108
.. include:: /includes/fact-force-connection-options.rst
109+
110+
To learn more, see :ref:`compass-force-connection-options`.
109111

110112
.. option:: --networkTraffic
111113

112114
Configure |compass| to only allow outgoing :ref:`network operations
113115
<compass-configure-network-traffic>` to connect to the database.
114116

117+
To learn more, see :ref:`compass-configure-network-traffic`.
118+
115119
.. option:: --protectConnectionStrings
116120

117-
Hide credentials in connection strings. Passwords in connection
118-
strings are displayed as ``*****``.
121+
.. include:: /includes/fact-protect-connection-strings.rst
122+
123+
To learn more, see :ref:`compass-protect-connection-strings`.
119124

120125
.. option:: --theme
121126

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Hide credentials in your connection string. Passwords in connection
2+
strings are displayed as ``*****``

0 commit comments

Comments
 (0)