Skip to content

Commit b0e0000

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 2fc385b commit b0e0000

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
@@ -235,6 +235,24 @@ The driver checks for your credentials in the following sources in order:
235235
.. literalinclude:: /code-snippets/authentication/aws-env-variable.js
236236
:language: javascript
237237

238+
.. important:: Retrieval of AWS Credentials
239+
240+
Starting in version 4.11, when you install the optional
241+
``aws-sdk/credential-providers`` dependency, the driver uses the AWS SDK
242+
to retrieve credentials from the environment. As a result, if you
243+
have a shared AWS credentials file or config file, the driver will
244+
use those credentials by default.
245+
246+
You can override this behavior by performing one of the following
247+
actions:
248+
249+
- Set ``AWS_SHARED_CREDENTIALS_FILE`` variable in your shell to point
250+
to your credentials file.
251+
- Set the equivalent environment variable in your application to point
252+
to your credentials file.
253+
- Create an AWS profile for your MongoDB credentials and set the
254+
``AWS_PROFILE`` environment variable to that profile name.
255+
238256
``X.509``
239257
---------
240258

source/whats-new.txt

Lines changed: 38 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ New features of the 5.0 {+driver-short+} release include:
9191
This change is for Typescript only, and does not affect queries or operations
9292
at runtime.
9393

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

9696
- The driver no longer includes AWS SDK modules by default. Use the
9797
following ``npm`` command to install the SDK:
@@ -175,19 +175,35 @@ To learn more, see the `v4.12.0 Release Highlights <https://github.com/mongodb/n
175175
What's New in 4.11
176176
------------------
177177

178+
Prioritization Order in Monitoring
179+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
180+
178181
When connecting to MongoDB Server version 6.0 or later, the driver prioritizes
179182
``electionId`` settings before ``setVersion`` settings during Server Discovery and
180183
Monitoring events. In previous versions, the prioritization order was reversed.
181184

182-
This release also includes added support for **mutually
185+
Changes to AWS Authentication
186+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
187+
188+
When you install the optional ``aws-sdk/credential-providers``
189+
dependency, the driver uses the AWS SDK to retrieve AWS credentials from the
190+
environment.
191+
192+
To learn more about this behavior, see the :ref:`MONGODB-AWS
193+
<mongodb-aws>` section of the Authentication Mechanisms guide.
194+
195+
Mutually Recursive Schema Type Checking
196+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
197+
198+
This release includes added support for **mutually
183199
recursive** collection schema types. The driver also provides type safety for
184200
dot-notation queries up to a depth of eight in this release. At a depth greater
185201
than or equal to eight, Typescript successfully compiles your code but does not
186202
provide type safety. This depth limit on recursive types is a current limitation
187203
of TypeScript.
188204

189-
Mutually Recursive Schema Type Checking Example
190-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
205+
Example
206+
```````
191207

192208
Suppose we have a collection of type ``Collection<Author>`` that contains the
193209
following mutually recursive types:
@@ -425,7 +441,7 @@ Key Changes
425441
~~~~~~~~~~~
426442

427443
Node.js Version
428-
+++++++++++++++
444+
```````````````
429445

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

438454

439455
Cursor Improvements
440-
+++++++++++++++++++
456+
```````````````````
441457

442458
Our Cursor implementation is now updated to make it clear what is possible
443459
before and after execution of an operation.
@@ -469,7 +485,7 @@ similar to the following:
469485
- ``ListCollectionsCursor``
470486

471487
Cursor Stream API
472-
^^^^^^^^^^^^^^^^^
488+
+++++++++++++++++
473489

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

491507
``MongoClientOptions`` Interface
492-
+++++++++++++++++++++++++++++++++
508+
````````````````````````````````
493509

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

506522
``createCollection()``
507-
++++++++++++++++++++++
523+
``````````````````````
508524

509525
This method no longer supports a ``strict`` option, which returned
510526
an error if the collection did not exist. To assert the existence of
@@ -523,7 +539,7 @@ a collection, use the ``listCollections()`` method instead.
523539
}
524540

525541
``BulkWriteError`` → ``MongoBulkWriteError``
526-
++++++++++++++++++++++++++++++++++++++++++++
542+
````````````````````````````````````````````
527543

528544
``BulkWriteError`` is now renamed to ``MongoBulkWriteError``.
529545

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

534550
``DB``
535-
++++++
551+
``````
536552

537553
``DB`` is no longer an ``EventEmitter``. Listen for events directly from your
538554
``MongoClient`` instance.
539555

540556
``Collection.group()``
541-
++++++++++++++++++++++
557+
``````````````````````
542558

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

547563
Authentication
548-
++++++++++++++
564+
``````````````
549565

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

@@ -569,15 +585,15 @@ Authentication
569585
new MongoClient(url, { auth: { username: "<>", password: "<>" } })
570586

571587
``GridStore`` Removal
572-
+++++++++++++++++++++
588+
`````````````````````
573589

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

577593
Below are some snippets that represent equivalent operations.
578594

579595
Construction
580-
^^^^^^^^^^^^
596+
++++++++++++
581597

582598
.. example::
583599

@@ -589,7 +605,7 @@ Construction
589605
const bucket = new GridFSBucket(client.db('test')[,options])
590606

591607
File Seeking
592-
^^^^^^^^^^^^
608+
++++++++++++
593609

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

604620
File Upload & Download
605-
^^^^^^^^^^^^^^^^^^^^^^
621+
++++++++++++++++++++++
606622

607623
.. example::
608624

@@ -641,7 +657,7 @@ File Upload & Download
641657
``GridFSBucket`` does not need to be closed like ``GridStore``.
642658

643659
File Deletion
644-
^^^^^^^^^^^^^
660+
+++++++++++++
645661

646662
.. example::
647663

@@ -653,7 +669,7 @@ File Deletion
653669
bucket.delete(file_id);
654670

655671
Finding File Metadata
656-
^^^^^^^^^^^^^^^^^^^^^
672+
+++++++++++++++++++++
657673

658674
File metadata that used to be accessible on the ``GridStore`` instance can be
659675
found by querying the bucket.
@@ -665,7 +681,7 @@ found by querying the bucket.
665681
const fileMetaDataList: GridFSFile[] = bucket.find({}).toArray();
666682

667683
Unified Topology
668-
++++++++++++++++
684+
````````````````
669685

670686
- We internally now only manage a ``unifiedTopology`` when you connect
671687
to a ``mongod``. The differences between this and previous versions
@@ -677,13 +693,13 @@ Unified Topology
677693
to connect to uninitialized replica set members.
678694

679695
Explain
680-
+++++++
696+
```````
681697

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

685701
Command Monitoring
686-
++++++++++++++++++
702+
``````````````````
687703

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

0 commit comments

Comments
 (0)