Skip to content

Commit 5800299

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 32118be commit 5800299

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

74+
Prioritization Order in Monitoring
75+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76+
7477
When connecting to MongoDB Server version 6.0 or later, the driver prioritizes
7578
``electionId`` settings before ``setVersion`` settings during Server Discovery and
7679
Monitoring events. In previous versions, the prioritization order was reversed.
7780

78-
This release also includes added support for **mutually
81+
Changes to AWS Authentication
82+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
83+
84+
When you install the optional ``aws-sdk/credential-providers``
85+
dependency, the driver uses the AWS SDK to retrieve AWS credentials from the
86+
environment.
87+
88+
To learn more about this behavior, see the :ref:`MONGODB-AWS
89+
<mongodb-aws>` section of the Authentication Mechanisms guide.
90+
91+
Mutually Recursive Schema Type Checking
92+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
93+
94+
This release includes added support for **mutually
7995
recursive** collection schema types. The driver also provides type safety for
8096
dot-notation queries up to a depth of eight in this release. At a depth greater
8197
than or equal to eight, Typescript successfully compiles your code but does not
8298
provide type safety. This depth limit on recursive types is a current limitation
8399
of TypeScript.
84100

85-
Mutually Recursive Schema Type Checking Example
86-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101+
Example
102+
```````
87103

88104
Suppose we have a collection of type ``Collection<Author>`` that contains the
89105
following mutually recursive types:
@@ -321,7 +337,7 @@ Key Changes
321337
~~~~~~~~~~~
322338

323339
Node.js Version
324-
+++++++++++++++
340+
```````````````
325341

326342
The minimum supported version of Node.js is now v12.9 or greater for
327343
version 4 of the driver. Support for our 3.x branches will continue
@@ -333,7 +349,7 @@ until summer 2022 to allow time to upgrade.
333349

334350

335351
Cursor Improvements
336-
+++++++++++++++++++
352+
```````````````````
337353

338354
Our Cursor implementation is now updated to make it clear what is possible
339355
before and after execution of an operation.
@@ -365,7 +381,7 @@ similar to the following:
365381
- ``ListCollectionsCursor``
366382

367383
Cursor Stream API
368-
^^^^^^^^^^^^^^^^^
384+
+++++++++++++++++
369385

370386
Our Cursor types no longer extend ``Readable`` directly. They must be
371387
transformed into a stream by calling ``cursor.stream()``.
@@ -385,7 +401,7 @@ Use ``for await of`` syntax or any ``Promise`` helpers for
385401
asynchronous iteration.
386402

387403
``MongoClientOptions`` Interface
388-
+++++++++++++++++++++++++++++++++
404+
````````````````````````````````
389405

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

402418
``createCollection()``
403-
++++++++++++++++++++++
419+
``````````````````````
404420

405421
This method no longer supports a ``strict`` option, which returned
406422
an error if the collection did not exist. To assert the existence of
@@ -419,7 +435,7 @@ a collection, use the ``listCollections()`` method instead.
419435
}
420436

421437
``BulkWriteError`` → ``MongoBulkWriteError``
422-
++++++++++++++++++++++++++++++++++++++++++++
438+
````````````````````````````````````````````
423439

424440
``BulkWriteError`` is now renamed to ``MongoBulkWriteError``.
425441

@@ -428,20 +444,20 @@ depending on your settings. Import the new class name ``MongoBulkWriteError``
428444
when testing for errors in bulk operations.
429445

430446
``DB``
431-
++++++
447+
``````
432448

433449
``DB`` is no longer an ``EventEmitter``. Listen for events directly from your
434450
``MongoClient`` instance.
435451

436452
``Collection.group()``
437-
++++++++++++++++++++++
453+
``````````````````````
438454

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

443459
Authentication
444-
++++++++++++++
460+
``````````````
445461

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

@@ -465,15 +481,15 @@ Authentication
465481
new MongoClient(url, { auth: { username: "<>", password: "<>" } })
466482

467483
``GridStore`` Removal
468-
+++++++++++++++++++++
484+
`````````````````````
469485

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

473489
Below are some snippets that represent equivalent operations.
474490

475491
Construction
476-
^^^^^^^^^^^^
492+
++++++++++++
477493

478494
.. example::
479495

@@ -485,7 +501,7 @@ Construction
485501
const bucket = new GridFSBucket(client.db('test')[,options])
486502

487503
File Seeking
488-
^^^^^^^^^^^^
504+
++++++++++++
489505

490506
GridFSBucket uses the Node.js Stream API. You can replicate file seeking
491507
by using the ``start`` and ``end`` options, creating a download stream
@@ -498,7 +514,7 @@ from your ``GridFSBucket``.
498514
bucket.openDownloadStreamByName(filename, { start: 0, end: 100 })
499515

500516
File Upload & Download
501-
^^^^^^^^^^^^^^^^^^^^^^
517+
++++++++++++++++++++++
502518

503519
.. example::
504520

@@ -537,7 +553,7 @@ File Upload & Download
537553
``GridFSBucket`` does not need to be closed like ``GridStore``.
538554

539555
File Deletion
540-
^^^^^^^^^^^^^
556+
+++++++++++++
541557

542558
.. example::
543559

@@ -549,7 +565,7 @@ File Deletion
549565
bucket.delete(file_id);
550566

551567
Finding File Metadata
552-
^^^^^^^^^^^^^^^^^^^^^
568+
+++++++++++++++++++++
553569

554570
File metadata that used to be accessible on the ``GridStore`` instance can be
555571
found by querying the bucket.
@@ -561,7 +577,7 @@ found by querying the bucket.
561577
const fileMetaDataList: GridFSFile[] = bucket.find({}).toArray();
562578

563579
Unified Topology
564-
++++++++++++++++
580+
````````````````
565581

566582
- We internally now only manage a ``unifiedTopology`` when you connect
567583
to a ``mongod``. The differences between this and previous versions
@@ -573,13 +589,13 @@ Unified Topology
573589
to connect to uninitialized replica set members.
574590

575591
Explain
576-
+++++++
592+
```````
577593

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

581597
Command Monitoring
582-
++++++++++++++++++
598+
``````````````````
583599

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

0 commit comments

Comments
 (0)