Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-67431

Change command listDatabases to only list dbs of current tenant

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • Server Serverless 2022-10-03, Server Serverless 2022-10-17

      Today, the listDatabases command does not filter dbs with current tenant of the command request. In this ticket, we should change this so that we only list dbs of the current tenant, if one sent in the request. In order to do this, we'll want to filter out the list returned here to only include dbs who have a matching tenantId. Then, pass this filtered list to setReplyItems.

      We need to follow the same behavior for serializing the DatabaseNames as we are for NamespaceStrings, so we may want to create a similar serialize function for DatabaseName as we did for NamespaceString, and then use it to return the serialized database names correctly here instead of always calling db() as we are today.

      Then, let's add a test to the native_tenant_data_isolation_basic... tests to test that this works both when sending this command with $tenant, and when sending it with a security token.

            Assignee:
            adi.agrawal@mongodb.com Adi Agrawal
            Reporter:
            sophia.tan@mongodb.com Sophia Tan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: