Skip to content

Commit fb7ea11

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)
1 parent e945cff commit fb7ea11

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
@@ -100,19 +100,35 @@ To learn more, see the `v4.12.0 Release Highlights <https://github.com/mongodb/n
100100
What's New in 4.11
101101
------------------
102102

103+
Prioritization Order in Monitoring
104+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
105+
103106
When connecting to MongoDB Server version 6.0 or later, the driver prioritizes
104107
``electionId`` settings before ``setVersion`` settings during Server Discovery and
105108
Monitoring events. In previous versions, the prioritization order was reversed.
106109

107-
This release also includes added support for **mutually
110+
Changes to AWS Authentication
111+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112+
113+
When you install the optional ``aws-sdk/credential-providers``
114+
dependency, the driver uses the AWS SDK to retrieve AWS credentials from the
115+
environment.
116+
117+
To learn more about this behavior, see the :ref:`MONGODB-AWS
118+
<mongodb-aws>` section of the Authentication Mechanisms guide.
119+
120+
Mutually Recursive Schema Type Checking
121+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
122+
123+
This release includes added support for **mutually
108124
recursive** collection schema types. The driver also provides type safety for
109125
dot-notation queries up to a depth of eight in this release. At a depth greater
110126
than or equal to eight, Typescript successfully compiles your code but does not
111127
provide type safety. This depth limit on recursive types is a current limitation
112128
of TypeScript.
113129

114-
Mutually Recursive Schema Type Checking Example
115-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
130+
Example
131+
```````
116132

117133
Suppose we have a collection of type ``Collection<Author>`` that contains the
118134
following mutually recursive types:
@@ -350,7 +366,7 @@ Key Changes
350366
~~~~~~~~~~~
351367

352368
Node.js Version
353-
+++++++++++++++
369+
```````````````
354370

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

363379

364380
Cursor Improvements
365-
+++++++++++++++++++
381+
```````````````````
366382

367383
Our Cursor implementation is now updated to make it clear what is possible
368384
before and after execution of an operation.
@@ -394,7 +410,7 @@ similar to the following:
394410
- ``ListCollectionsCursor``
395411

396412
Cursor Stream API
397-
^^^^^^^^^^^^^^^^^
413+
+++++++++++++++++
398414

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

416432
``MongoClientOptions`` Interface
417-
+++++++++++++++++++++++++++++++++
433+
````````````````````````````````
418434

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

431447
``createCollection()``
432-
++++++++++++++++++++++
448+
``````````````````````
433449

434450
This method no longer supports a ``strict`` option, which returned
435451
an error if the collection did not exist. To assert the existence of
@@ -448,7 +464,7 @@ a collection, use the ``listCollections()`` method instead.
448464
}
449465

450466
``BulkWriteError`` → ``MongoBulkWriteError``
451-
++++++++++++++++++++++++++++++++++++++++++++
467+
````````````````````````````````````````````
452468

453469
``BulkWriteError`` is now renamed to ``MongoBulkWriteError``.
454470

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

459475
``DB``
460-
++++++
476+
``````
461477

462478
``DB`` is no longer an ``EventEmitter``. Listen for events directly from your
463479
``MongoClient`` instance.
464480

465481
``Collection.group()``
466-
++++++++++++++++++++++
482+
``````````````````````
467483

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

472488
Authentication
473-
++++++++++++++
489+
``````````````
474490

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

@@ -494,15 +510,15 @@ Authentication
494510
new MongoClient(url, { auth: { username: "<>", password: "<>" } })
495511

496512
``GridStore`` Removal
497-
+++++++++++++++++++++
513+
`````````````````````
498514

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

502518
Below are some snippets that represent equivalent operations.
503519

504520
Construction
505-
^^^^^^^^^^^^
521+
++++++++++++
506522

507523
.. example::
508524

@@ -514,7 +530,7 @@ Construction
514530
const bucket = new GridFSBucket(client.db('test')[,options])
515531

516532
File Seeking
517-
^^^^^^^^^^^^
533+
++++++++++++
518534

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

529545
File Upload & Download
530-
^^^^^^^^^^^^^^^^^^^^^^
546+
++++++++++++++++++++++
531547

532548
.. example::
533549

@@ -566,7 +582,7 @@ File Upload & Download
566582
``GridFSBucket`` does not need to be closed like ``GridStore``.
567583

568584
File Deletion
569-
^^^^^^^^^^^^^
585+
+++++++++++++
570586

571587
.. example::
572588

@@ -578,7 +594,7 @@ File Deletion
578594
bucket.delete(file_id);
579595

580596
Finding File Metadata
581-
^^^^^^^^^^^^^^^^^^^^^
597+
+++++++++++++++++++++
582598

583599
File metadata that used to be accessible on the ``GridStore`` instance can be
584600
found by querying the bucket.
@@ -590,7 +606,7 @@ found by querying the bucket.
590606
const fileMetaDataList: GridFSFile[] = bucket.find({}).toArray();
591607

592608
Unified Topology
593-
++++++++++++++++
609+
````````````````
594610

595611
- We internally now only manage a ``unifiedTopology`` when you connect
596612
to a ``mongod``. The differences between this and previous versions
@@ -602,13 +618,13 @@ Unified Topology
602618
to connect to uninitialized replica set members.
603619

604620
Explain
605-
+++++++
621+
```````
606622

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

610626
Command Monitoring
611-
++++++++++++++++++
627+
``````````````````
612628

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

0 commit comments

Comments
 (0)