Skip to content

Commit f4b9ab8

Browse files
authored
Merge pull request #568 from mcmorisi/DOCSP-42372-username-password
DOCSP-42372: Change username and password placeholders
2 parents 0b6018a + 17f6711 commit f4b9ab8

19 files changed

+28
-28
lines changed

source/connection-troubleshooting.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Connection Troubleshooting
8888
.. code-block:: java
8989
:copyable: false
9090

91-
String uri = "mongodb://<username>:<password>@<hostname>:<port>/?authSource=users&authMechanism=SCRAM-SHA-256";
91+
String uri = "mongodb://<db_username>:<db_password>@<hostname>:<port>/?authSource=users&authMechanism=SCRAM-SHA-256";
9292
MongoClient mongoClient = MongoClients.create(uri);
9393

9494
.. replacement:: credentials-provider-alternative-method-description
@@ -100,7 +100,7 @@ Connection Troubleshooting
100100
.. code-block:: java
101101
:copyable: false
102102

103-
MongoCredential credential = MongoCredential.createScramSha256Credential("<username>", "<authenticationDb>", "<password>");
103+
MongoCredential credential = MongoCredential.createScramSha256Credential("<db_username>", "<authenticationDb>", "<dbpassword>");
104104

105105

106106
.. replacement:: authentication-guide-reference
@@ -117,7 +117,7 @@ Connection Troubleshooting
117117
.. code-block:: java
118118
:copyable: false
119119

120-
MongoClient mongoClient = MongoClients.create("mongodb://<username>:<password>@<hostname>:<port>/?authSource=users");
120+
MongoClient mongoClient = MongoClients.create("mongodb://<db_username>:<db_password>@<hostname>:<port>/?authSource=users");
121121

122122
.. replacement:: dns-resolution-anchor
123123

source/fundamentals/auth.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ mechanism:
9595

9696
.. code-block:: java
9797

98-
MongoClient mongoClient = MongoClients.create("mongodb://<username>:<password>@<hostname>:<port>/?authSource=<authenticationDb>");
98+
MongoClient mongoClient = MongoClients.create("mongodb://<db_username>:<db_password>@<hostname>:<port>/?authSource=<authenticationDb>");
9999

100100
.. tab::
101101
:tabid: MongoCredential
@@ -157,7 +157,7 @@ mechanism:
157157

158158
.. code-block:: java
159159

160-
MongoClient mongoClient = MongoClients.create("mongodb://<username>:<password>@<hostname>:<port>/?authSource=<authenticationDb>&authMechanism=SCRAM-SHA-256");
160+
MongoClient mongoClient = MongoClients.create("mongodb://<db_username>:<db_password>@<hostname>:<port>/?authSource=<authenticationDb>&authMechanism=SCRAM-SHA-256");
161161

162162
.. tab::
163163
:tabid: MongoCredential
@@ -215,7 +215,7 @@ mechanism:
215215

216216
.. code-block:: java
217217

218-
MongoClient mongoClient = MongoClients.create("mongodb://<username>:<password>@<hostname>:<port>/?authSource=<authenticationDb>&authMechanism=SCRAM-SHA-1");
218+
MongoClient mongoClient = MongoClients.create("mongodb://<db_username>:<db_password>@<hostname>:<port>/?authSource=<authenticationDb>&authMechanism=SCRAM-SHA-1");
219219

220220
.. tab::
221221
:tabid: MongoCredential

source/fundamentals/connection/mongoclientsettings.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ This example demonstrates specifying a ``ConnectionString``:
187187
:emphasize-lines: 2,4
188188

189189
MongoClient mongoClient = MongoClients.create(
190-
MongoClientSettings.builder().applyConnectionString(new ConnectionString("mongodb+srv://<username>:<password>@<hostname>:<port>/<auth db>?connectTimeoutMS=2000"))
190+
MongoClientSettings.builder().applyConnectionString(new ConnectionString("mongodb+srv://<db_username>:<db_password>@<hostname>:<port>/<auth db>?connectTimeoutMS=2000"))
191191
.applyToSocketSettings(builder ->
192192
builder.connectTimeout(5L, SECONDS))
193193
.build());

source/fundamentals/connection/network-compression.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ connection string using ``ConnectionString`` or by calling the method in the
5353

5454
.. code-block:: java
5555

56-
ConnectionString connectionString = new ConnectionString("mongodb+srv://<user>:<password>@<cluster-url>/?compressors=snappy,zlib,zstd");
56+
ConnectionString connectionString = new ConnectionString("mongodb+srv://<db_username>:<db_password>@<cluster-url>/?compressors=snappy,zlib,zstd");
5757
MongoClient mongoClient = MongoClients.create(connectionString);
5858

5959
Specify compression algorithms using the following strings:

source/fundamentals/connection/tls.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ using a method in the ``MongoClientSettings.Builder`` class.
6767

6868
.. code-block:: java
6969

