Skip to content

Commit 7d84dd5

Browse files
committed
DOCSP-26403: changes to aws credential retrieval (#691)
* DOCSP-26403: changes to aws credential retrieval * formatting fixes * capitalization * DB PR fixes 1 (cherry picked from commit 5bcdb61) (cherry picked from commit f595e7c) (cherry picked from commit 6c0424f) (cherry picked from commit fb7ea11)
1 parent 3809bbf commit 7d84dd5

File tree

2 files changed

+55
-21
lines changed

2 files changed

+55
-21
lines changed

source/fundamentals/authentication/mechanisms.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,24 @@ The driver checks for your credentials in the following sources in order:
201201
.. literalinclude:: /code-snippets/authentication/aws.js
202202
:language: javascript
203203

204+
.. important:: Retrieval of AWS Credentials
205+
206+
Starting in version 4.11, when you install the optional
207+
``aws-sdk/credential-providers`` dependency, the driver uses the AWS SDK
208+
to retrieve credentials from the environment. As a result, if you
209+
have a shared AWS credentials file or config file, the driver will
210+
use those credentials by default.
211+
212+
You can override this behavior by performing one of the following
213+
actions:
214+
215+
- Set ``AWS_SHARED_CREDENTIALS_FILE`` variable in your shell to point
216+
to your credentials file.
217+
- Set the equivalent environment variable in your application to point
218+
to your credentials file.
219+
- Create an AWS profile for your MongoDB credentials and set the
220+
``AWS_PROFILE`` environment variable to that profile name.
221+
204222
``X.509``
205223
---------
206224

source/whats-new.txt

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,35 @@ To learn more, see the `v4.12.0 Release Highlights <https://github.com/mongodb/n
8484
What's New in 4.11
8585
------------------
8686

87+
Prioritization Order in Monitoring
88+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89+
8790
When connecting to MongoDB Server version 6.0 or later, the driver prioritizes
8891
``electionId`` settings before ``setVersion`` settings during Server Discovery and
8992
Monitoring events. In previous versions, the prioritization order was reversed.
9093

91-
This release also includes added support for **mutually
94+
Changes to AWS Authentication
95+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96+
97+
When you install the optional ``aws-sdk/credential-providers``
98+
dependency, the driver uses the AWS SDK to retrieve AWS credentials from the
99+
environment.
100+
101+
To learn more about this behavior, see the :ref:`MONGODB-AWS
102+
<mongodb-aws>` section of the Authentication Mechanisms guide.
103+
104+
Mutually Recursive Schema Type Checking
105+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
106+
107+
This release includes added support for **mutually
92108
recursive** collection schema types. The driver also provides type safety for
93109
dot-notation queries up to a depth of eight in this release. At a depth greater
94110
than or equal to eight, Typescript successfully compiles your code but does not
95111
provide type safety. This depth limit on recursive types is a current limitation
96112
of TypeScript.
97113

98-
Mutually Recursive Schema Type Checking Example
99-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
114+
Example
115+
```````
100116

101117
Suppose we have a collection of type ``Collection<Author>`` that contains the
102118
following mutually recursive types:
@@ -334,7 +350,7 @@ Key Changes
334350
~~~~~~~~~~~
335351

336352
Node.js Version
337-
+++++++++++++++
353+
```````````````
338354

339355
The minimum supported version of Node.js is now v12.9 or greater for
340356
version 4 of the driver. Support for our 3.x branches will continue
@@ -346,7 +362,7 @@ until summer 2022 to allow time to upgrade.
346362

347363

348364
Cursor Improvements
349-
+++++++++++++++++++
365+
```````````````````
350366

351367
Our Cursor implementation is now updated to make it clear what is possible
352368
before and after execution of an operation.
@@ -378,7 +394,7 @@ similar to the following:
378394
- ``ListCollectionsCursor``
379395

380396
Cursor Stream API
381-
^^^^^^^^^^^^^^^^^
397+
+++++++++++++++++
382398

383399
Our Cursor types no longer extend ``Readable`` directly. They must be
384400
transformed into a stream by calling ``cursor.stream()``.
@@ -398,7 +414,7 @@ Use ``for await of`` syntax or any ``Promise`` helpers for
398414
asynchronous iteration.
399415

400416
``MongoClientOptions`` Interface
401-
+++++++++++++++++++++++++++++++++
417+
````````````````````````````````
402418

403419
With type hinting, you should find that options passed to a ``MongoClient``
404420
are enumerated and discoverable. We've made a large effort to process
@@ -413,7 +429,7 @@ to get your app up and running in a correct state quickly.
413429
- It is no longer required to specify ``useUnifiedTopology`` or ``useNewUrlParser``.
414430

415431
``createCollection()``
416-
++++++++++++++++++++++
432+
``````````````````````
417433

418434
This method no longer supports a ``strict`` option, which returned
419435
an error if the collection did not exist. To assert the existence of
@@ -432,7 +448,7 @@ a collection, use the ``listCollections()`` method instead.
432448
}
433449

