...

Text file src/go.mongodb.org/mongo-driver/testdata/command-monitoring/logging/redacted-commands.json

Documentation: go.mongodb.org/mongo-driver/testdata/command-monitoring/logging

     1{
     2  "description": "redacted-commands",
     3  "schemaVersion": "1.13",
     4  "runOnRequirements": [
     5    {
     6      "minServerVersion": "5.0",
     7      "auth": false
     8    }
     9  ],
    10  "createEntities": [
    11    {
    12      "client": {
    13        "id": "client",
    14        "useMultipleMongoses": false,
    15        "observeLogMessages": {
    16          "command": "debug"
    17        }
    18      }
    19    },
    20    {
    21      "client": {
    22        "id": "failPointClient",
    23        "useMultipleMongoses": false
    24      }
    25    },
    26    {
    27      "database": {
    28        "id": "database",
    29        "client": "client",
    30        "databaseName": "logging-redaction-tests"
    31      }
    32    }
    33  ],
    34  "tests": [
    35    {
    36      "description": "authenticate command and resulting server-generated error are redacted",
    37      "operations": [
    38        {
    39          "name": "runCommand",
    40          "object": "database",
    41          "arguments": {
    42            "commandName": "authenticate",
    43            "command": {
    44              "authenticate": 1,
    45              "mechanism": "MONGODB-X509",
    46              "user": "CN=myName,OU=myOrgUnit,O=myOrg,L=myLocality,ST=myState,C=myCountry",
    47              "db": "$external"
    48            }
    49          },
    50          "expectError": {
    51            "isClientError": false
    52          }
    53        }
    54      ],
    55      "expectLogMessages": [
    56        {
    57          "client": "client",
    58          "messages": [
    59            {
    60              "level": "debug",
    61              "component": "command",
    62              "data": {
    63                "message": "Command started",
    64                "databaseName": "logging-redaction-tests",
    65                "commandName": "authenticate",
    66                "command": {
    67                  "$$matchAsDocument": {}
    68                }
    69              }
    70            },
    71            {
    72              "level": "debug",
    73              "component": "command",
    74              "failureIsRedacted": true,
    75              "data": {
    76                "message": "Command failed",
    77                "commandName": "authenticate",
    78                "failure": {
    79                  "$$exists": true
    80                }
    81              }
    82            }
    83          ]
    84        }
    85      ]
    86    },
    87    {
    88      "description": "network error in response to authenticate is not redacted",
    89      "operations": [
    90        {
    91          "name": "failPoint",
    92          "object": "testRunner",
    93          "arguments": {
    94            "client": "failPointClient",
    95            "failPoint": {
    96              "configureFailPoint": "failCommand",
    97              "mode": {
    98                "times": 1
    99              },
   100              "data": {
   101                "failCommands": [
   102                  "authenticate"
   103                ],
   104                "closeConnection": true
   105              }
   106            }
   107          }
   108        },
   109        {
   110          "name": "runCommand",
   111          "object": "database",
   112          "arguments": {
   113            "commandName": "authenticate",
   114            "command": {
   115              "authenticate": 1,
   116              "mechanism": "MONGODB-X509",
   117              "user": "CN=myName,OU=myOrgUnit,O=myOrg,L=myLocality,ST=myState,C=myCountry"
   118            }
   119          },
   120          "expectError": {
   121            "isClientError": true
   122          }
   123        }
   124      ],
   125      "expectLogMessages": [
   126        {
   127          "client": "client",
   128          "messages": [
   129            {
   130              "level": "debug",
   131              "component": "command",
   132              "data": {
   133                "message": "Command started",
   134                "databaseName": "logging-redaction-tests",
   135                "commandName": "authenticate",
   136                "command": {
   137                  "$$matchAsDocument": {}
   138                }
   139              }
   140            },
   141            {
   142              "level": "debug",
   143              "component": "command",
   144              "failureIsRedacted": false,
   145              "data": {
   146                "message": "Command failed",
   147                "commandName": "authenticate",
   148                "failure": {
   149                  "$$exists": true
   150                }
   151              }
   152            }
   153          ]
   154        }
   155      ]
   156    },
   157    {
   158      "description": "saslStart command and resulting server-generated error are redacted",
   159      "operations": [
   160        {
   161          "name": "runCommand",
   162          "object": "database",
   163          "arguments": {
   164            "commandName": "saslStart",
   165            "command": {
   166              "saslStart": 1,
   167              "payload": "definitely-invalid-payload",
   168              "db": "admin"
   169            }
   170          },
   171          "expectError": {
   172            "isClientError": false
   173          }
   174        }
   175      ],
   176      "expectLogMessages": [
   177        {
   178          "client": "client",
   179          "messages": [
   180            {
   181              "level": "debug",
   182              "component": "command",
   183              "data": {
   184                "message": "Command started",
   185                "databaseName": "logging-redaction-tests",
   186                "commandName": "saslStart",
   187                "command": {
   188                  "$$matchAsDocument": {}
   189                }
   190              }
   191            },
   192            {
   193              "level": "debug",
   194              "component": "command",
   195              "failureIsRedacted": true,
   196              "data": {
   197                "message": "Command failed",
   198                "commandName": "saslStart",
   199                "failure": {
   200                  "$$exists": true
   201                }
   202              }
   203            }
   204          ]
   205        }
   206      ]
   207    },
   208    {
   209      "description": "network error in response to saslStart is not redacted",
   210      "operations": [
   211        {
   212          "name": "failPoint",
   213          "object": "testRunner",
   214          "arguments": {
   215            "client": "failPointClient",
   216            "failPoint": {
   217              "configureFailPoint": "failCommand",
   218              "mode": {
   219                "times": 1
   220              },
   221              "data": {
   222                "failCommands": [
   223                  "saslStart"
   224                ],
   225                "closeConnection": true
   226              }
   227            }
   228          }
   229        },
   230        {
   231          "name": "runCommand",
   232          "object": "database",
   233          "arguments": {
   234            "commandName": "saslStart",
   235            "command": {
   236              "saslStart": 1,
   237              "payload": "ZmFrZXNhc2xwYXlsb2Fk",
   238              "mechanism": "MONGODB-X509"
   239            }
   240          },
   241          "expectError": {
   242            "isClientError": true
   243          }
   244        }
   245      ],
   246      "expectLogMessages": [
   247        {
   248          "client": "client",
   249          "messages": [
   250            {
   251              "level": "debug",
   252              "component": "command",
   253              "data": {
   254                "message": "Command started",
   255                "databaseName": "logging-redaction-tests",
   256                "commandName": "saslStart",
   257                "command": {
   258                  "$$matchAsDocument": {}
   259                }
   260              }
   261            },
   262            {
   263              "level": "debug",
   264              "component": "command",
   265              "failureIsRedacted": false,
   266              "data": {
   267                "message": "Command failed",
   268                "commandName": "saslStart",
   269                "failure": {
   270                  "$$exists": true
   271                }
   272              }
   273            }
   274          ]
   275        }
   276      ]
   277    },
   278    {
   279      "description": "saslContinue command and resulting server-generated error are redacted",
   280      "operations": [
   281        {
   282          "name": "runCommand",
   283          "object": "database",
   284          "arguments": {
   285            "commandName": "saslContinue",
   286            "command": {
   287              "saslContinue": 1,
   288              "conversationId": 0,
   289              "payload": "definitely-invalid-payload"
   290            }
   291          },
   292          "expectError": {
   293            "isClientError": false
   294          }
   295        }
   296      ],
   297      "expectLogMessages": [
   298        {
   299          "client": "client",
   300          "messages": [
   301            {
   302              "level": "debug",
   303              "component": "command",
   304              "data": {
   305                "message": "Command started",
   306                "databaseName": "logging-redaction-tests",
   307                "commandName": "saslContinue",
   308                "command": {
   309                  "$$matchAsDocument": {}
   310                }
   311              }
   312            },
   313            {
   314              "level": "debug",
   315              "component": "command",
   316              "failureIsRedacted": true,
   317              "data": {
   318                "message": "Command failed",
   319                "commandName": "saslContinue",
   320                "failure": {
   321                  "$$exists": true
   322                }
   323              }
   324            }
   325          ]
   326        }
   327      ]
   328    },
   329    {
   330      "description": "network error in response to saslContinue is not redacted",
   331      "operations": [
   332        {
   333          "name": "failPoint",
   334          "object": "testRunner",
   335          "arguments": {
   336            "client": "failPointClient",
   337            "failPoint": {
   338              "configureFailPoint": "failCommand",
   339              "mode": {
   340                "times": 1
   341              },
   342              "data": {
   343                "failCommands": [
   344                  "saslContinue"
   345                ],
   346                "closeConnection": true
   347              }
   348            }
   349          }
   350        },
   351        {
   352          "name": "runCommand",
   353          "object": "database",
   354          "arguments": {
   355            "commandName": "saslContinue",
   356            "command": {
   357              "saslContinue": 1,
   358              "conversationId": 0,
   359              "payload": "ZmFrZXNhc2xwYXlsb2Fk"
   360            }
   361          },
   362          "expectError": {
   363            "isClientError": true
   364          }
   365        }
   366      ],
   367      "expectLogMessages": [
   368        {
   369          "client": "client",
   370          "messages": [
   371            {
   372              "level": "debug",
   373              "component": "command",
   374              "data": {
   375                "message": "Command started",
   376                "databaseName": "logging-redaction-tests",
   377                "commandName": "saslContinue",
   378                "command": {
   379                  "$$matchAsDocument": {}
   380                }
   381              }
   382            },
   383            {
   384              "level": "debug",
   385              "component": "command",
   386              "failureIsRedacted": false,
   387              "data": {
   388                "message": "Command failed",
   389                "commandName": "saslContinue",
   390                "failure": {
   391                  "$$exists": true
   392                }
   393              }
   394            }
   395          ]
   396        }
   397      ]
   398    },
   399    {
   400      "description": "getnonce command and server reply are redacted",
   401      "runOnRequirements": [
   402        {
   403          "maxServerVersion": "6.1.99"
   404        }
   405      ],
   406      "operations": [
   407        {
   408          "name": "runCommand",
   409          "object": "database",
   410          "arguments": {
   411            "commandName": "getnonce",
   412            "command": {
   413              "getnonce": 1
   414            }
   415          }
   416        }
   417      ],
   418      "expectLogMessages": [
   419        {
   420          "client": "client",
   421          "messages": [
   422            {
   423              "level": "debug",
   424              "component": "command",
   425              "data": {
   426                "message": "Command started",
   427                "databaseName": "logging-redaction-tests",
   428                "commandName": "getnonce",
   429                "command": {
   430                  "$$matchAsDocument": {}
   431                }
   432              }
   433            },
   434            {
   435              "level": "debug",
   436              "component": "command",
   437              "data": {
   438                "message": "Command succeeded",
   439                "commandName": "getnonce",
   440                "reply": {
   441                  "$$matchAsDocument": {}
   442                }
   443              }
   444            }
   445          ]
   446        }
   447      ]
   448    },
   449    {
   450      "description": "network error in response to getnonce is not redacted",
   451      "runOnRequirements": [
   452        {
   453          "maxServerVersion": "6.1.99"
   454        }
   455      ],
   456      "operations": [
   457        {
   458          "name": "failPoint",
   459          "object": "testRunner",
   460          "arguments": {
   461            "client": "failPointClient",
   462            "failPoint": {
   463              "configureFailPoint": "failCommand",
   464              "mode": {
   465                "times": 1
   466              },
   467              "data": {
   468                "failCommands": [
   469                  "getnonce"
   470                ],
   471                "closeConnection": true
   472              }
   473            }
   474          }
   475        },
   476        {
   477          "name": "runCommand",
   478          "object": "database",
   479          "arguments": {
   480            "commandName": "getnonce",
   481            "command": {
   482              "getnonce": 1
   483            }
   484          },
   485          "expectError": {
   486            "isClientError": true
   487          }
   488        }
   489      ],
   490      "expectLogMessages": [
   491        {
   492          "client": "client",
   493          "messages": [
   494            {
   495              "level": "debug",
   496              "component": "command",
   497              "data": {
   498                "message": "Command started",
   499                "databaseName": "logging-redaction-tests",
   500                "commandName": "getnonce",
   501                "command": {
   502                  "$$matchAsDocument": {}
   503                }
   504              }
   505            },
   506            {
   507              "level": "debug",
   508              "component": "command",
   509              "failureIsRedacted": false,
   510              "data": {
   511                "message": "Command failed",
   512                "commandName": "getnonce",
   513                "failure": {
   514                  "$$exists": true
   515                }
   516              }
   517            }
   518          ]
   519        }
   520      ]
   521    },
   522    {
   523      "description": "createUser command and resulting server-generated error are redacted",
   524      "operations": [
   525        {
   526          "name": "runCommand",
   527          "object": "database",
   528          "arguments": {
   529            "commandName": "createUser",
   530            "command": {
   531              "createUser": "private",
   532              "pwd": {},
   533              "roles": []
   534            }
   535          },
   536          "expectError": {
   537            "isClientError": false
   538          }
   539        }
   540      ],
   541      "expectLogMessages": [
   542        {
   543          "client": "client",
   544          "messages": [
   545            {
   546              "level": "debug",
   547              "component": "command",
   548              "data": {
   549                "message": "Command started",
   550                "databaseName": "logging-redaction-tests",
   551                "commandName": "createUser",
   552                "command": {
   553                  "$$matchAsDocument": {}
   554                }
   555              }
   556            },
   557            {
   558              "level": "debug",
   559              "component": "command",
   560              "failureIsRedacted": true,
   561              "data": {
   562                "message": "Command failed",
   563                "commandName": "createUser",
   564                "failure": {
   565                  "$$exists": true
   566                }
   567              }
   568            }
   569          ]
   570        }
   571      ]
   572    },
   573    {
   574      "description": "network error in response to createUser is not redacted",
   575      "operations": [
   576        {
   577          "name": "failPoint",
   578          "object": "testRunner",
   579          "arguments": {
   580            "client": "failPointClient",
   581            "failPoint": {
   582              "configureFailPoint": "failCommand",
   583              "mode": {
   584                "times": 1
   585              },
   586              "data": {
   587                "failCommands": [
   588                  "createUser"
   589                ],
   590                "closeConnection": true
   591              }
   592            }
   593          }
   594        },
   595        {
   596          "name": "runCommand",
   597          "object": "database",
   598          "arguments": {
   599            "commandName": "createUser",
   600            "command": {
   601              "createUser": "private",
   602              "pwd": "pwd",
   603              "roles": []
   604            }
   605          },
   606          "expectError": {
   607            "isClientError": true
   608          }
   609        }
   610      ],
   611      "expectLogMessages": [
   612        {
   613          "client": "client",
   614          "messages": [
   615            {
   616              "level": "debug",
   617              "component": "command",
   618              "data": {
   619                "message": "Command started",
   620                "databaseName": "logging-redaction-tests",
   621                "commandName": "createUser",
   622                "command": {
   623                  "$$matchAsDocument": {}
   624                }
   625              }
   626            },
   627            {
   628              "level": "debug",
   629              "component": "command",
   630              "failureIsRedacted": false,
   631              "data": {
   632                "message": "Command failed",
   633                "commandName": "createUser",
   634                "failure": {
   635                  "$$exists": true
   636                }
   637              }
   638            }
   639          ]
   640        }
   641      ]
   642    },
   643    {
   644      "description": "updateUser command and resulting server-generated error are redacted",
   645      "operations": [
   646        {
   647          "name": "runCommand",
   648          "object": "database",
   649          "arguments": {
   650            "commandName": "updateUser",
   651            "command": {
   652              "updateUser": "private",
   653              "pwd": {},
   654              "roles": []
   655            }
   656          },
   657          "expectError": {
   658            "isClientError": false
   659          }
   660        }
   661      ],
   662      "expectLogMessages": [
   663        {
   664          "client": "client",
   665          "messages": [
   666            {
   667              "level": "debug",
   668              "component": "command",
   669              "data": {
   670                "message": "Command started",
   671                "databaseName": "logging-redaction-tests",
   672                "commandName": "updateUser",
   673                "command": {
   674                  "$$matchAsDocument": {}
   675                }
   676              }
   677            },
   678            {
   679              "level": "debug",
   680              "component": "command",
   681              "failureIsRedacted": true,
   682              "data": {
   683                "message": "Command failed",
   684                "commandName": "updateUser",
   685                "failure": {
   686                  "$$exists": true
   687                }
   688              }
   689            }
   690          ]
   691        }
   692      ]
   693    },
   694    {
   695      "description": "network error in response to updateUser is not redacted",
   696      "operations": [
   697        {
   698          "name": "failPoint",
   699          "object": "testRunner",
   700          "arguments": {
   701            "client": "failPointClient",
   702            "failPoint": {
   703              "configureFailPoint": "failCommand",
   704              "mode": {
   705                "times": 1
   706              },
   707              "data": {
   708                "failCommands": [
   709                  "updateUser"
   710                ],
   711                "closeConnection": true
   712              }
   713            }
   714          }
   715        },
   716        {
   717          "name": "runCommand",
   718          "object": "database",
   719          "arguments": {
   720            "commandName": "updateUser",
   721            "command": {
   722              "updateUser": "private",
   723              "pwd": "pwd",
   724              "roles": []
   725            }
   726          },
   727          "expectError": {
   728            "isClientError": true
   729          }
   730        }
   731      ],
   732      "expectLogMessages": [
   733        {
   734          "client": "client",
   735          "messages": [
   736            {
   737              "level": "debug",
   738              "component": "command",
   739              "data": {
   740                "message": "Command started",
   741                "databaseName": "logging-redaction-tests",
   742                "commandName": "updateUser",
   743                "command": {
   744                  "$$matchAsDocument": {}
   745                }
   746              }
   747            },
   748            {
   749              "level": "debug",
   750              "component": "command",
   751              "failureIsRedacted": false,
   752              "data": {
   753                "message": "Command failed",
   754                "commandName": "updateUser",
   755                "failure": {
   756                  "$$exists": true
   757                }
   758              }
   759            }
   760          ]
   761        }
   762      ]
   763    },
   764    {
   765      "description": "copydbgetnonce command and resulting server-generated error are redacted",
   766      "runOnRequirements": [
   767        {
   768          "maxServerVersion": "3.6.99"
   769        }
   770      ],
   771      "operations": [
   772        {
   773          "name": "runCommand",
   774          "object": "database",
   775          "arguments": {
   776            "commandName": "copydbgetnonce",
   777            "command": {
   778              "copydbgetnonce": "private"
   779            }
   780          },
   781          "expectError": {
   782            "isClientError": false
   783          }
   784        }
   785      ],
   786      "expectLogMessages": [
   787        {
   788          "client": "client",
   789          "messages": [
   790            {
   791              "level": "debug",
   792              "component": "command",
   793              "data": {
   794                "message": "Command started",
   795                "databaseName": "logging-redaction-tests",
   796                "commandName": "copydbgetnonce",
   797                "command": {
   798                  "$$matchAsDocument": {}
   799                }
   800              }
   801            },
   802            {
   803              "level": "debug",
   804              "component": "command",
   805              "failureIsRedacted": true,
   806              "data": {
   807                "message": "Command failed",
   808                "commandName": "copydbgetnonce",
   809                "failure": {
   810                  "$$exists": true
   811                }
   812              }
   813            }
   814          ]
   815        }
   816      ]
   817    },
   818    {
   819      "description": "network error in response to copydbgetnonce is not redacted",
   820      "runOnRequirements": [
   821        {
   822          "maxServerVersion": "3.6.99"
   823        }
   824      ],
   825      "operations": [
   826        {
   827          "name": "failPoint",
   828          "object": "testRunner",
   829          "arguments": {
   830            "client": "failPointClient",
   831            "failPoint": {
   832              "configureFailPoint": "failCommand",
   833              "mode": {
   834                "times": 1
   835              },
   836              "data": {
   837                "failCommands": [
   838                  "copydbgetnonce"
   839                ],
   840                "closeConnection": true
   841              }
   842            }
   843          }
   844        },
   845        {
   846          "name": "runCommand",
   847          "object": "database",
   848          "arguments": {
   849            "commandName": "copydbgetnonce",
   850            "command": {
   851              "copydbgetnonce": "private"
   852            }
   853          },
   854          "expectError": {
   855            "isClientError": true
   856          }
   857        }
   858      ],
   859      "expectLogMessages": [
   860        {
   861          "client": "client",
   862          "messages": [
   863            {
   864              "level": "debug",
   865              "component": "command",
   866              "data": {
   867                "message": "Command started",
   868                "databaseName": "logging-redaction-tests",
   869                "commandName": "copydbgetnonce",
   870                "command": {
   871                  "$$matchAsDocument": {}
   872                }
   873              }
   874            },
   875            {
   876              "level": "debug",
   877              "component": "command",
   878              "failureIsRedacted": false,
   879              "data": {
   880                "message": "Command failed",
   881                "commandName": "copydbgetnonce",
   882                "failure": {
   883                  "$$exists": true
   884                }
   885              }
   886            }
   887          ]
   888        }
   889      ]
   890    },
   891    {
   892      "description": "copydbsaslstart command and resulting server-generated error are redacted",
   893      "runOnRequirements": [
   894        {
   895          "maxServerVersion": "4.0.99"
   896        }
   897      ],
   898      "operations": [
   899        {
   900          "name": "runCommand",
   901          "object": "database",
   902          "arguments": {
   903            "commandName": "copydbsaslstart",
   904            "command": {
   905              "copydbsaslstart": "private"
   906            }
   907          },
   908          "expectError": {
   909            "isClientError": false
   910          }
   911        }
   912      ],
   913      "expectLogMessages": [
   914        {
   915          "client": "client",
   916          "messages": [
   917            {
   918              "level": "debug",
   919              "component": "command",
   920              "data": {
   921                "message": "Command started",
   922                "databaseName": "logging-redaction-tests",
   923                "commandName": "copydbsaslstart",
   924                "command": {
   925                  "$$matchAsDocument": {}
   926                }
   927              }
   928            },
   929            {
   930              "level": "debug",
   931              "component": "command",
   932              "failureIsRedacted": true,
   933              "data": {
   934                "message": "Command failed",
   935                "commandName": "copydbsaslstart",
   936                "failure": {
   937                  "$$exists": true
   938                }
   939              }
   940            }
   941          ]
   942        }
   943      ]
   944    },
   945    {
   946      "description": "network error in response to copydbsaslstart is not redacted",
   947      "runOnRequirements": [
   948        {
   949          "maxServerVersion": "4.0.99"
   950        }
   951      ],
   952      "operations": [
   953        {
   954          "name": "failPoint",
   955          "object": "testRunner",
   956          "arguments": {
   957            "client": "failPointClient",
   958            "failPoint": {
   959              "configureFailPoint": "failCommand",
   960              "mode": {
   961                "times": 1
   962              },
   963              "data": {
   964                "failCommands": [
   965                  "copydbsaslstart"
   966                ],
   967                "closeConnection": true
   968              }
   969            }
   970          }
   971        },
   972        {
   973          "name": "runCommand",
   974          "object": "database",
   975          "arguments": {
   976            "commandName": "copydbsaslstart",
   977            "command": {
   978              "copydbsaslstart": "private"
   979            }
   980          },
   981          "expectError": {
   982            "isClientError": true
   983          }
   984        }
   985      ],
   986      "expectLogMessages": [
   987        {
   988          "client": "client",
   989          "messages": [
   990            {
   991              "level": "debug",
   992              "component": "command",
   993              "data": {
   994                "message": "Command started",
   995                "databaseName": "logging-redaction-tests",
   996                "commandName": "copydbgetnonce",
   997                "command": {
   998                  "$$matchAsDocument": {}
   999                }
  1000              }
  1001            },
  1002            {
  1003              "level": "debug",
  1004              "component": "command",
  1005              "failureIsRedacted": false,
  1006              "data": {
  1007                "message": "Command failed",
  1008                "commandName": "copydbgetnonce",
  1009                "failure": {
  1010                  "$$exists": true
  1011                }
  1012              }
  1013            }
  1014          ]
  1015        }
  1016      ]
  1017    },
  1018    {
  1019      "description": "copydb command and resulting server-generated error are redacted",
  1020      "runOnRequirements": [
  1021        {
  1022          "maxServerVersion": "4.0.99"
  1023        }
  1024      ],
  1025      "operations": [
  1026        {
  1027          "name": "runCommand",
  1028          "object": "database",
  1029          "arguments": {
  1030            "commandName": "copydb",
  1031            "command": {
  1032              "copydb": "private"
  1033            }
  1034          },
  1035          "expectError": {
  1036            "isClientError": false
  1037          }
  1038        }
  1039      ],
  1040      "expectLogMessages": [
  1041        {
  1042          "client": "client",
  1043          "messages": [
  1044            {
  1045              "level": "debug",
  1046              "component": "command",
  1047              "data": {
  1048                "message": "Command started",
  1049                "databaseName": "logging-redaction-tests",
  1050                "commandName": "copydb",
  1051                "command": {
  1052                  "$$matchAsDocument": {}
  1053                }
  1054              }
  1055            },
  1056            {
  1057              "level": "debug",
  1058              "component": "command",
  1059              "failureIsRedacted": true,
  1060              "data": {
  1061                "message": "Command failed",
  1062                "commandName": "copydb",
  1063                "failure": {
  1064                  "$$exists": true
  1065                }
  1066              }
  1067            }
  1068          ]
  1069        }
  1070      ]
  1071    },
  1072    {
  1073      "description": "network error in response to copydb is not redacted",
  1074      "runOnRequirements": [
  1075        {
  1076          "maxServerVersion": "4.0.99"
  1077        }
  1078      ],
  1079      "operations": [
  1080        {
  1081          "name": "failPoint",
  1082          "object": "testRunner",
  1083          "arguments": {
  1084            "client": "failPointClient",
  1085            "failPoint": {
  1086              "configureFailPoint": "failCommand",
  1087              "mode": {
  1088                "times": 1
  1089              },
  1090              "data": {
  1091                "failCommands": [
  1092                  "copydb"
  1093                ],
  1094                "closeConnection": true
  1095              }
  1096            }
  1097          }
  1098        },
  1099        {
  1100          "name": "runCommand",
  1101          "object": "database",
  1102          "arguments": {
  1103            "commandName": "copydb",
  1104            "command": {
  1105              "copydb": "private"
  1106            }
  1107          },
  1108          "expectError": {
  1109            "isClientError": true
  1110          }
  1111        }
  1112      ],
  1113      "expectLogMessages": [
  1114        {
  1115          "client": "client",
  1116          "messages": [
  1117            {
  1118              "level": "debug",
  1119              "component": "command",
  1120              "data": {
  1121                "message": "Command started",
  1122                "databaseName": "logging-redaction-tests",
  1123                "commandName": "copydb",
  1124                "command": {
  1125                  "$$matchAsDocument": {}
  1126                }
  1127              }
  1128            },
  1129            {
  1130              "level": "debug",
  1131              "component": "command",
  1132              "failureIsRedacted": false,
  1133              "data": {
  1134                "message": "Command failed",
  1135                "commandName": "copydb",
  1136                "failure": {
  1137                  "$$exists": true
  1138                }
  1139              }
  1140            }
  1141          ]
  1142        }
  1143      ]
  1144    },
  1145    {
  1146      "description": "hello with speculative authenticate command and server reply are redacted",
  1147      "runOnRequirements": [
  1148        {
  1149          "minServerVersion": "4.9"
  1150        }
  1151      ],
  1152      "operations": [
  1153        {
  1154          "name": "runCommand",
  1155          "object": "database",
  1156          "arguments": {
  1157            "commandName": "hello",
  1158            "command": {
  1159              "hello": 1,
  1160              "speculativeAuthenticate": {
  1161                "saslStart": 1
  1162              }
  1163            }
  1164          }
  1165        }
  1166      ],
  1167      "expectLogMessages": [
  1168        {
  1169          "client": "client",
  1170          "messages": [
  1171            {
  1172              "level": "debug",
  1173              "component": "command",
  1174              "data": {
  1175                "message": "Command started",
  1176                "databaseName": "logging-redaction-tests",
  1177                "commandName": "hello",
  1178                "command": {
  1179                  "$$matchAsDocument": {}
  1180                }
  1181              }
  1182            },
  1183            {
  1184              "level": "debug",
  1185              "component": "command",
  1186              "data": {
  1187                "message": "Command succeeded",
  1188                "commandName": "hello",
  1189                "reply": {
  1190                  "$$matchAsDocument": {}
  1191                }
  1192              }
  1193            }
  1194          ]
  1195        }
  1196      ]
  1197    },
  1198    {
  1199      "description": "legacy hello with speculative authenticate command and server reply are redacted",
  1200      "operations": [
  1201        {
  1202          "name": "runCommand",
  1203          "object": "database",
  1204          "arguments": {
  1205            "commandName": "ismaster",
  1206            "command": {
  1207              "ismaster": 1,
  1208              "speculativeAuthenticate": {
  1209                "saslStart": 1
  1210              }
  1211            }
  1212          }
  1213        },
  1214        {
  1215          "name": "runCommand",
  1216          "object": "database",
  1217          "arguments": {
  1218            "commandName": "isMaster",
  1219            "command": {
  1220              "isMaster": 1,
  1221              "speculativeAuthenticate": {
  1222                "saslStart": 1
  1223              }
  1224            }
  1225          }
  1226        }
  1227      ],
  1228      "expectLogMessages": [
  1229        {
  1230          "client": "client",
  1231          "messages": [
  1232            {
  1233              "level": "debug",
  1234              "component": "command",
  1235              "data": {
  1236                "message": "Command started",
  1237                "databaseName": "logging-redaction-tests",
  1238                "commandName": "ismaster",
  1239                "command": {
  1240                  "$$matchAsDocument": {}
  1241                }
  1242              }
  1243            },
  1244            {
  1245              "level": "debug",
  1246              "component": "command",
  1247              "data": {
  1248                "message": "Command succeeded",
  1249                "commandName": "ismaster",
  1250                "reply": {
  1251                  "$$matchAsDocument": {}
  1252                }
  1253              }
  1254            },
  1255            {
  1256              "level": "debug",
  1257              "component": "command",
  1258              "data": {
  1259                "message": "Command started",
  1260                "databaseName": "logging-redaction-tests",
  1261                "commandName": "isMaster",
  1262                "command": {
  1263                  "$$matchAsDocument": {}
  1264                }
  1265              }
  1266            },
  1267            {
  1268              "level": "debug",
  1269              "component": "command",
  1270              "data": {
  1271                "message": "Command succeeded",
  1272                "commandName": "isMaster",
  1273                "reply": {
  1274                  "$$matchAsDocument": {}
  1275                }
  1276              }
  1277            }
  1278          ]
  1279        }
  1280      ]
  1281    },
  1282    {
  1283      "description": "hello without speculative authenticate command and server reply are not redacted",
  1284      "runOnRequirements": [
  1285        {
  1286          "minServerVersion": "4.9"
  1287        }
  1288      ],
  1289      "operations": [
  1290        {
  1291          "name": "runCommand",
  1292          "object": "database",
  1293          "arguments": {
  1294            "commandName": "hello",
  1295            "command": {
  1296              "hello": 1
  1297            }
  1298          }
  1299        }
  1300      ],
  1301      "expectLogMessages": [
  1302        {
  1303          "client": "client",
  1304          "messages": [
  1305            {
  1306              "level": "debug",
  1307              "component": "command",
  1308              "data": {
  1309                "message": "Command started",
  1310                "databaseName": "logging-redaction-tests",
  1311                "commandName": "hello",
  1312                "command": {
  1313                  "$$matchAsDocument": {
  1314                    "$$matchAsRoot": {
  1315                      "hello": 1
  1316                    }
  1317                  }
  1318                }
  1319              }
  1320            },
  1321            {
  1322              "level": "debug",
  1323              "component": "command",
  1324              "data": {
  1325                "message": "Command succeeded",
  1326                "commandName": "hello",
  1327                "reply": {
  1328                  "$$matchAsDocument": {
  1329                    "$$matchAsRoot": {
  1330                      "ok": 1,
  1331                      "isWritablePrimary": true
  1332                    }
  1333                  }
  1334                }
  1335              }
  1336            }
  1337          ]
  1338        }
  1339      ]
  1340    },
  1341    {
  1342      "description": "legacy hello without speculative authenticate command and server reply are not redacted",
  1343      "operations": [
  1344        {
  1345          "name": "runCommand",
  1346          "object": "database",
  1347          "arguments": {
  1348            "commandName": "ismaster",
  1349            "command": {
  1350              "ismaster": 1
  1351            }
  1352          }
  1353        },
  1354        {
  1355          "name": "runCommand",
  1356          "object": "database",
  1357          "arguments": {
  1358            "commandName": "isMaster",
  1359            "command": {
  1360              "isMaster": 1
  1361            }
  1362          }
  1363        }
  1364      ],
  1365      "expectLogMessages": [
  1366        {
  1367          "client": "client",
  1368          "messages": [
  1369            {
  1370              "level": "debug",
  1371              "component": "command",
  1372              "data": {
  1373                "message": "Command started",
  1374                "databaseName": "logging-redaction-tests",
  1375                "commandName": "ismaster",
  1376                "command": {
  1377                  "$$matchAsDocument": {
  1378                    "$$matchAsRoot": {
  1379                      "ismaster": 1
  1380                    }
  1381                  }
  1382                }
  1383              }
  1384            },
  1385            {
  1386              "level": "debug",
  1387              "component": "command",
  1388              "data": {
  1389                "message": "Command succeeded",
  1390                "commandName": "ismaster",
  1391                "reply": {
  1392                  "$$matchAsDocument": {
  1393                    "$$matchAsRoot": {
  1394                      "ok": 1,
  1395                      "ismaster": true
  1396                    }
  1397                  }
  1398                }
  1399              }
  1400            },
  1401            {
  1402              "level": "debug",
  1403              "component": "command",
  1404              "data": {
  1405                "message": "Command started",
  1406                "databaseName": "logging-redaction-tests",
  1407                "commandName": "isMaster",
  1408                "command": {
  1409                  "$$matchAsDocument": {
  1410                    "$$matchAsRoot": {
  1411                      "isMaster": 1
  1412                    }
  1413                  }
  1414                }
  1415              }
  1416            },
  1417            {
  1418              "level": "debug",
  1419              "component": "command",
  1420              "data": {
  1421                "message": "Command succeeded",
  1422                "commandName": "isMaster",
  1423                "reply": {
  1424                  "$$matchAsDocument": {
  1425                    "$$matchAsRoot": {
  1426                      "ok": 1,
  1427                      "ismaster": true
  1428                    }
  1429                  }
  1430                }
  1431              }
  1432            }
  1433          ]
  1434        }
  1435      ]
  1436    }
  1437  ]
  1438}

View as plain text