Skip to content

Commit 6c0424f

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)
1 parent 7c9d06a commit 6c0424f

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

227+
.. important:: Retrieval of AWS Credentials
228+
229+
Starting in version 4.11, when you install the optional
230+
``aws-sdk/credential-providers`` dependency, the driver uses the AWS SDK
231+
to retrieve credentials from the environment. As a result, if you
232+
have a shared AWS credentials file or config file, the driver will
233+
use those credentials by default.
234+
235+
You can override this behavior by performing one of the following
236+
actions:
237+
238+
- Set ``AWS_SHARED_CREDENTIALS_FILE`` variable in your shell to point
239+
to your credentials file.
240+
- Set the equivalent environment variable in your application to point
241+
to your credentials file.
242+
- Create an AWS profile for your MongoDB credentials and set the
243+
``AWS_PROFILE`` environment variable to that profile name.
244+
227245
``X.509``
228246
---------
229247

source/whats-new.txt

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

116+
Prioritization Order in Monitoring
117+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
118+
116119
When connecting to MongoDB Server version 6.0 or later, the driver prioritizes
117120
``electionId`` settings before ``setVersion`` settings during Server Discovery and
118121
Monitoring events. In previous versions, the prioritization order was reversed.
119122

120-
This release also includes added support for **mutually
123+
Changes to AWS Authentication
124+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
125+
126+
When you install the optional ``aws-sdk/credential-providers``
127+
dependency, the driver uses the AWS SDK to retrieve AWS credentials from the
128+
environment.
129+
130+
To learn more about this behavior, see the :ref:`MONGODB-AWS
131+
<mongodb-aws>` section of the Authentication Mechanisms guide.
132+
133+
Mutually Recursive Schema Type Checking
134+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135+
136+
This release includes added support for **mutually
121137
recursive** collection schema types. The driver also provides type safety for
122138
dot-notation queries up to a depth of eight in this release. At a depth greater
123139
than or equal to eight, Typescript successfully compiles your code but does not
124140
provide type safety. This depth limit on recursive types is a current limitation
125141
of TypeScript.
126142

127-
Mutually Recursive Schema Type Checking Example
128-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
143+
Example
144+
```````
129145

130146
Suppose we have a collection of type ``Collection<Author>`` that contains the
131147
following mutually recursive types:
@@ -363,7 +379,7 @@ Key Changes
363379
~~~~~~~~~~~
364380

365381
Node.js Version
366-
+++++++++++++++
382+
```````````````
367383

368384
The minimum supported version of Node.js is now v12.9 or greater for
369385
version 4 of the driver. Support for our 3.x branches will continue
@@ -375,7 +391,7 @@ until summer 2022 to allow time to upgrade.
375391

376392

377393
Cursor Improvements
378-
+++++++++++++++++++
394+
```````````````````
379395

380396
Our Cursor implementation is now updated to make it clear what is possible
381397
before and after execution of an operation.
@@ -407,7 +423,7 @@ similar to the following:
407423
- ``ListCollectionsCursor``
408424

409425
Cursor Stream API
410-
^^^^^^^^^^^^^^^^^
426+
+++++++++++++++++
411427

412428
Our Cursor types no longer extend ``Readable`` directly. They must be
413429
transformed into a stream by calling ``cursor.stream()``.
@@ -427,7 +443,7 @@ Use ``for await of`` syntax or any ``Promise`` helpers for
427443
asynchronous iteration.
428444

429445
``MongoClientOptions`` Interface
430-
+++++++++++++++++++++++++++++++++
446+
````````````````````````````````
431447

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

444460
``createCollection()``
445-
++++++++++++++++++++++
461+
``````````````````````
446462

447463
This method no longer supports a ``strict`` option, which returned
448464
an error if the collection did not exist. To assert the existence of
@@ -461,7 +477,7 @@ a collection, use the ``listCollections()`` method instead.
461477
}
462478

463479
``BulkWriteError`` → ``MongoBulkWriteError``
464-
++++++++++++++++++++++++++++++++++++++++++++
480+
````````````````````````````````````````````
465481

466482
``BulkWriteError`` is now renamed to ``MongoBulkWriteError``.
467483

@@ -470,20 +486,20 @@ depending on your settings. Import the new class name ``MongoBulkWriteError``
470486
when testing for errors in bulk operations.
471487

472488
``DB``
473-
++++++
489+
``````
474490

475491
``DB`` is no longer an ``EventEmitter``. Listen for events directly from your
476492
``MongoClient`` instance.
477493

478494
``Collection.group()``
479-
++++++++++++++++++++++
495+
``````````````````````
480496

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

485501
Authentication
486-
++++++++++++++
502+
``````````````
487503

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

@@ -507,15 +523,15 @@ Authentication
507523
new MongoClient(url, { auth: { username: "<>", password: "<>" } })
508524

509525
``GridStore`` Removal
510-
+++++++++++++++++++++
526+
`````````````````````
511527

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

515531
Below are some snippets that represent equivalent operations.
516532

517533
Construction
518-
^^^^^^^^^^^^
534+
++++++++++++
519535

520536
.. example::
521537

@@ -527,7 +543,7 @@ Construction
527543
const bucket = new GridFSBucket(client.db('test')[,options])
528544

529545
File Seeking
530-
^^^^^^^^^^^^
546+
++++++++++++
531547

532548
GridFSBucket uses the Node.js Stream API. You can replicate file seeking
533549
by using the ``start`` and ``end`` options, creating a download stream
@@ -540,7 +556,7 @@ from your ``GridFSBucket``.
540556
bucket.openDownloadStreamByName(filename, { start: 0, end: 100 })
541557

542558
File Upload & Download
543-
^^^^^^^^^^^^^^^^^^^^^^
559+
++++++++++++++++++++++
544560

545561
.. example::
546562

@@ -579,7 +595,7 @@ File Upload & Download
579595
``GridFSBucket`` does not need to be closed like ``GridStore``.
580596

581597
File Deletion
582-
^^^^^^^^^^^^^
598+
+++++++++++++
583599

584600
.. example::
585601

@@ -591,7 +607,7 @@ File Deletion
591607
bucket.delete(file_id);
592608

593609
Finding File Metadata
594-
^^^^^^^^^^^^^^^^^^^^^
610+
+++++++++++++++++++++
595611

596612
File metadata that used to be accessible on the ``GridStore`` instance can be
597613
found by querying the bucket.
@@ -603,7 +619,7 @@ found by querying the bucket.
603619
const fileMetaDataList: GridFSFile[] = bucket.find({}).toArray();
604620

605621
Unified Topology
606-
++++++++++++++++
622+
````````````````
607623

608624
- We internally now only manage a ``unifiedTopology`` when you connect
609625
to a ``mongod``. The differences between this and previous versions
@@ -615,13 +631,13 @@ Unified Topology
615631
to connect to uninitialized replica set members.
616632

617633
Explain
618-
+++++++
634+
```````
619635

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

623639
Command Monitoring
624-
++++++++++++++++++
640+
``````````````````
625641

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

0 commit comments

Comments
 (0)