...

Text file src/go.mongodb.org/mongo-driver/testdata/unified-test-format/valid-pass/observeSensitiveCommands.json

Documentation: go.mongodb.org/mongo-driver/testdata/unified-test-format/valid-pass

     1{
     2  "description": "observeSensitiveCommands",
     3  "schemaVersion": "1.5",
     4  "runOnRequirements": [
     5    {
     6      "auth": false
     7    }
     8  ],
     9  "createEntities": [
    10    {
    11      "client": {
    12        "id": "client0",
    13        "observeEvents": [
    14          "commandStartedEvent",
    15          "commandSucceededEvent"
    16        ],
    17        "observeSensitiveCommands": true
    18      }
    19    },
    20    {
    21      "client": {
    22        "id": "client1",
    23        "observeEvents": [
    24          "commandStartedEvent",
    25          "commandSucceededEvent"
    26        ],
    27        "observeSensitiveCommands": false
    28      }
    29    },
    30    {
    31      "client": {
    32        "id": "client2",
    33        "observeEvents": [
    34          "commandStartedEvent",
    35          "commandSucceededEvent"
    36        ]
    37      }
    38    },
    39    {
    40      "database": {
    41        "id": "database0",
    42        "client": "client0",
    43        "databaseName": "observeSensitiveCommands"
    44      }
    45    },
    46    {
    47      "database": {
    48        "id": "database1",
    49        "client": "client1",
    50        "databaseName": "observeSensitiveCommands"
    51      }
    52    },
    53    {
    54      "database": {
    55        "id": "database2",
    56        "client": "client2",
    57        "databaseName": "observeSensitiveCommands"
    58      }
    59    }
    60  ],
    61  "tests": [
    62    {
    63      "description": "getnonce is observed with observeSensitiveCommands=true",
    64      "runOnRequirements": [
    65        {
    66          "maxServerVersion": "6.1.99"
    67        }
    68      ],
    69      "operations": [
    70        {
    71          "name": "runCommand",
    72          "object": "database0",
    73          "arguments": {
    74            "commandName": "getnonce",
    75            "command": {
    76              "getnonce": 1
    77            }
    78          }
    79        }
    80      ],
    81      "expectEvents": [
    82        {
    83          "client": "client0",
    84          "events": [
    85            {
    86              "commandStartedEvent": {
    87                "commandName": "getnonce",
    88                "command": {
    89                  "getnonce": {
    90                    "$$exists": false
    91                  }
    92                }
    93              }
    94            },
    95            {
    96              "commandSucceededEvent": {
    97                "commandName": "getnonce",
    98                "reply": {
    99                  "ok": {
   100                    "$$exists": false
   101                  },
   102                  "nonce": {
   103                    "$$exists": false
   104                  }
   105                }
   106              }
   107            }
   108          ]
   109        }
   110      ]
   111    },
   112    {
   113      "description": "getnonce is not observed with observeSensitiveCommands=false",
   114      "runOnRequirements": [
   115        {
   116          "maxServerVersion": "6.1.99"
   117        }
   118      ],
   119      "operations": [
   120        {
   121          "name": "runCommand",
   122          "object": "database1",
   123          "arguments": {
   124            "commandName": "getnonce",
   125            "command": {
   126              "getnonce": 1
   127            }
   128          }
   129        }
   130      ],
   131      "expectEvents": [
   132        {
   133          "client": "client1",
   134          "events": []
   135        }
   136      ]
   137    },
   138    {
   139      "description": "getnonce is not observed by default",
   140      "runOnRequirements": [
   141        {
   142          "maxServerVersion": "6.1.99"
   143        }
   144      ],
   145      "operations": [
   146        {
   147          "name": "runCommand",
   148          "object": "database2",
   149          "arguments": {
   150            "commandName": "getnonce",
   151            "command": {
   152              "getnonce": 1
   153            }
   154          }
   155        }
   156      ],
   157      "expectEvents": [
   158        {
   159          "client": "client2",
   160          "events": []
   161        }
   162      ]
   163    },
   164    {
   165      "description": "hello with speculativeAuthenticate",
   166      "runOnRequirements": [
   167        {
   168          "minServerVersion": "4.9"
   169        }
   170      ],
   171      "operations": [
   172        {
   173          "name": "runCommand",
   174          "object": "database0",
   175          "arguments": {
   176            "commandName": "hello",
   177            "command": {
   178              "hello": 1,
   179              "speculativeAuthenticate": {
   180                "saslStart": 1
   181              }
   182            }
   183          }
   184        },
   185        {
   186          "name": "runCommand",
   187          "object": "database1",
   188          "arguments": {
   189            "commandName": "hello",
   190            "command": {
   191              "hello": 1,
   192              "speculativeAuthenticate": {
   193                "saslStart": 1
   194              }
   195            }
   196          }
   197        },
   198        {
   199          "name": "runCommand",
   200          "object": "database2",
   201          "arguments": {
   202            "commandName": "hello",
   203            "command": {
   204              "hello": 1,
   205              "speculativeAuthenticate": {
   206                "saslStart": 1
   207              }
   208            }
   209          }
   210        }
   211      ],
   212      "expectEvents": [
   213        {
   214          "client": "client0",
   215          "events": [
   216            {
   217              "commandStartedEvent": {
   218                "commandName": "hello",
   219                "command": {
   220                  "hello": {
   221                    "$$exists": false
   222                  },
   223                  "speculativeAuthenticate": {
   224                    "$$exists": false
   225                  }
   226                }
   227              }
   228            },
   229            {
   230              "commandSucceededEvent": {
   231                "commandName": "hello",
   232                "reply": {
   233                  "isWritablePrimary": {
   234                    "$$exists": false
   235                  },
   236                  "speculativeAuthenticate": {
   237                    "$$exists": false
   238                  }
   239                }
   240              }
   241            }
   242          ]
   243        },
   244        {
   245          "client": "client1",
   246          "events": []
   247        },
   248        {
   249          "client": "client2",
   250          "events": []
   251        }
   252      ]
   253    },
   254    {
   255      "description": "hello without speculativeAuthenticate is always observed",
   256      "runOnRequirements": [
   257        {
   258          "minServerVersion": "4.9"
   259        }
   260      ],
   261      "operations": [
   262        {
   263          "name": "runCommand",
   264          "object": "database0",
   265          "arguments": {
   266            "commandName": "hello",
   267            "command": {
   268              "hello": 1
   269            }
   270          }
   271        },
   272        {
   273          "name": "runCommand",
   274          "object": "database1",
   275          "arguments": {
   276            "commandName": "hello",
   277            "command": {
   278              "hello": 1
   279            }
   280          }
   281        },
   282        {
   283          "name": "runCommand",
   284          "object": "database2",
   285          "arguments": {
   286            "commandName": "hello",
   287            "command": {
   288              "hello": 1
   289            }
   290          }
   291        }
   292      ],
   293      "expectEvents": [
   294        {
   295          "client": "client0",
   296          "events": [
   297            {
   298              "commandStartedEvent": {
   299                "commandName": "hello",
   300                "command": {
   301                  "hello": 1
   302                }
   303              }
   304            },
   305            {
   306              "commandSucceededEvent": {
   307                "commandName": "hello",
   308                "reply": {
   309                  "isWritablePrimary": {
   310                    "$$exists": true
   311                  }
   312                }
   313              }
   314            }
   315          ]
   316        },
   317        {
   318          "client": "client1",
   319          "events": [
   320            {
   321              "commandStartedEvent": {
   322                "commandName": "hello",
   323                "command": {
   324                  "hello": 1
   325                }
   326              }
   327            },
   328            {
   329              "commandSucceededEvent": {
   330                "commandName": "hello",
   331                "reply": {
   332                  "isWritablePrimary": {
   333                    "$$exists": true
   334                  }
   335                }
   336              }
   337            }
   338          ]
   339        },
   340        {
   341          "client": "client2",
   342          "events": [
   343            {
   344              "commandStartedEvent": {
   345                "commandName": "hello",
   346                "command": {
   347                  "hello": 1
   348                }
   349              }
   350            },
   351            {
   352              "commandSucceededEvent": {
   353                "commandName": "hello",
   354                "reply": {
   355                  "isWritablePrimary": {
   356                    "$$exists": true
   357                  }
   358                }
   359              }
   360            }
   361          ]
   362        }
   363      ]
   364    },
   365    {
   366      "description": "legacy hello with speculativeAuthenticate",
   367      "operations": [
   368        {
   369          "name": "runCommand",
   370          "object": "database0",
   371          "arguments": {
   372            "commandName": "ismaster",
   373            "command": {
   374              "ismaster": 1,
   375              "speculativeAuthenticate": {
   376                "saslStart": 1
   377              }
   378            }
   379          }
   380        },
   381        {
   382          "name": "runCommand",
   383          "object": "database0",
   384          "arguments": {
   385            "commandName": "isMaster",
   386            "command": {
   387              "isMaster": 1,
   388              "speculativeAuthenticate": {
   389                "saslStart": 1
   390              }
   391            }
   392          }
   393        },
   394        {
   395          "name": "runCommand",
   396          "object": "database1",
   397          "arguments": {
   398            "commandName": "ismaster",
   399            "command": {
   400              "ismaster": 1,
   401              "speculativeAuthenticate": {
   402                "saslStart": 1
   403              }
   404            }
   405          }
   406        },
   407        {
   408          "name": "runCommand",
   409          "object": "database1",
   410          "arguments": {
   411            "commandName": "isMaster",
   412            "command": {
   413              "isMaster": 1,
   414              "speculativeAuthenticate": {
   415                "saslStart": 1
   416              }
   417            }
   418          }
   419        },
   420        {
   421          "name": "runCommand",
   422          "object": "database2",
   423          "arguments": {
   424            "commandName": "ismaster",
   425            "command": {
   426              "ismaster": 1,
   427              "speculativeAuthenticate": {
   428                "saslStart": 1
   429              }
   430            }
   431          }
   432        },
   433        {
   434          "name": "runCommand",
   435          "object": "database2",
   436          "arguments": {
   437            "commandName": "isMaster",
   438            "command": {
   439              "isMaster": 1,
   440              "speculativeAuthenticate": {
   441                "saslStart": 1
   442              }
   443            }
   444          }
   445        }
   446      ],
   447      "expectEvents": [
   448        {
   449          "client": "client0",
   450          "events": [
   451            {
   452              "commandStartedEvent": {
   453                "commandName": "ismaster",
   454                "command": {
   455                  "ismaster": {
   456                    "$$exists": false
   457                  },
   458                  "speculativeAuthenticate": {
   459                    "$$exists": false
   460                  }
   461                }
   462              }
   463            },
   464            {
   465              "commandSucceededEvent": {
   466                "commandName": "ismaster",
   467                "reply": {
   468                  "ismaster": {
   469                    "$$exists": false
   470                  },
   471                  "speculativeAuthenticate": {
   472                    "$$exists": false
   473                  }
   474                }
   475              }
   476            },
   477            {
   478              "commandStartedEvent": {
   479                "commandName": "isMaster",
   480                "command": {
   481                  "isMaster": {
   482                    "$$exists": false
   483                  },
   484                  "speculativeAuthenticate": {
   485                    "$$exists": false
   486                  }
   487                }
   488              }
   489            },
   490            {
   491              "commandSucceededEvent": {
   492                "commandName": "isMaster",
   493                "reply": {
   494                  "ismaster": {
   495                    "$$exists": false
   496                  },
   497                  "speculativeAuthenticate": {
   498                    "$$exists": false
   499                  }
   500                }
   501              }
   502            }
   503          ]
   504        },
   505        {
   506          "client": "client1",
   507          "events": []
   508        },
   509        {
   510          "client": "client2",
   511          "events": []
   512        }
   513      ]
   514    },
   515    {
   516      "description": "legacy hello without speculativeAuthenticate is always observed",
   517      "operations": [
   518        {
   519          "name": "runCommand",
   520          "object": "database0",
   521          "arguments": {
   522            "commandName": "ismaster",
   523            "command": {
   524              "ismaster": 1
   525            }
   526          }
   527        },
   528        {
   529          "name": "runCommand",
   530          "object": "database0",
   531          "arguments": {
   532            "commandName": "isMaster",
   533            "command": {
   534              "isMaster": 1
   535            }
   536          }
   537        },
   538        {
   539          "name": "runCommand",
   540          "object": "database1",
   541          "arguments": {
   542            "commandName": "ismaster",
   543            "command": {
   544              "ismaster": 1
   545            }
   546          }
   547        },
   548        {
   549          "name": "runCommand",
   550          "object": "database1",
   551          "arguments": {
   552            "commandName": "isMaster",
   553            "command": {
   554              "isMaster": 1
   555            }
   556          }
   557        },
   558        {
   559          "name": "runCommand",
   560          "object": "database2",
   561          "arguments": {
   562            "commandName": "ismaster",
   563            "command": {
   564              "ismaster": 1
   565            }
   566          }
   567        },
   568        {
   569          "name": "runCommand",
   570          "object": "database2",
   571          "arguments": {
   572            "commandName": "isMaster",
   573            "command": {
   574              "isMaster": 1
   575            }
   576          }
   577        }
   578      ],
   579      "expectEvents": [
   580        {
   581          "client": "client0",
   582          "events": [
   583            {
   584              "commandStartedEvent": {
   585                "commandName": "ismaster",
   586                "command": {
   587                  "ismaster": 1
   588                }
   589              }
   590            },
   591            {
   592              "commandSucceededEvent": {
   593                "commandName": "ismaster",
   594                "reply": {
   595                  "ismaster": {
   596                    "$$exists": true
   597                  }
   598                }
   599              }
   600            },
   601            {
   602              "commandStartedEvent": {
   603                "commandName": "isMaster",
   604                "command": {
   605                  "isMaster": 1
   606                }
   607              }
   608            },
   609            {
   610              "commandSucceededEvent": {
   611                "commandName": "isMaster",
   612                "reply": {
   613                  "ismaster": {
   614                    "$$exists": true
   615                  }
   616                }
   617              }
   618            }
   619          ]
   620        },
   621        {
   622          "client": "client1",
   623          "events": [
   624            {
   625              "commandStartedEvent": {
   626                "commandName": "ismaster",
   627                "command": {
   628                  "ismaster": 1
   629                }
   630              }
   631            },
   632            {
   633              "commandSucceededEvent": {
   634                "commandName": "ismaster",
   635                "reply": {
   636                  "ismaster": {
   637                    "$$exists": true
   638                  }
   639                }
   640              }
   641            },
   642            {
   643              "commandStartedEvent": {
   644                "commandName": "isMaster",
   645                "command": {
   646                  "isMaster": 1
   647                }
   648              }
   649            },
   650            {
   651              "commandSucceededEvent": {
   652                "commandName": "isMaster",
   653                "reply": {
   654                  "ismaster": {
   655                    "$$exists": true
   656                  }
   657                }
   658              }
   659            }
   660          ]
   661        },
   662        {
   663          "client": "client2",
   664          "events": [
   665            {
   666              "commandStartedEvent": {
   667                "commandName": "ismaster",
   668                "command": {
   669                  "ismaster": 1
   670                }
   671              }
   672            },
   673            {
   674              "commandSucceededEvent": {
   675                "commandName": "ismaster",
   676                "reply": {
   677                  "ismaster": {
   678                    "$$exists": true
   679                  }
   680                }
   681              }
   682            },
   683            {
   684              "commandStartedEvent": {
   685                "commandName": "isMaster",
   686                "command": {
   687                  "isMaster": 1
   688                }
   689              }
   690            },
   691            {
   692              "commandSucceededEvent": {
   693                "commandName": "isMaster",
   694                "reply": {
   695                  "ismaster": {
   696                    "$$exists": true
   697                  }
   698                }
   699              }
   700            }
   701          ]
   702        }
   703      ]
   704    }
   705  ]
   706}

View as plain text