Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions source/fundamentals/authentication.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ password to authenticate to a server.
MongoDB supports the following SCRAM-based authentication mechanisms:

- :ref:`SCRAM-SHA-256 <rust-auth-scramsha256>`: an authentication mechanism that
uses your username and password, encrypted with the ``SHA-256``
uses your database username and password, encrypted with the ``SHA-256``
algorithm
- :ref:`SCRAM-SHA-1 <rust-auth-scramsha1>`: an authentication mechanism that
uses your username and password, encrypted with the ``SHA-1``
uses your database username and password, encrypted with the ``SHA-1``
algorithm

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

- ``username``: Your username
- ``password``: Your password
- ``db_username``: Your database username
- ``db_password``: Your database password
- ``db``: The authentication database associated with the user

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

- ``username``: Your username
- ``password``: Your password
- ``db_username``: Your database username
- ``db_password``: Your database password
- ``db``: The authentication database associated with the user

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

- ``username``: Your username
- ``password``: Your password
- ``db_username``: Your database username
- ``db_password``: Your database password
- ``db``: The authentication database associated with the user

.. literalinclude:: /includes/fundamentals/code-snippets/auth.rs
Expand Down
2 changes: 1 addition & 1 deletion source/fundamentals/connections/network-compression.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Zstandard as the compressors for a connection:
.. code-block:: rust
:emphasize-lines: 1

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

To learn more about setting client options, see the
Expand Down
12 changes: 6 additions & 6 deletions source/includes/fundamentals/code-snippets/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ async fn main() -> mongodb::error::Result<()> {
let mut client_options = ClientOptions::parse_async(uri).await?;

let default_cred = Credential::builder()
.username("<username>".to_string())
.password("<password>".to_string())
.username("<db_username>".to_string())
.password("<db_password>".to_string())
.source("<db>".to_string())
.build();

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

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

let scram_sha_1_cred = Credential::builder()
.username("<username>".to_string())
.password("<password>".to_string())
.username("<db_username>".to_string())
.password("<db_password>".to_string())
.mechanism(AuthMechanism::ScramSha1)
.source("<db>".to_string())
.build();
Expand Down
2 changes: 1 addition & 1 deletion source/quick-start/create-a-connection-string.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ To connect to an instance or deployment not hosted on Atlas, see
.. step:: Update the Placeholders

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

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