70-
MongoClient mongoClient = MongoClients.create("mongodb+srv://<user>:<password>@<cluster-url>?tls=true");
70+
MongoClient mongoClient = MongoClients.create("mongodb+srv://<db_username>:<db_password>@<cluster-url>?tls=true");
7171

7272
.. tab:: MongoClientSettings
7373
:tabid: mongoclientsettings

source/fundamentals/enterprise-auth.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ mechanism:
9292

9393
.. code-block:: java
9494

95-
MongoClient mongoClient = MongoClients.create("<username>@<hostname>:<port>/?authSource=$external&authMechanism=GSSAPI");
95+
MongoClient mongoClient = MongoClients.create("<db_username>@<hostname>:<port>/?authSource=$external&authMechanism=GSSAPI");
9696

9797
.. tab::
9898
:tabid: MongoCredential
@@ -151,7 +151,7 @@ You might need to specify one or more of the following additional
151151

152152
.. code-block:: java
153153

154-
MongoClient mongoClient = MongoClients.create("<username>@<hostname>:<port>/?authSource=$external&authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:myService");
154+
MongoClient mongoClient = MongoClients.create("<db_username>@<hostname>:<port>/?authSource=$external&authMechanism=GSSAPI&authMechanismProperties=SERVICE_NAME:myService");
155155

156156
.. tab::
157157
:tabid: MongoCredential
@@ -277,7 +277,7 @@ mechanism:
277277

278278
.. code-block:: java
279279

280-
MongoClient mongoClient = MongoClients.create("<username>:<password>@<hostname>:<port>/?authSource=$external&authMechanism=PLAIN");
280+
MongoClient mongoClient = MongoClients.create("<db_username>:<db_password>@<hostname>:<port>/?authSource=$external&authMechanism=PLAIN");
281281

282282
.. tab::
283283
:tabid: MongoCredential
@@ -340,21 +340,21 @@ see the corresponding syntax.
340340
.. code-block:: java
341341

342342
MongoClient mongoClient = MongoClients.create(
343-
"mongodb://<username>@<hostname>:<port>/?" +
343+
"mongodb://<db_username>@<hostname>:<port>/?" +
344344
"?authMechanism=MONGODB-OIDC" +
345345
"&authMechanismProperties=ENVIRONMENT:azure,TOKEN_RESOURCE:<percent-encoded audience>");
346346

347347
.. tab:: MongoCredential
348348
:tabid: mongodb-azure-mongo-credential
349349

350-
Replace the ``<username>`` placeholder with the client ID or application ID of the
350+
Replace the ``<db_username>`` placeholder with the client ID or application ID of the
351351
Azure managed identity or enterprise application. Replace the ``<audience>``
352352
placeholder with the value of the
353353
``audience`` server parameter configured on your MongoDB deployment.
354354

355355
.. code-block:: java
356356

357-
MongoCredential credential = MongoCredential.createOidcCredential("<username>")
357+
MongoCredential credential = MongoCredential.createOidcCredential("<db_username>")
358358
.withMechanismProperty("ENVIRONMENT", "azure")
359359
.withMechanismProperty("TOKEN_RESOURCE", "<audience>");
360360

source/fundamentals/indexes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,4 +595,4 @@ For prior versions of MongoDB, pass "*" as a parameter to your call to
595595
For more information about the methods in this section, see the following API Documentation:
596596

597597
- `dropIndex() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#dropIndex(java.lang.String)>`__
598-
- `dropIndexes() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#dropIndexes()>`__
598+
- `dropIndexes() <{+api+}/apidocs/mongodb-driver-sync/com/mongodb/client/MongoCollection.html#dropIndexes()>`__

source/includes/faq/code-snippets/FaqExample.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static void main(String[] args) {
3434
fromProviders(pojoCodecProvider));
3535
// end myDateAsStringCodec
3636

37-
String uri = "mongodb+srv://<user>:<password>@<cluster-url>?retryWrites=true&w=majority";
37+
String uri = "mongodb+srv://<db_username>:<db_password>@<cluster-url>?retryWrites=true&w=majority";
3838

3939
try (MongoClient mongoClient = MongoClients.create(uri)) {
4040

source/includes/fundamentals/code-snippets/auth-credentials-default.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. code-block:: java
22
3-
MongoCredential credential = MongoCredential.createCredential("<username>", "<authenticationDb>", "<password>");
3+
MongoCredential credential = MongoCredential.createCredential("<db_username>", "<authenticationDb>", "<db_password>");
44
55
MongoClient mongoClient = MongoClients.create(
66
MongoClientSettings.builder()
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.. code-block:: java
22
3-
MongoCredential credential = MongoCredential.createGSSAPICredential(<username>);
3+
MongoCredential credential = MongoCredential.createGSSAPICredential(<db_username>);
44
credential = credential.withMechanismProperty(MongoCredential.SERVICE_NAME_KEY, "myService");
55

0 commit comments

Comments
 (0)