Skip to content

Commit 52759c7

Browse files
Fix all warnings generated by a build with Sphinx
1 parent 97c54e2 commit 52759c7

File tree

21 files changed

+161
-99
lines changed

21 files changed

+161
-99
lines changed

source/auth/auth.rst

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -794,12 +794,12 @@ Client Second
794794

795795
.. code:: javascript
796796
797-
{
797+
{
798798
"a" : "AWS4-HMAC-SHA256 Credential=AKIAICGVLKOKZVY3X3DA/20191107/us-east-1/sts/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-date;x-mongodb-gs2-cb-flag;x-mongodb-server-nonce, Signature=ab62ce1c75f19c4c8b918b2ed63b46512765ed9b8bb5d79b374ae83eeac11f55",
799799
"d" : "20191107T002607Z"
800800
"t" : "<security_token>"
801801
}
802-
|
802+
803803
Note that `X-AMZ-Security-Token` is required when using temporary credentials. When using regular credentials, it
804804
MUST be omitted. Each message above will be encoded as BSON V1.1 objects and sent to the peer as the value of
805805
``payload``. Therefore, the SASL conversation would appear as:
@@ -813,7 +813,7 @@ Client First
813813
"mechanism" : "MONGODB-AWS"
814814
"payload" : new BinData(0, "NAAAAAVyACAAAAAAWj0lSjp8M0BMKGU+QVAzRSpWfk0hJigqO1V+b0FaVz4QcABuAAAAAA==")
815815
}
816-
|
816+
817817
Server First
818818

819819
.. code:: javascript
@@ -824,7 +824,7 @@ Server First
824824
"payload" : new BinData(0, "ZgAAAAVzAEAAAAAAWj0lSjp8M0BMKGU+QVAzRSpWfk0hJigqO1V+b0FaVz5Rj7x9UOBHJLvPgvgPS9sSzZUWgAPTy8HBbI1cG1WJ9gJoABIAAABzdHMuYW1hem9uYXdzLmNvbQAA"),
825825
"ok" : 1.0
826826
}
827-
|
827+
828828
Client Second:
829829

830830
.. code:: javascript
@@ -834,10 +834,9 @@ Client Second:
834834
"conversationId" : 1,
835835
"payload" : new BinData(0, "LQEAAAJhAAkBAABBV1M0LUhNQUMtU0hBMjU2IENyZWRlbnRpYWw9QUtJQUlDR1ZMS09LWlZZM1gzREEvMjAxOTExMTIvdXMtZWFzdC0xL3N0cy9hd3M0X3JlcXVlc3QsIFNpZ25lZEhlYWRlcnM9Y29udGVudC1sZW5ndGg7Y29udGVudC10eXBlO2hvc3Q7eC1hbXotZGF0ZTt4LW1vbmdvZGItZ3MyLWNiLWZsYWc7eC1tb25nb2RiLXNlcnZlci1ub25jZSwgU2lnbmF0dXJlPThhMTI0NGZjODYyZTI5YjZiZjc0OTFmMmYwNDE5NDY2ZGNjOTFmZWU1MTJhYTViM2ZmZjQ1NDY3NDEwMjJiMmUAAmQAEQAAADIwMTkxMTEyVDIxMDEyMloAAA==")
836836
}
837-
|
838837
839838
In response to the Server First message, drivers MUST send an ``authorization header``. Drivers MUST follow the
840-
`Signature Version 4 Signing Process <https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html>`_ to
839+
`Signature Version 4 Signing Process <https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html>`__ to
841840
calculate the signature for the ``authorization header``. The required and optional headers and their associated
842841
values drivers MUST use for the canonical request (see `Summary of Signing Steps
843842
<https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html>`_) are specified in the table
@@ -846,19 +845,17 @@ below. The following pseudocode shows the construction of the Authorization head
846845
.. code:: javascript
847846
848847
Authorization: algorithm Credential=access key ID/credential scope, SignedHeaders=SignedHeaders, Signature=signature
849-
|
850848
851849
The following example shows a finished Authorization header.
852850

853851
.. code:: javascript
854852
855853
Authorization: AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20150830/us-east-1/iam/aws4_request, SignedHeaders=content-type;host;x-amz-date, Signature=5d672d79c15b13162d9279b0855cfba6789a8edb4c82c400e06b5924a6f2b5d7
856-
|
857854
858855
The following diagram is a summary of the steps drivers MUST follow to calculate the signature.
859856

