Force Mongo and Proxy users to switch to Mongo and Cassandra Proxy (#1971)

* Force Mongo and Cassandra users to the new Proxies

* npm run format

---------

Co-authored-by: Asier Isayas <aisayas@microsoft.com>
This commit is contained in:
Asier Isayas
2024-09-18 13:49:09 -04:00
committed by GitHub
parent 78154bd976
commit 9f1cc4cd5c
4 changed files with 1 additions and 33 deletions

View File

@@ -724,15 +724,7 @@ export function useMongoProxyEndpoint(api: string): boolean {
MongoProxyEndpoints.Mooncake,
];
let canAccessMongoProxy: boolean = userContext.databaseAccount.properties.publicNetworkAccess === "Enabled";
if (
configContext.MONGO_PROXY_ENDPOINT !== MongoProxyEndpoints.Local &&
userContext.databaseAccount.properties.ipRules?.length > 0
) {
canAccessMongoProxy = canAccessMongoProxy && configContext.MONGO_PROXY_OUTBOUND_IPS_ALLOWLISTED;
}
return (
canAccessMongoProxy &&
configContext.NEW_MONGO_APIS?.includes(api) &&
activeMongoProxyEndpoints.includes(configContext.MONGO_PROXY_ENDPOINT)
);