Skip to content

Commit 7a5bf63

Browse files
committed
DOCSP-48719: Update non-Mongo credential placeholders (#240)
(cherry picked from commit fc4211c)
1 parent 690a2cf commit 7a5bf63

File tree

1 file changed

+33
-9
lines changed

1 file changed

+33
-9
lines changed

source/security.txt

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,12 @@ Windows
446446
.. code-block:: python
447447

448448
client = pymongo.MongoClient("mongodb://<hostname>:<port>",
449-
username="<db_username>",
450-
authMechanism="GSSAPI",
451-
password="<db_password>",
452-
authMechanismProperties="SERVICE_NAME:<authentication service name>,
453-
CANONICALIZE_HOST_NAME:true,
454-
SERVICE_REALM:<service realm>")
449+
username="<username>",
450+
authMechanism="GSSAPI",
451+
password="<password>",
452+
authMechanismProperties="SERVICE_NAME:<authentication service name>,
453+
CANONICALIZE_HOST_NAME:true,
454+
SERVICE_REALM:<service realm>")
455455

456456
.. tab:: Connection String
457457
:tabid: connectionstring
@@ -485,8 +485,8 @@ PLAIN SASL
485485
.. code-block:: python
486486

487487
client = pymongo.MongoClient("mongodb://<hostname>:<port>",
488-
username="<db_username>",
489-
password="<db_password>",
488+
username="<username>",
489+
password="<password>",
490490
authMechanism="PLAIN",
491491
tls=True)
492492

@@ -495,11 +495,35 @@ PLAIN SASL
495495

496496
.. code-block:: python
497497

498-
uri = ("mongodb://<db_username>:<db_password>@<hostname>:<port>/?"
498+
uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
499499
"&authMechanism=PLAIN"
500500
"&tls=true")
501501
client = pymongo.MongoClient(uri)
502502

503+
<<<<<<< HEAD
504+
=======
505+
.. tab:: MongoClient (Asynchronous)
506+
:tabid: mongoclient-async
507+
508+
.. code-block:: python
509+
510+
client = pymongo.AsyncMongoClient("mongodb://<hostname>:<port>",
511+
username="<username>",
512+
password="<password>",
513+
authMechanism="PLAIN",
514+
tls=True)
515+
516+
.. tab:: Connection String (Asynchronous)
517+
:tabid: connectionstring-async
518+
519+
.. code-block:: python
520+
521+
uri = ("mongodb://<username>:<password>@<hostname>:<port>/?"
522+
"&authMechanism=PLAIN"
523+
"&tls=true")
524+
client = pymongo.AsyncMongoClient(uri)
525+
526+
>>>>>>> fc4211c (DOCSP-48719: Update non-Mongo credential placeholders (#240))
503527
To learn more about authenticating with PLAIN SASL, see
504528
:ref:`pymongo-sasl` in the Enterprise Authentication guide.
505529

0 commit comments

Comments
 (0)