860857
.. image:: includes/calculating_a_signature.png
861-
|
858+
862859
======================== ======================================================================================================
863860
Name Value
864861
======================== ======================================================================================================
@@ -868,8 +865,8 @@ Content-Type* application/x-www-form-urlencoded
868865
Content-Length* 43
869866
Host* Host field from Server First Message
870867
Region Derived from Host - see `Region Calculation`_ below
871-
X-Amz-Date* See `Amazon Documentation <https://docs.aws.amazon.com/general/latest/gr/sigv4_elements.html>`_
872-
X-Amz-Security-Token* Optional, see `Amazon Documentation <https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html?shortFooter=true>`_
868+
X-Amz-Date* See `Amazon Documentation <https://docs.aws.amazon.com/general/latest/gr/sigv4_elements.html>`__
869+
X-Amz-Security-Token* Optional, see `Amazon Documentation <https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html?shortFooter=true>`__
873870
X-MongoDB-Server-Nonce* Base64 string of server nonce
874871
X-MongoDB-GS2-CB-Flag* ASCII lower-case character ‘n’ or ‘y’ or ‘p’
875872
X-MongoDB-Optional-Data* Optional data, base64 encoded representation of the optional object provided by the client
@@ -952,14 +949,14 @@ An example URI for authentication with MONGODB-AWS using AWS IAM credentials pas
952949
.. code:: javascript
953950
954951
"mongodb://<access_key>:<secret_key>@mongodb.example.com/?authMechanism=MONGODB-AWS"
955-
|
956-
Users MAY have obtained temporary credentials through an `AssumeRole <https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html>`_
957-
request. If so, then in addition to a username and password, users MAY also provide an ``AWS_SESSION_TOKEN`` as a ``mechanism_property``.
952+
953+
Users MAY have obtained temporary credentials through an `AssumeRole <https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html>`_
954+
request. If so, then in addition to a username and password, users MAY also provide an ``AWS_SESSION_TOKEN`` as a ``mechanism_property``.
958955

959956
.. code:: javascript
960957
961958
"mongodb://<access_key>:<secret_key>@mongodb.example.com/?authMechanism=MONGODB-AWS&authMechanismProperties=AWS_SESSION_TOKEN:<security_token>"
962-
|
959+
963960
Environment variables
964961
_____________________
965962
AWS Lambda runtimes set several `environment variables <https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html#configuration-envvars-runtime>`_ during initialization. To support AWS Lambda runtimes Drivers MUST check a subset of these variables, i.e., ``AWS_ACCESS_KEY_ID``, ``AWS_SECRET_ACCESS_KEY``, and ``AWS_SESSION_TOKEN``, for the access key ID, secret access key and session token, respectively if AWS credentials are not explicitly provided in the URI. The ``AWS_SESSION_TOKEN`` may or may not be set. However, if ``AWS_SESSION_TOKEN`` is set Drivers MUST use its value as the session token.
@@ -990,34 +987,40 @@ If the environment variable ``AWS_CONTAINER_CREDENTIALS_RELATIVE_URI`` is unset,
990987
.. code:: html
991988

992989
http://169.254.169.254/latest/meta-data/iam/security-credentials/<role-name>
990+
993991
with the required header,
994992

995993
.. code:: html
996994

997995
X-aws-ec2-metadata-token: <secret-token>
996+
998997
to access the EC2 instance's metadata. Drivers MUST obtain the role name from querying the URI
999998

1000999
.. code:: html
10011000

10021001
http://169.254.169.254/latest/meta-data/iam/security-credentials/
1002+
10031003
The role name request also requires the header ``X-aws-ec2-metadata-token``. Drivers MUST use v2 of the EC2 Instance Metadata Service (`IMDSv2 <https://aws.amazon.com/blogs/security/defense-in-depth-open-firewalls-reverse-proxies-ssrf-vulnerabilities-ec2-instance-metadata-service/>`_) to access the secret token. In other words, Drivers MUST
10041004

10051005
* Start a session with a simple HTTP PUT request to IMDSv2.
10061006
* The URL is ``http://169.254.169.254/latest/api/token``.
10071007
* The required header is ``X-aws-ec2-metadata-token-ttl-seconds``. Its value is the number of seconds the secret token should remain valid with a max of six hours (`21600` seconds).
10081008
* Capture the secret token IMDSv2 returned as a response to the PUT request. This token is the value for the header ``X-aws-ec2-metadata-token``.
1009+
10091010
The curl recipe below demonstrates the above. It retrieves a secret token that's valid for 30 seconds. It then uses that token to access the EC2 instance's credentials:
10101011

