Skip to content

Commit cb34b78

Browse files
committed
DOCSP-42378: Update username/password placeholders (#127)
(cherry picked from commit 8970f48)
1 parent ef32721 commit cb34b78

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

source/fundamentals/authentication.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ password to authenticate to a server.
6464
MongoDB supports the following SCRAM-based authentication mechanisms:
6565

6666
- :ref:`SCRAM-SHA-256 <rust-auth-scramsha256>`: an authentication mechanism that
67-
uses your username and password, encrypted with the ``SHA-256``
67+
uses your database username and password, encrypted with the ``SHA-256``
6868
algorithm
6969
- :ref:`SCRAM-SHA-1 <rust-auth-scramsha1>`: an authentication mechanism that
70-
uses your username and password, encrypted with the ``SHA-1``
70+
uses your database username and password, encrypted with the ``SHA-1``
7171
algorithm
7272

7373
.. important:: Default Authentication Mechanism
@@ -84,8 +84,8 @@ MongoDB supports the following SCRAM-based authentication mechanisms:
8484
``mechanism`` field when you instantiate your ``Credential`` struct.
8585
This example uses the following placeholders:
8686

87-
- ``username``: Your username
88-
- ``password``: Your password
87+
- ``db_username``: Your database username
88+
- ``db_password``: Your database password
8989
- ``db``: The authentication database associated with the user
9090

9191
.. literalinclude:: /includes/fundamentals/code-snippets/auth.rs
@@ -104,8 +104,8 @@ To specify the ``SCRAM-SHA-256`` authentication mechanism, set the
104104
``AuthMechanism::ScramSha256``. This example specifies the
105105
authentication mechanism by using the following placeholders:
106106

107-
- ``username``: Your username
108-
- ``password``: Your password
107+
- ``db_username``: Your database username
108+
- ``db_password``: Your database password
109109
- ``db``: The authentication database associated with the user
110110

111111
.. literalinclude:: /includes/fundamentals/code-snippets/auth.rs
@@ -124,8 +124,8 @@ To specify the ``SCRAM-SHA-1`` authentication mechanism, set the
124124
``AuthMechanism::ScramSha1``. This example specifies the
125125
authentication mechanism by using the following placeholders:
126126

127-
- ``username``: Your username
128-
- ``password``: Your password
127+
- ``db_username``: Your database username
128+
- ``db_password``: Your database password
129129
- ``db``: The authentication database associated with the user
130130

131131
.. literalinclude:: /includes/fundamentals/code-snippets/auth.rs

source/fundamentals/connections/network-compression.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Zstandard as the compressors for a connection:
125125
.. code-block:: rust
126126
:emphasize-lines: 1
127127

128-
let uri = "mongodb+srv://<user>:<password>@<cluster-url>/?compressors=snappy,zlib,zstd";
128+
let uri = "mongodb+srv://<db_username>:<db_password>@<cluster-url>/?compressors=snappy,zlib,zstd";
129129
let client = Client::with_uri_str(uri).await?;
130130

131131
To learn more about setting client options, see the

source/includes/fundamentals/code-snippets/auth.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ async fn main() -> mongodb::error::Result<()> {
77
let mut client_options = ClientOptions::parse_async(uri).await?;
88

99
let default_cred = Credential::builder()
10-
.username("<username>".to_string())
11-
.password("<password>".to_string())
10+
.username("<db_username>".to_string())
11+
.password("<db_password>".to_string())
1212
.source("<db>".to_string())
1313
.build();
1414

@@ -21,8 +21,8 @@ async fn main() -> mongodb::error::Result<()> {
2121
let mut client_options = ClientOptions::parse_async(uri).await?;
2222

2323
let scram_sha_256_cred = Credential::builder()
24-
.username("<username>".to_string())
25-
.password("<password>".to_string())
24+
.username("<db_username>".to_string())
25+
.password("<db_password>".to_string())
2626
.mechanism(AuthMechanism::ScramSha256)
2727
.source("<db>".to_string())
2828
.build();
@@ -36,8 +36,8 @@ async fn main() -> mongodb::error::Result<()> {
3636
let mut client_options = ClientOptions::parse_async(uri).await?;
3737

3838
let scram_sha_1_cred = Credential::builder()
39-
.username("<username>".to_string())
40-
.password("<password>".to_string())
39+
.username("<db_username>".to_string())
40+
.password("<db_password>".to_string())
4141
.mechanism(AuthMechanism::ScramSha1)
4242
.source("<db>".to_string())
4343
.build();

source/quick-start/create-a-connection-string.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ To connect to an instance or deployment not hosted on Atlas, see
5252
.. step:: Update the Placeholders
5353

5454
Paste this connection string into a a file in your preferred text editor
55-
and replace the ``<username>`` and ``<password>`` placeholders with
55+
and replace the ``<db_username>`` and ``<db_password>`` placeholders with
5656
your database user's username and password.
5757

5858
Save this file to a safe location for use in the next step.

0 commit comments

Comments
 (0)