Skip to content

Commit f595e7c

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)
1 parent bfdcacc commit f595e7c

File tree

2 files changed

+56
-22
lines changed

2 files changed

+56
-22
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: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ New features of the 5.0 {+driver-short+} release include:
7575
This change is for Typescript only, and does not affect queries or operations
7676
at runtime.
7777

78-
- Optional installation of ``@aws-sdk/credential-providers`` as a dependency.
78+
- Optional installation of ``@aws-sdk/credential-providers`` as a peer dependency.
7979

8080
- The driver no longer includes AWS SDK modules by default. Use the
8181
following ``npm`` command to install the SDK:
@@ -159,19 +159,35 @@ To learn more, see the `v4.12.0 Release Highlights <https://github.com/mongodb/n
159159
What's New in 4.11
160160
------------------
161161

162+
Prioritization Order in Monitoring
163+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
164+
162165
When connecting to MongoDB Server version 6.0 or later, the driver prioritizes
163166
``electionId`` settings before ``setVersion`` settings during Server Discovery and
164167
Monitoring events. In previous versions, the prioritization order was reversed.
165168

166-
This release also includes added support for **mutually
169+
Changes to AWS Authentication
170+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
171+
172+
When you install the optional ``aws-sdk/credential-providers``
173+
dependency, the driver uses the AWS SDK to retrieve AWS credentials from the
174+
environment.
175+
176+
To learn more about this behavior, see the :ref:`MONGODB-AWS
177+
<mongodb-aws>` section of the Authentication Mechanisms guide.
178+
179+
Mutually Recursive Schema Type Checking
180+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
181+
182+
This release includes added support for **mutually
167183
recursive** collection schema types. The driver also provides type safety for
168184
dot-notation queries up to a depth of eight in this release. At a depth greater
169185
than or equal to eight, Typescript successfully compiles your code but does not
170186
provide type safety. This depth limit on recursive types is a current limitation
171187
of TypeScript.
172188

173-
Mutually Recursive Schema Type Checking Example
174-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
189+
Example
190+
```````
175191

176192
Suppose we have a collection of type ``Collection<Author>`` that contains the
177193
following mutually recursive types:
@@ -409,7 +425,7 @@ Key Changes
409425
~~~~~~~~~~~
410426

411427
Node.js Version
412-
+++++++++++++++
428+
```````````````
413429

414430
The minimum supported version of Node.js is now v12.9 or greater for
415431
version 4 of the driver. Support for our 3.x branches will continue
@@ -421,7 +437,7 @@ until summer 2022 to allow time to upgrade.
421437

422438

423439
Cursor Improvements
424-
+++++++++++++++++++
440+
```````````````````
425441

426442
Our Cursor implementation is now updated to make it clear what is possible
427443
before and after execution of an operation.
@@ -453,7 +469,7 @@ similar to the following:
453469
- ``ListCollectionsCursor``
454470

455471
Cursor Stream API
456-
^^^^^^^^^^^^^^^^^
472+
+++++++++++++++++
457473

458474
Our Cursor types no longer extend ``Readable`` directly. They must be
459475
transformed into a stream by calling ``cursor.stream()``.
@@ -473,7 +489,7 @@ Use ``for await of`` syntax or any ``Promise`` helpers for
473489
asynchronous iteration.
474490

475491
``MongoClientOptions`` Interface
476-
+++++++++++++++++++++++++++++++++
492+
````````````````````````````````
477493

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

490506
``createCollection()``
491-
++++++++++++++++++++++
507+
``````````````````````
492508

493509
This method no longer supports a ``strict`` option, which returned
494510
an error if the collection did not exist. To assert the existence of
@@ -507,7 +523,7 @@ a collection, use the ``listCollections()`` method instead.
507523
}
508524

509525
``BulkWriteError`` → ``MongoBulkWriteError``
510-
++++++++++++++++++++++++++++++++++++++++++++
526+
````````````````````````````````````````````
511527

512528
``BulkWriteError`` is now renamed to ``MongoBulkWriteError``.
513529

@@ -516,20 +532,20 @@ depending on your settings. Import the new class name ``MongoBulkWriteError``
516532
when testing for errors in bulk operations.
517533

518534
``DB``
519-
++++++
535+
``````
520536

521537
``DB`` is no longer an ``EventEmitter``. Listen for events directly from your
522538
``MongoClient`` instance.
523539

524540
``Collection.group()``
525-
++++++++++++++++++++++
541+
``````````````````````
526542

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

531547
Authentication
532-
++++++++++++++
548+
``````````````
533549

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

@@ -553,15 +569,15 @@ Authentication
553569
new MongoClient(url, { auth: { username: "<>", password: "<>" } })
554570

555571
``GridStore`` Removal
556-
+++++++++++++++++++++
572+
`````````````````````
557573

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

561577
Below are some snippets that represent equivalent operations.
562578

563579
Construction
564-
^^^^^^^^^^^^
580+
++++++++++++
565581

566582
.. example::
567583

@@ -573,7 +589,7 @@ Construction
573589
const bucket = new GridFSBucket(client.db('test')[,options])
574590

575591
File Seeking
576-
^^^^^^^^^^^^
592+
++++++++++++
577593

578594
GridFSBucket uses the Node.js Stream API. You can replicate file seeking
579595
by using the ``start`` and ``end`` options, creating a download stream
@@ -586,7 +602,7 @@ from your ``GridFSBucket``.
586602
bucket.openDownloadStreamByName(filename, { start: 0, end: 100 })
587603

588604
File Upload & Download
589-
^^^^^^^^^^^^^^^^^^^^^^
605+
++++++++++++++++++++++
590606

591607
.. example::
592608

@@ -625,7 +641,7 @@ File Upload & Download
625641
``GridFSBucket`` does not need to be closed like ``GridStore``.
626642

627643
File Deletion
628-
^^^^^^^^^^^^^
644+
+++++++++++++
629645

630646
.. example::
631647

@@ -637,7 +653,7 @@ File Deletion
637653
bucket.delete(file_id);
638654

639655
Finding File Metadata
640-
^^^^^^^^^^^^^^^^^^^^^
656+
+++++++++++++++++++++
641657

642658
File metadata that used to be accessible on the ``GridStore`` instance can be
643659
found by querying the bucket.
@@ -649,7 +665,7 @@ found by querying the bucket.
649665
const fileMetaDataList: GridFSFile[] = bucket.find({}).toArray();
650666

651667
Unified Topology
652-
++++++++++++++++
668+
````````````````
653669

654670
- We internally now only manage a ``unifiedTopology`` when you connect
655671
to a ``mongod``. The differences between this and previous versions
@@ -661,13 +677,13 @@ Unified Topology
661677
to connect to uninitialized replica set members.
662678

663679
Explain
664-
+++++++
680+
```````
665681

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

669685
Command Monitoring
670-
++++++++++++++++++
686+
``````````````````
671687

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

0 commit comments

Comments
 (0)