10111012
.. code:: shell-session
10121013
10131014
$ TOKEN=`curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 30"`
10141015
$ ROLE_NAME=`curl http://169.254.169.254/latest/meta-data/iam/security-credentials/ -H "X-aws-ec2-metadata-token: $TOKEN"`
10151016
$ curl http://169.254.169.254/latest/meta-data/iam/security-credentials/$ROLE_NAME -H "X-aws-ec2-metadata-token: $TOKEN"
1017+
10161018
Drivers can test this process using the mock EC2 server in `mongo-enterprise-modules <https://github.com/10gen/mongo-enterprise-modules/blob/master/jstests/external_auth/lib/ec2_metadata_http_server.py>`_. The script must be run with `python3`:
10171019

10181020
.. code:: shell-session
10191021
10201022
python3 ec2_metadata_http_server.py
1023+
10211024
To re-direct queries from the EC2 endpoint to the mock server, replace the link-local address (``http://169.254.169.254``) with the IP and port of the mock server (by default, ``http://localhost:8000``). For example, the curl script above becomes:
10221025

10231026
.. code:: shell-session

source/auth/tests/mongodb-aws.rst

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ For brevity, this section gives the values ``<AccessKeyId>``, ``<SecretAccessKey
1717
AccessKeyId=AKIAI44QH8DHBEXAMPLE
1818
SecretAccessKey=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
1919
Token=AQoDYXdzEJr...<remainder of security token>
20-
|
20+
2121
.. sectnum::
2222

2323
Regular credentials
@@ -28,7 +28,7 @@ Drivers MUST be able to authenticate by providing a valid access key id and secr
2828
.. code-block::
2929
3030
mongodb://<AccessKeyId>:<SecretAccessKey>@localhost/?authMechanism=MONGODB-AWS
31-
|
31+
3232
EC2 Credentials
3333
===============
3434

@@ -37,8 +37,8 @@ Drivers MUST be able to authenticate from an EC2 instance via temporary credenti
3737
.. code-block::
3838
3939
mongodb://localhost/?authMechanism=MONGODB-AWS
40-
|
41-
.. note:: No username, password or session token is passed into the URI. Drivers MUST query the EC2 instance endpoint to obtain these credentials.
40+
41+
.. note:: No username, password or session token is passed into the URI. Drivers MUST query the EC2 instance endpoint to obtain these credentials.
4242

4343
ECS instance
4444
============
@@ -48,8 +48,8 @@ Drivers MUST be able to authenticate from an ECS container via temporary credent
4848
.. code-block::
4949
5050
mongodb://localhost/?authMechanism=MONGODB-AWS
51-
|
52-
.. note:: No username, password or session token is passed into the URI. Drivers MUST query the ECS container endpoint to obtain these credentials.
51+
52+
.. note:: No username, password or session token is passed into the URI. Drivers MUST query the ECS container endpoint to obtain these credentials.
5353

5454
AssumeRole
5555
==========
@@ -59,7 +59,7 @@ Drivers MUST be able to authenticate using temporary credentials returned from a
5959
.. code-block::
6060
6161
mongodb://<AccessKeyId>:<SecretAccessKey>@localhost/?authMechanism=MONGODB-AWS&authMechanismProperties=AWS_SESSION_TOKEN:<Token>
62-
|
62+
6363
AWS Lambda
6464
==========
6565

@@ -70,7 +70,6 @@ Drivers MUST be able to authenticate via an access key ID, secret access key and
7070
AWS_ACCESS_KEY_ID
7171
AWS_SECRET_ACCESS_KEY
7272
AWS_SESSION_TOKEN
73-
|
7473
7574
Sample URIs both with and without optional session tokens set are shown below. Drivers MUST test both cases.
7675

@@ -81,7 +80,7 @@ Sample URIs both with and without optional session tokens set are shown below. D
8180
export AWS_SECRET_ACCESS_KEY="<SecretAccessKey>"
8281
8382
URI="mongodb://localhost/?authMechanism=MONGODB-AWS"
84-
|
83+
8584
.. code-block:: bash
8685
8786
# with a session token
@@ -90,5 +89,5 @@ Sample URIs both with and without optional session tokens set are shown below. D
9089
export AWS_SESSION_TOKEN="<Token>"
9190
9291
URI="mongodb://localhost/?authMechanism=MONGODB-AWS"
93-
|
92+
9493
.. note:: No username, password or session token is passed into the URI. Drivers MUST check the environment variables listed above for these values. If the session token is set Drivers MUST use it.

source/benchmarking/benchmarking.rst

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -579,7 +579,7 @@ Phases:
579579
| | (or JSON string for C). |
580580
+--------------------------------------+--------------------------------------+
581581
| Before task | Drop the 'corpus' collection. |
582-
| | Create an empty 'corpus' collection |
582+
| | Create an empty 'corpus' collection |
583583
| | with the 'create' command. |
584584
| | Construct a Collection object for |
585585
| | the 'corpus' collection to use for |
@@ -620,7 +620,7 @@ Phases:
620620
| | (or JSON string for C). |
621621
+--------------------------------------+--------------------------------------+
622622
| Before task | Drop the 'corpus' collection. |
623-
| | Create an empty 'corpus' collection |
623+
| | Create an empty 'corpus' collection |
624624
| | with the 'create' command. |
625625
| | Construct a Collection object for |
626626
| | the 'corpus' collection to use for |
@@ -792,13 +792,13 @@ Phases:
792792

793793
+--------------------------------------+--------------------------------------+
794794
| Setup | Construct a MongoClient object. |
795-
| | Drop the 'perftest' database. Load |
795+
| | rop the 'perftest' database. Load |
796796
| | the GRIDFS\_LARGE file as a string |
797797
| | or other language-appropriate type |
798798
| | for binary octet data. |
799799
+--------------------------------------+--------------------------------------+
800800
| Before task | Drop the default GridFS bucket. |
801-
| | Insert a 1-byte file into the |
801+
| | Insert a 1-byte file into the |
802802
| | bucket. (This ensures the bucket |
803803
| | collections and indices have been |
804804
| | created.) |
@@ -838,8 +838,8 @@ Phases:
838838

839839
+--------------------------------------+--------------------------------------+
840840
| Setup | Construct a MongoClient object. |
841-
| | Drop the 'perftest' database. |
842-
| | Upload the GRIDFS\_LARGE file to |
841+
| | Drop the 'perftest' database. |
842+
| | Upload the GRIDFS\_LARGE file to |
843843
| | the default gridFS bucket with the |
844844
| | name "gridfstest". Record the |
845845
| | \_id of the uploaded file. |
@@ -907,7 +907,7 @@ Phases:
907907
| | |
908908
+--------------------------------------+--------------------------------------+
909909
| Before task | Drop the 'corpus' collection. |
910-
| | Create an empty 'corpus' collection |
910+
| | Create an empty 'corpus' collection |
911911
| | with the 'create' command. |
912912
+--------------------------------------+--------------------------------------+
913913
| Do task | Do an unordered insert of all |
@@ -939,12 +939,11 @@ Phases:
939939

940940
+--------------------------------------+--------------------------------------+
941941
| Setup | Construct a MongoClient object. |
942-
| | Drop the 'perftest' database. Drop |
942+
| | Drop the 'perftest' database. Drop |
943943
| | the 'corpus' collection. Do an |
944944
| | unordered insert of all 500,000 |
945945
| | documents in the dataset into the |
946946
| | 'corpus' collection. |
947-
| | |
948947
+--------------------------------------+--------------------------------------+
949948
| Before task | Construct whatever objects, threads, |
950949
| | etc. are required for exporting the |
@@ -1023,8 +1022,8 @@ Phases:
10231022

10241023
+--------------------------------------+--------------------------------------+
10251024
| Setup | Construct a MongoClient object. |
1026-
| | Drop the 'perftest' database. |
1027-
| | Construct a temporary directory for |
1025+
| | Drop the 'perftest' database. |
1026+
| | Construct a temporary directory for |
10281027
| | holding downloads. Drop the default |
10291028
| | GridFS bucket in the 'perftest' |
10301029
| | database. Upload the 50 file |

source/change-streams/change-streams.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ For example:
804804

805805
- A client creates a ``ChangeStream``, and calls ``watch``
806806
- The ``ChangeStream`` sends out the initial ``aggregate`` call, and receives a response
807-
with no initial values. Because there are no initial values, there is no latest resumeToken.
807+
with no initial values. Because there are no initial values, there is no latest resumeToken.
808808
- The client's network is partitioned from the server, causing the client's ``getMore`` to time out
809809
- Changes occur on the server.
810810
- The network is unpartitioned

source/change-streams/tests/README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ Spec Test Runner
103103
Before running the tests
104104

105105
- Create a MongoClient ``globalClient``, and connect to the server.
106-
When executing tests against a sharded cluster, ``globalClient`` must only connect to one mongos. This is because tests
107-
that set failpoints will only work consistently if both the ``configureFailPoint`` and failing commands are sent to the
108-
same mongos.
106+
When executing tests against a sharded cluster, ``globalClient`` must only connect to one mongos. This is because tests
107+
that set failpoints will only work consistently if both the ``configureFailPoint`` and failing commands are sent to the
108+
same mongos.
109109

110110
For each YAML file, for each element in ``tests``:
111111

0 commit comments

Comments
 (0)