434450
``BulkWriteError`` → ``MongoBulkWriteError``
435-
++++++++++++++++++++++++++++++++++++++++++++
451+
````````````````````````````````````````````
436452

437453
``BulkWriteError`` is now renamed to ``MongoBulkWriteError``.
438454

@@ -441,20 +457,20 @@ depending on your settings. Import the new class name ``MongoBulkWriteError``
441457
when testing for errors in bulk operations.
442458

443459
``DB``
444-
++++++
460+
``````
445461

446462
``DB`` is no longer an ``EventEmitter``. Listen for events directly from your
447463
``MongoClient`` instance.
448464

449465
``Collection.group()``
450-
++++++++++++++++++++++
466+
``````````````````````
451467

452468
The ``Collection.group()`` helper, deprecated since MongoDB 3.4,
453469
is now removed. Use the aggregation pipeline :manual:`$group </reference/operator/aggregation/group/#pipe._S_group>`
454470
operator instead.
455471

456472
Authentication
457-
++++++++++++++
473+
``````````````
458474

459475
- ``gssapiServiceName`` is now removed. Use `authMechanismProperties.SERVICE_NAME <{+api+}/interfaces/MongoClientOptions.html#authMechanismProperties>`__ in the URI or as an option on ``MongoClientOptions``.
460476

@@ -478,15 +494,15 @@ Authentication
478494
new MongoClient(url, { auth: { username: "<>", password: "<>" } })
479495

480496
``GridStore`` Removal
481-
+++++++++++++++++++++
497+
`````````````````````
482498

483499
The GridStore API (already deprecated in 3.x) is now replaced with ``GridFSBucket``.
484500
For more information on ``GridFS``, see the :manual:`mongodb manual </core/gridfs>`.
485501

486502
Below are some snippets that represent equivalent operations.
487503

488504
Construction
489-
^^^^^^^^^^^^
505+
++++++++++++
490506

491507
.. example::
492508

@@ -498,7 +514,7 @@ Construction
498514
const bucket = new GridFSBucket(client.db('test')[,options])
499515

500516
File Seeking
501-
^^^^^^^^^^^^
517+
++++++++++++
502518

503519
GridFSBucket uses the Node.js Stream API. You can replicate file seeking
504520
by using the ``start`` and ``end`` options, creating a download stream
@@ -511,7 +527,7 @@ from your ``GridFSBucket``.
511527
bucket.openDownloadStreamByName(filename, { start: 0, end: 100 })
512528

513529
File Upload & Download
514-
^^^^^^^^^^^^^^^^^^^^^^
530+
++++++++++++++++++++++
515531

516532
.. example::
517533

@@ -550,7 +566,7 @@ File Upload & Download
550566
``GridFSBucket`` does not need to be closed like ``GridStore``.
551567

552568
File Deletion
553-
^^^^^^^^^^^^^
569+
+++++++++++++
554570

555571
.. example::
556572

@@ -562,7 +578,7 @@ File Deletion
562578
bucket.delete(file_id);
563579

564580
Finding File Metadata
565-
^^^^^^^^^^^^^^^^^^^^^
581+
+++++++++++++++++++++
566582

567583
File metadata that used to be accessible on the ``GridStore`` instance can be
568584
found by querying the bucket.
@@ -574,7 +590,7 @@ found by querying the bucket.
574590
const fileMetaDataList: GridFSFile[] = bucket.find({}).toArray();
575591

576592
Unified Topology
577-
++++++++++++++++
593+
````````````````
578594

579595
- We internally now only manage a ``unifiedTopology`` when you connect
580596
to a ``mongod``. The differences between this and previous versions
@@ -586,13 +602,13 @@ Unified Topology
586602
to connect to uninitialized replica set members.
587603

588604
Explain
589-
+++++++
605+
```````
590606

591607
Support is now added for fine-grained verbosity modes. You can learn more
592608
about each mode :manual:`here </reference/method/cursor.explain/#behavior/>`.
593609

594610
Command Monitoring
595-
++++++++++++++++++
611+
``````````````````
596612

597613
The ``instrument()`` method is now removed. Use command monitoring instead.
598614
See our guide on :doc:`command monitoring </fundamentals/monitoring/command-monitoring>`

0 commit comments

Comments
 (0)