File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ PyMongo 4.3 brings a number of improvements including:
29
29
- PyMongo now internally caches AWS credentials that it fetches from AWS
30
30
endpoints, to avoid rate limitations. The cache is cleared when the
31
31
credentials expire or an error is encountered.
32
+ - When using the ``MONGODB-AWS `` authentication mechanism with the
33
+ ``aws `` extra, the behavior of credential fetching has changed with
34
+ ``pymongo_auth_aws>=1.1.0 ``. Please see :doc: `examples/authentication ` for
35
+ more information.
32
36
33
37
Bug fixes
34
38
.........
Original file line number Diff line number Diff line change @@ -264,16 +264,23 @@ security (or session) token.
264
264
265
265
Credentials can be configured through the MongoDB URI, environment variables,
266
266
or the local EC2 or ECS endpoint. The order in which the client searches for
267
- credentials is:
268
-
269
- #. Credentials passed through the URI
270
- #. Environment variables
271
- #. ECS endpoint if and only if ``AWS_CONTAINER_CREDENTIALS_RELATIVE_URI `` is set.
272
- #. EC2 endpoint
267
+ `credentials `_ is the same as the one used by the AWS ``boto3 `` library
268
+ when using ``pymongo_auth_aws>=1.1.0 ``.
269
+
270
+ Because we are now using ``boto3 `` to handle credentials, the order and
271
+ locations of credentials are slightly different from previous versions.
272
+ Particularly, if you have a shared AWS credentials or config file,
273
+ then those credentials will be used by default if AWS auth environment
274
+ variables are not set. To override this behavior, set ``AWS_PROFILE="" `` in
275
+ your shell or add ``os.environ["AWS_PROFILE"] = "" `` to your script or
276
+ application. Alternatively, you can create an AWS profile specifically for
277
+ your MongoDB credentials and set ``AWS_PROFILE `` to that profile name.
273
278
274
279
MONGODB-AWS authenticates against the "$external" virtual database, so none of
275
280
the URIs in this section need to include the ``authSource `` URI option.
276
281
282
+ .. _credentials : https://boto3.amazonaws.com/v1/documentation/api/latest/guide/credentials.html
283
+
277
284
AWS IAM credentials
278
285
~~~~~~~~~~~~~~~~~~~
279
286
You can’t perform that action at this time.
0 commit comments