Support Sovereign/PPE endpoint zones for connection string login + E2E test for SQL account with public network access disabled (#2568)

* Support sovereign/PPE endpoint zones for connection string login

Move the hardcoded account endpoint suffixes out of Constants and into ConfigContext so connection string login works in sovereign clouds and PPE, and widen ConnectionStringParser to accept every configured zone.

Surface Portal Backend rejections in the hosted connect form: read the body off the Response that fetchEncryptedToken throws, and offer a firewall help link on a 403.

Add an E2E test covering SQL connection string login against an account with public network access disabled.

* Harden connection string DNS zone matching

Detect PPE accounts from Mongo and Cassandra connection strings, build their document endpoint from the matched zone, match the PPE suffix on a label boundary, and escape every regex metacharacter in config-supplied zones. Drop the sqlx.cosmosdb.azure.com zone, which is not a real SQL zone.

* Mock web-vitals globally in test setup

ScenarioMonitor subscribes to web-vitals when it is imported, so the onTTFB timer can throw during any suite that outlives it. Mocking it in setupTests.ts keeps that out of individual test files.

* Improve connection string login feedback

* Preserve connection restriction check order

* Flatten connection login error handling

---------

Co-authored-by: Asier Isayas <aisayas@microsoft.com>
This commit is contained in:
asier-isayas
2026-08-31 10:35:54 -04:00
committed by GitHub
parent 49a2ad491a
commit a825a7ddc5
11 changed files with 671 additions and 143 deletions
+33
View File
@@ -30,6 +30,13 @@ export interface ConfigContext {
allowedCassandraProxyEndpoints: ReadonlyArray<string>;
allowedMongoProxyEndpoints: ReadonlyArray<string>;
allowedParentFrameOrigins: ReadonlyArray<string>;
SQL_DNS_ZONES: ReadonlyArray<string>;
MONGO_DNS_ZONES: ReadonlyArray<string>;
MONGO_COMPUTE_DNS_ZONES: ReadonlyArray<string>;
CASSANDRA_DNS_ZONES: ReadonlyArray<string>;
TABLE_DNS_ZONES: ReadonlyArray<string>;
DOCUMENT_ENDPOINT_ZONES: ReadonlyArray<string>;
GREMLIN_ENDPOINT_ZONES: ReadonlyArray<string>;
gitSha?: string;
proxyPath?: string;
AAD_ENDPOINT: string;
@@ -81,6 +88,32 @@ let configContext: Readonly<ConfigContext> = {
`^https:\\/\\/explorer\\.cosmos\\.sovcloud-api\\.sg$`,
`^https:\\/\\/portal\\.sovcloud-azure\\.sg$`,
], // Webpack injects this at build time
SQL_DNS_ZONES: [
"documents.azure.com",
"sql.cosmosdb.azure.com",
"sql.cosmos.azure.com",
"sqlx.cosmos.azure.com",
"documents-staging.windows-ppe.net",
"sql.cosmosdb.windows-ppe.net",
"sql.cosmos.windows-ppe.net",
"sqlx.cosmos.windows-ppe.net",
],
MONGO_DNS_ZONES: ["documents.azure.com", "documents-staging.windows-ppe.net"],
MONGO_COMPUTE_DNS_ZONES: ["mongo.cosmos.azure.com", "mongo.cosmos.windows-ppe.net"],
CASSANDRA_DNS_ZONES: [
"cassandra.cosmosdb.azure.com",
"cassandra.cosmos.azure.com",
"cassandra.cosmosdb.windows-ppe.net",
"cassandra.cosmos.windows-ppe.net",
],
TABLE_DNS_ZONES: [
"table.cosmosdb.azure.com",
"table.cosmos.azure.com",
"table.cosmosdb.windows-ppe.net",
"table.cosmos.windows-ppe.net",
],
DOCUMENT_ENDPOINT_ZONES: ["documents.azure.com", "documents-staging.windows-ppe.net"],
GREMLIN_ENDPOINT_ZONES: ["gremlin.cosmos.azure.com", "gremlin.cosmos.windows-ppe.net"],
gitSha: process.env.GIT_SHA,
hostedExplorerURL: "https://cosmos.azure.com/",
AAD_ENDPOINT: "https://login.microsoftonline.com/",