From 375bb5f5676692b44a00082fb467762346af0fbb Mon Sep 17 00:00:00 2001 From: Asier Isayas Date: Mon, 8 Jul 2024 17:27:34 -0400 Subject: [PATCH 1/3] Adding CRI fixes to pre RBAC commit (#1902) Co-authored-by: Asier Isayas From 49c3d0f0cb5da58357a4eba7c1f5628700a9ed74 Mon Sep 17 00:00:00 2001 From: vchske Date: Tue, 9 Jul 2024 09:27:57 -0700 Subject: [PATCH 2/3] Reorder Asier's commits in order to deploy CRI fixes (#1905) * Set AllowPartialScopes flag to true (#1900) * add partial scopes flag * add partial scopes flag * add partial scopes flag --------- Co-authored-by: Asier Isayas * Adding CRI fixes to pre RBAC commit (#1902) Co-authored-by: Asier Isayas * Add Data Plane RBAC functionality (#1878) * Fix API endpoint for CassandraProxy query API * activate Mongo Proxy and Cassandra Proxy in Prod * Add CP Prod endpoint * Run npm format and tests * Revert code * fix bug that blocked local mongo proxy and cassandra proxy development * Add prod endpoint * fix pr check tests * Remove prod * Remove prod endpoint * Remove dev endpoint * Support data plane RBAC * Support data plane RBAC * Add additional changes for Portal RBAC functionality * Address errors and checks * Cleanup DP RBAC code * Run format * Fix unit tests * Remove unnecessary code * Run npm format * Fix enableAadDataPlane feature flag behavior * Fix enable AAD dataplane feature flag behavior * Address feedback comments * Minor fix * Add new fixes * Fix Tables test * Run npm format --------- Co-authored-by: Asier Isayas * Fix LMS regression when using old backend (#1890) Co-authored-by: Asier Isayas * Address RBAC local storage default setting issue (#1892) * Fix API endpoint for CassandraProxy query API * activate Mongo Proxy and Cassandra Proxy in Prod * Add CP Prod endpoint * Run npm format and tests * Revert code * fix bug that blocked local mongo proxy and cassandra proxy development * Add prod endpoint * fix pr check tests * Remove prod * Remove prod endpoint * Remove dev endpoint * Support data plane RBAC * Support data plane RBAC * Add additional changes for Portal RBAC functionality * Address errors and checks * Cleanup DP RBAC code * Run format * Fix unit tests * Remove unnecessary code * Run npm format * Fix enableAadDataPlane feature flag behavior * Fix enable AAD dataplane feature flag behavior * Address feedback comments * Minor fix * Add new fixes * Fix Tables test * Run npm format * Address Local storage default setting issue * Run npm format * Address lint error * Run format --------- Co-authored-by: Asier Isayas * Fix bug in viewing tables account databases (#1899) * Fix API endpoint for CassandraProxy query API * activate Mongo Proxy and Cassandra Proxy in Prod * Add CP Prod endpoint * Run npm format and tests * Revert code * fix bug that blocked local mongo proxy and cassandra proxy development * Add prod endpoint * fix pr check tests * Remove prod * Remove prod endpoint * Remove dev endpoint * Support data plane RBAC * Support data plane RBAC * Add additional changes for Portal RBAC functionality * Address errors and checks * Cleanup DP RBAC code * Run format * Fix unit tests * Remove unnecessary code * Run npm format * Fix enableAadDataPlane feature flag behavior * Fix enable AAD dataplane feature flag behavior * Address feedback comments * Minor fix * Add new fixes * Fix Tables test * Run npm format * Address Local storage default setting issue * Run npm format * Address lint error * Run format * Address bug in fetching data for Tables Account * Add fetchAndUpdate Keys * Add fix for MPAC Tables account issue * Fix issue with Cosmos Client * Run np format * Address bugs * Remove unused import --------- Co-authored-by: Asier Isayas --------- Co-authored-by: Asier Isayas Co-authored-by: Asier Isayas Co-authored-by: sindhuba <122321535+sindhuba@users.noreply.github.com> From 81dccbe5be0e2aa6b1ffcd638511a8a1ec876a35 Mon Sep 17 00:00:00 2001 From: sindhuba <122321535+sindhuba@users.noreply.github.com> Date: Tue, 9 Jul 2024 10:58:13 -0700 Subject: [PATCH 3/3] Fix vCoreMongo/PostGres quickstart bug (#1903) * Fix API endpoint for CassandraProxy query API * activate Mongo Proxy and Cassandra Proxy in Prod * Add CP Prod endpoint * Run npm format and tests * Revert code * fix bug that blocked local mongo proxy and cassandra proxy development * Add prod endpoint * fix pr check tests * Remove prod * Remove prod endpoint * Remove dev endpoint * Support data plane RBAC * Support data plane RBAC * Add additional changes for Portal RBAC functionality * Remove unnecessary code * Remove unnecessary code * Add code to fix VCoreMongo/PG bug * Address feedback --------- Co-authored-by: Asier Isayas --- src/hooks/useKnockoutExplorer.ts | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/hooks/useKnockoutExplorer.ts b/src/hooks/useKnockoutExplorer.ts index 92559dc0b..38fb612c4 100644 --- a/src/hooks/useKnockoutExplorer.ts +++ b/src/hooks/useKnockoutExplorer.ts @@ -440,6 +440,7 @@ async function configurePortal(): Promise { updateUserContext({ authType: AuthType.AAD, }); + let explorer: Explorer; return new Promise((resolve) => { // In development mode, try to load the iframe message from session storage. @@ -454,6 +455,7 @@ async function configurePortal(): Promise { console.dir(message); updateContextsFromPortalMessage(message); explorer = new Explorer(); + // In development mode, save the iframe message from the portal in session storage. // This allows webpack hot reload to funciton properly if (process.env.NODE_ENV === "development") { @@ -492,33 +494,27 @@ async function configurePortal(): Promise { const { databaseAccount: account, subscriptionId, resourceGroup } = userContext; + let dataPlaneRbacEnabled; if (userContext.apiType === "SQL") { if (LocalStorageUtility.hasItem(StorageKey.DataPlaneRbacEnabled)) { const isDataPlaneRbacSetting = LocalStorageUtility.getEntryString(StorageKey.DataPlaneRbacEnabled); - let dataPlaneRbacEnabled; if (isDataPlaneRbacSetting === Constants.RBACOptions.setAutomaticRBACOption) { dataPlaneRbacEnabled = account.properties.disableLocalAuth; } else { dataPlaneRbacEnabled = isDataPlaneRbacSetting === Constants.RBACOptions.setTrueRBACOption; } - if (!dataPlaneRbacEnabled) { - await fetchAndUpdateKeys(subscriptionId, resourceGroup, account.name); - } - - updateUserContext({ dataPlaneRbacEnabled }); - useDataPlaneRbac.setState({ dataPlaneRbacEnabled: dataPlaneRbacEnabled }); } else { - const dataPlaneRbacEnabled = account.properties.disableLocalAuth; - - if (!dataPlaneRbacEnabled) { - await fetchAndUpdateKeys(subscriptionId, resourceGroup, account.name); - } - - updateUserContext({ dataPlaneRbacEnabled }); - useDataPlaneRbac.setState({ dataPlaneRbacEnabled: dataPlaneRbacEnabled }); + dataPlaneRbacEnabled = account.properties.disableLocalAuth; } - } else { + + if (!dataPlaneRbacEnabled) { + await fetchAndUpdateKeys(subscriptionId, resourceGroup, account.name); + } + + updateUserContext({ dataPlaneRbacEnabled }); + useDataPlaneRbac.setState({ dataPlaneRbacEnabled: dataPlaneRbacEnabled }); + } else if (userContext.apiType !== "Postgres" && userContext.apiType !== "VCoreMongo") { await fetchAndUpdateKeys(subscriptionId, resourceGroup, account.name); }