Address connection string login review feedback

Clarify Mongo and Cassandra E2E test comments and retain formatting in the resolved connection flow.
This commit is contained in:
Asier Isayas
2026-09-09 07:22:16 -07:00
parent a2f6fbf2f5
commit 503fec0010
3 changed files with 8 additions and 13 deletions
+3 -6
View File
@@ -25,9 +25,7 @@ async function loginWithConnectionString(page: Page, connectionString: string):
await page.getByRole("button", { name: "Connect" }).click();
}
// Builds a Cassandra connection string for an account that the caller controls the name and key of, so
// the tests can point at a wrong key or an account that was never provisioned. The key is embedded raw,
// the way Azure hands it out; URL encoding it would turn the base64 padding into %3D and fail to decode.
// Builds a Cassandra connection string for an account
function buildCassandraConnectionString(accountName: string, accountKey: string): string {
return `HostName=${accountName}.cassandra.cosmos.azure.com;Username=${accountName};Password=${accountKey};Port=10350`;
}
@@ -155,9 +153,8 @@ test.describe("Cassandra account using connection string login", () => {
});
test("opens Data Explorer when the account does not exist", async ({ page }) => {
// The UTC timestamp keeps the account name unique to this run, so it cannot collide with a real
// account that someone provisioned in the meantime. The token is issued without checking that the
// account exists, so login succeeds and only the requests made from inside the explorer fail.
// The token is issued without checking that the account exists, so login succeeds
// and only the requests made from inside the explorer fail.
const missingAccountName = `de-test-missing-${new Date().toISOString().replace(/[^0-9]/g, "")}`;
await loginWithConnectionString(page, buildCassandraConnectionString(missingAccountName, wrongAccountKey));
+4 -7
View File
@@ -25,9 +25,7 @@ async function loginWithConnectionString(page: Page, connectionString: string):
await page.getByRole("button", { name: "Connect" }).click();
}
// Builds a Mongo connection string for an account that the caller controls the name and key of, so the
// tests can point at a wrong key or an account that was never provisioned. The key is embedded raw, the
// way Azure hands it out; URL encoding it would turn the base64 padding into %3D and fail to decode.
// Builds a Mongo connection string for an account
function buildMongoConnectionString(accountName: string, accountKey: string): string {
return `mongodb://${accountName}:${accountKey}@${accountName}.mongo.cosmos.azure.com:10255/?ssl=true&replicaSet=globaldb&retrywrites=false&appName=@${accountName}@`;
}
@@ -89,7 +87,7 @@ test.describe("Mongo account using connection string login", () => {
await collectionNode.expand();
// Open the Documents node to load the tab and exercise the data plane, which for Mongo runs through
// the Portal Backend proxy using the encrypted token issued at login.
// the Portal Backend using the encrypted token issued at login.
const documentsNode = await explorer.waitForContainerDocumentsNode(databaseId, collectionId);
await documentsNode.element.click();
@@ -177,9 +175,8 @@ test.describe("Mongo account using connection string login", () => {
});
test("opens Data Explorer when the account does not exist", async ({ page }) => {
// The UTC timestamp keeps the account name unique to this run, so it cannot collide with a real
// account that someone provisioned in the meantime. The token is issued without checking that the
// account exists, so login succeeds and only the requests made from inside Data Explorer fail.
// The token is issued without checking that the account exists, so login succeeds and
// only the requests made from inside Data Explorer fail.
const missingAccountName = `de-test-missing-${new Date().toISOString().replace(/[^0-9]/g, "")}`;
await loginWithConnectionString(page, buildMongoConnectionString(missingAccountName, wrongAccountKey));