File tree Expand file tree Collapse file tree 5 files changed +79
-13
lines changed Expand file tree Collapse file tree 5 files changed +79
-13
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ Authentication
2828
2929.. include:: /includes/fact-onprem-auth
3030
31+ Roles
32+ -----
33+
34+ .. include:: /includes/fact-onprem-roles
35+
3136Behavior
3237--------
3338
Original file line number Diff line number Diff line change 1- The user specified in the connection string must have the
1+ The user specified in the connection string must have, at a minimum, the
22:atlasrole: `atlasAdmin ` role.
33
4- To use ``mongosync `` in the :ref: `reverse direction <c2c-api-reverse >`,
5- you must `create a custom role
6- </atlas/reference/api/custom-roles-create-a-role/> `__ that grants the
7- following ActionTypes:
4+ .. note ::
85
9- - setUserWriteBlockMode
10- - bypassWriteBlockingMode
11-
12- The ``setUserWriteBlockMode `` and ``bypassWriteBlockingMode ``
13- ActionTypes are available starting in MongoDB 6.0. To create the custom
14- roles, all clusters in a project must be on MongoDB 6.0 or higher.
6+ To use ``mongosync `` in the :ref: `reverse direction <c2c-api-reverse >`,
7+ you must :atlas: `create a custum role
8+ </reference/api/custom-roles-create-a-role> ` that grants the
9+ following ActionTypes:
10+
11+ - :authaction: `setUserWriteBlockMode `
12+ - :authaction: `bypassWriteBlockingMode `
13+
14+ The ``setUserWriteBlockMode `` and ``bypassWriteBlockingMode ``
15+ ActionTypes are available starting in MongoDB 6.0. To create the custom
16+ roles, all clusters in a project must be on MongoDB 6.0 or higher.
1517
Original file line number Diff line number Diff line change 1+
2+ The user specified in the connection string must have, at a minimum, the
3+ :authrole: `readAnyDatabase `, :authrole: `clusterMonitor `, and
4+ :authrole: `backup ` roles.
5+
6+ .. note ::
7+
8+ To use ``mongosync `` in the :ref: `reverse direction <c2c-api-reverse >`,
9+ you must create a custom role (using the :dbcommand: `createRole ` command)
10+ that grants the following ActionTypes:
11+
12+ - :authaction: `setUserWriteBlockMode `
13+ - :authaction: `bypassWriteBlockingMode `
14+
15+ The ``setUserWriteBlockMode `` and ``bypassWriteBlockingMode ``
16+ ActionTypes are available starting in MongoDB 6.0. To create the custom
17+ roles, all clusters in a project must be on MongoDB 6.0 or higher.
Original file line number Diff line number Diff line change 11To set ``enableUserWriteBlocking ``, the ``mongosync `` user must have a
2- role that includes the ``setUserWriteBlockMode `` and
3- ``bypassWriteBlockingMode `` ActionTypes.
2+ role that includes the :authaction: `setUserWriteBlockMode ` and
3+ :authaction: `bypassWriteBlockingMode ` ActionTypes.
4+
5+ .. note ::
6+
7+ When using ``enableUserWriteBlocking ``, writes are only blocked for users
8+ that do not have the :authaction: `bypassWriteBlockingMode ` ActionType. Users
9+ who have this ActionType are able to perform writes.
10+
11+
Original file line number Diff line number Diff line change @@ -21,11 +21,45 @@ Starts the synchronization between a source and destination cluster.
2121Requirements
2222------------
2323
24+ State
25+ ~~~~~
26+
2427To use the ``start`` endpoint, ``mongosync`` must be in the ``IDLE``
2528state.
2629
30+ User Write Blocking
31+ ~~~~~~~~~~~~~~~~~~~
32+
2733.. include:: /includes/fact-write-blocking-requirement.rst
34+
35+ To set a custom role for the ``mongosync`` user:
36+
37+ #. To create a custom role, use the :dbcommand:`createRole` command:
38+
39+ .. code-block:: javascript
40+
41+ db.adminCommand( {
42+ createRole: "reverseSync",
43+ privileges: [ {
44+ resource: { db: "", collection: "" },
45+ actions: [ "setUserWriteBlockMode", "bypassWriteBlockingMode" ]
46+ } ],
47+ roles: []
48+ } )
2849
50+ #. To grant the custom role to the ``mongosync`` user, use the :dbcommand:`grantRolesToUser` command:
51+
52+ .. code-block:: javascript
53+
54+ db.adminCommand( {
55+ grantRolesToUser: "mongosync-user",
56+ roles: [ { role: "reverseSync", db: "admin" } ]
57+ } )
58+
59+ Ensure that you use this configured ``mongosync`` user in the connection
60+ strings for the :setting:`cluster0` or :setting:`cluster1` settings when
61+ you start ``mongosync``.
62+
2963Request
3064-------
3165
You can’t perform that action at this time.
0 commit comments