Skip to content

Commit 4958b32

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 8a19167 commit 4958b32

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
@@ -34,19 +34,35 @@ Learn what's new in:
3434
What's New in 4.11
3535
------------------
3636

37+
Prioritization Order in Monitoring
38+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
39+
3740
When connecting to MongoDB Server version 6.0 or later, the driver prioritizes
3841
``electionId`` settings before ``setVersion`` settings during Server Discovery and
3942
Monitoring events. In previous versions, the prioritization order was reversed.
4043

41-
This release also includes added support for **mutually
44+
Changes to AWS Authentication
45+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46+
47+
When you install the optional ``aws-sdk/credential-providers``
48+
dependency, the driver uses the AWS SDK to retrieve AWS credentials from the
49+
environment.
50+
51+
To learn more about this behavior, see the :ref:`MONGODB-AWS
52+
<mongodb-aws>` section of the Authentication Mechanisms guide.
53+
54+
Mutually Recursive Schema Type Checking
55+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56+
57+
This release includes added support for **mutually
4258
recursive** collection schema types. The driver also provides type safety for
4359
dot-notation queries up to a depth of eight in this release. At a depth greater
4460
than or equal to eight, Typescript successfully compiles your code but does not
4561
provide type safety. This depth limit on recursive types is a current limitation
4662
of TypeScript.
4763

48-
Mutually Recursive Schema Type Checking Example
49-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64+
Example
65+
```````
5066

5167
Suppose we have a collection of type ``Collection<Author>`` that contains the
5268
following mutually recursive types:
@@ -284,7 +300,7 @@ Key Changes
284300
~~~~~~~~~~~
285301

286302
Node.js Version
287-
+++++++++++++++
303+
```````````````
288304

289305
The minimum supported version of Node.js is now v12.9 or greater for
290306
version 4 of the driver. Support for our 3.x branches will continue
@@ -296,7 +312,7 @@ until summer 2022 to allow time to upgrade.
296312

297313

298314
Cursor Improvements
299-
+++++++++++++++++++
315+
```````````````````
300316

301317
Our Cursor implementation is now updated to make it clear what is possible
302318
before and after execution of an operation.
@@ -328,7 +344,7 @@ similar to the following:
328344
- ``ListCollectionsCursor``
329345

330346
Cursor Stream API
331-
^^^^^^^^^^^^^^^^^
347+
+++++++++++++++++
332348

333349
Our Cursor types no longer extend ``Readable`` directly. They must be
334350
transformed into a stream by calling ``cursor.stream()``.
@@ -348,7 +364,7 @@ Use ``for await of`` syntax or any ``Promise`` helpers for
348364
asynchronous iteration.
349365

350366
``MongoClientOptions`` Interface
351-
+++++++++++++++++++++++++++++++++
367+
````````````````````````````````
352368

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

365381
``createCollection()``
366-
++++++++++++++++++++++
382+
``````````````````````
367383

368384
This method no longer supports a ``strict`` option, which returned
369385
an error if the collection did not exist. To assert the existence of
@@ -382,7 +398,7 @@ a collection, use the ``listCollections()`` method instead.
382398
}
383399

384400
``BulkWriteError`` → ``MongoBulkWriteError``
385-
++++++++++++++++++++++++++++++++++++++++++++
401+
````````````````````````````````````````````
386402

387403
``BulkWriteError`` is now renamed to ``MongoBulkWriteError``.
388404

@@ -391,20 +407,20 @@ depending on your settings. Import the new class name ``MongoBulkWriteError``
391407
when testing for errors in bulk operations.
392408

393409
``DB``
394-
++++++
410+
``````
395411

396412
``DB`` is no longer an ``EventEmitter``. Listen for events directly from your
397413
``MongoClient`` instance.
398414

399415
``Collection.group()``
400-
++++++++++++++++++++++
416+
``````````````````````
401417

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

406422
Authentication
407-
++++++++++++++
423+
``````````````
408424

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

@@ -428,15 +444,15 @@ Authentication
428444
new MongoClient(url, { auth: { username: "<>", password: "<>" } })
429445

430446
``GridStore`` Removal
431-
+++++++++++++++++++++
447+
`````````````````````
432448

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

436452
Below are some snippets that represent equivalent operations.
437453

438454
Construction
439-
^^^^^^^^^^^^
455+
++++++++++++
440456

441457
.. example::
442458

@@ -448,7 +464,7 @@ Construction
448464
const bucket = new GridFSBucket(client.db('test')[,options])
449465

450466
File Seeking
451-
^^^^^^^^^^^^
467+
++++++++++++
452468

453469
GridFSBucket uses the Node.js Stream API. You can replicate file seeking
454470
by using the ``start`` and ``end`` options, creating a download stream
@@ -461,7 +477,7 @@ from your ``GridFSBucket``.
461477
bucket.openDownloadStreamByName(filename, { start: 0, end: 100 })
462478

463479
File Upload & Download
464-
^^^^^^^^^^^^^^^^^^^^^^
480+
++++++++++++++++++++++
465481

466482
.. example::
467483

@@ -500,7 +516,7 @@ File Upload & Download
500516
``GridFSBucket`` does not need to be closed like ``GridStore``.
501517

502518
File Deletion
503-
^^^^^^^^^^^^^
519+
+++++++++++++
504520

505521
.. example::
506522

@@ -512,7 +528,7 @@ File Deletion
512528
bucket.delete(file_id);
513529

514530
Finding File Metadata
515-
^^^^^^^^^^^^^^^^^^^^^
531+
+++++++++++++++++++++
516532

517533
File metadata that used to be accessible on the ``GridStore`` instance can be
518534
found by querying the bucket.
@@ -524,7 +540,7 @@ found by querying the bucket.
524540
const fileMetaDataList: GridFSFile[] = bucket.find({}).toArray();
525541

526542
Unified Topology
527-
++++++++++++++++
543+
````````````````
528544

529545
- We internally now only manage a ``unifiedTopology`` when you connect
530546
to a ``mongod``. The differences between this and previous versions
@@ -536,13 +552,13 @@ Unified Topology
536552
to connect to uninitialized replica set members.
537553

538554
Explain
539-
+++++++
555+
```````
540556

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

544560
Command Monitoring
545-
++++++++++++++++++
561+
``````````````````
546562

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

0 commit comments

Comments
 (0)