mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-09-20 01:22:47 +01:00
6a524be12f4df7d6ac454bdc64b781b662a6ec11
4 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
43fe8a002b |
feat: Add Cosmos DB Shell (NoSQL) support to Cloud Shell (#2549)
* Add Cosmos DB Shell (NoSQL) support to Cloud Shell Adds Cosmos DB (NoSQL) support to the Cloud Shell experience and wires up authentication for RBAC / local-auth-disabled accounts: - Enable the Open Cosmos DB Shell button behind the enableCloudShell feature flag. - Bootstrap .NET SDK 10 in Cloud Shell before installing the CosmosDBShell tool. - Force gateway connection mode and add --verbose to surface connection errors. - Select Entra ID vs account-key auth via isCloudShellEntraAuthEnabled (covers dataplane RBAC and disableLocalAuth accounts). - Acquire a data-plane-scoped Entra token on demand when no cached aadToken exists, and omit --connect-tenant so a missing token falls through to DefaultAzureCredential (Cloud Shell az session) instead of interactive/device-code auth. * Fix popup_window_error in CosmosDB Cloud Shell Entra auth Acquiring an Entra token on demand via acquireMsalTokenForAccount triggered a browser loginPopup (even in silent mode when no MSAL account was cached), which fails with popup_window_error inside the hosted Cloud Shell context. getKey now returns the cached userContext.aadToken when present, or an empty string otherwise. With no token exported, the CosmosDBShell tool falls through to DefaultAzureCredential, which uses the Cloud Shell's signed-in az session. * Force --connect-azure-cli whenever no credential env var is exported In Azure Cloud Shell, DefaultAzureCredential tries ManagedIdentityCredential first, which cannot mint a token for the *.documents.azure.com audience (AudienceNotSupported). Force AzureCliCredential via --connect-azure-cli whenever no key/token env var is exported, covering both the Entra-no-token and key-auth-empty-key cases. Also auto-update the CosmosDBShell tool so cached installs pick up the new flag. * Silently mint a Cosmos data-plane token for the Cloud Shell Entra path A disableLocalAuth Cosmos account whose Data Explorer session is still in key mode has no cached userContext.aadToken, and the ephemeral Cloud Shell can obtain a Cosmos token from neither its managed identity (AudienceNotSupported for *.documents.azure.com) nor its az session (not logged in). Mint a Cosmos-scoped token in the browser and export it via COSMOSDB_SHELL_TOKEN. The acquisition is guarded on an existing cached MSAL account so it can never trigger an interactive popup, and any failure returns an empty string so the tool falls back to --connect-azure-cli. * Only accept Y/N at the Cloud Shell consent prompt askConfirmation now ignores any key that is not Y or N instead of treating every non-Y key as a decline, so an accidental keypress no longer aborts the Cloud Shell consent flow. Also add diagnostic warnings on the Cloud Shell token path so the browser console reveals whether the silent Cosmos token mint was skipped (no cached MSAL account) or returned empty. * Use device-code auth when Cloud Shell has no token * Pass the Data Explorer credential to the Cosmos DB shell instead of signing in interactively Azure Cloud Shell cannot authenticate to Cosmos DB on its own: its managed identity is rejected with AudienceNotSupported for the *.documents.azure.com audience, its az session is not signed in, and neither the interactive browser nor the device-code flow is usable from the embedded terminal. Resolve the credential in Data Explorer and hand it to the shell out-of-band: - getCosmosDBShellCredential() returns an Entra ID data-plane token (cached aadToken, or one minted silently only when an MSAL account already exists so it can never trigger a popup), falling back to the account master key unless local auth is disabled. It reports which kind it resolved so the correct env var is exported. - CosmosDBShellHandler exports COSMOSDB_SHELL_TOKEN or COSMOSDB_SHELL_ACCOUNT_KEY and drops every credential flag, so the tool always lands on a terminal, non-interactive step of its credential chain. - When nothing can be resolved, print actionable guidance instead of launching the tool with no credential. * Fix TS7011 in ShellTypeFactory tests by typing the mocked getAllAccounts The empty array literal in the getMsalInstance mock had no contextual type, so tsc inferred an implicit any[] return under noImplicitAny. Route every mock through a typed mockMsalAccounts helper. * Reuse DE's cached credential for Cosmos DB Shell; add read-only key fallback * Deliver Cosmos DB Shell key as a full connection string; harden key resolution * Surface the specific reason a Cosmos DB Shell credential could not be resolved * Deliver Cosmos DB Shell credential inline (export+connect on one line), mirroring Mongo handler * Log which Cosmos DB Shell credential kind was resolved for debugging * Increase ARM timeout for Cloud Shell provisioning calls to avoid spurious abort errors * Gate Cosmos DB Shell button behind enableCosmosDBShell feature flag * Fix TS2741: add missing enableCosmosDBShell to Features test fixture |
||
|
|
2c31ec2a8d |
Dark theme for Explorer (#2185)
* First dark theme commits for command bar * Updated theme on sidebar * Updated tabs, sidebar, splash screen * settings theme changes * Dark theme applied to Monaco editor * Dark theme to stored procedures * Fixed sidebar scroll * Updated scroll issue in sidebar * Command bar items fixed * Fixed lint errors * fixed lint errors * settings side panel fixed * Second last iteration for css * Fixed all the issues of css * Updated the theme icon for now on DE to change the theme from portal/DE itself * Formatting issue resolved * Remove CloudShellTerminalComponent changes - revert to master version * Fixed test issue * Fixed formatting issue * Fix tests: update snapshots and revert xterm imports for compatibility * Fix xterm imports in CloudShellTerminalComponent to use @xterm packages * Fix Cloud Shell component imports for compatibility * Update test snapshots * Fix xterm package consistency across all CloudShell components * Fix TypeScript compilation errors in CloudShell components and query Documents - Standardized xterm package imports across CloudShell components to use legacy 'xterm' package - Fixed Terminal type compatibility issues in CommonUtils.tsx - Added type casting for enableQueryControl property in queryDocuments.ts to handle Azure Cosmos SDK interface limitations - Applied code formatting to ensure consistency * Update failing snapshot tests - Updated TreeNodeComponent snapshot tests for loading states - Updated ThroughputInputAutoPilotV3Component snapshots for number formatting changes (10,00,000 -> 1,000,000) - All snapshot tests now pass * Fixed test issue * Fixed test issue * Updated the buttons for theme * Updated the Theme changes based on portal theme changes * Updated review comments * Updated the duplicate code and fixed the fabric react error * Few places styling added and resolving few comments * Fixed errors * Fixed comments * Fixed comments * Fixed comments * Fixed full text policy issue for mongoru accounts * Resolved comments for class Name and few others * Added css for homepage in ru accounts * Final commit with all the feedback issues resolved * Lint error resolved * Updated the review comments and few Ui issues * Resolved review comments and changed header bg and active state color * Moved svg code to different file and imported * css fixed for the hpome page boxed for ru account * Lint errors * Fixed boxes issue in ru accounts * Handled the initial theme from the portal * Updated snap * Update snapshots for TreeNodeComponent and CreateCopyJobScreensProvider tests * Fix duplicate DataExplorerRoot test id causing Playwright strict mode violation * Fix locale-dependent number formatting in ThroughputInputAutoPilotV3Component --------- Co-authored-by: Sakshi Gupta <sakshig+microsoft@microsoft.com> Co-authored-by: Sakshi Gupta <sakshig@microsoft.com> |
||
|
|
012d043c78 | Fix CloudShell terminal hanging for Mongo and Cassandra shells due to missing updateTerminalData method (#2199) | ||
|
|
205355bf55 |
Shell: Integrate Cloudshell to existing shells (#2098)
* first draft * refactored code * ux fix * add custom header support and fix ui * minor changes * hide last command also * remove logger * bug fixes * updated loick file * fix tests * moved files * update readme * documentation update * fix compilationerror * undefined check handle * format fix * format fix * fix lints * format fix * fix unrelatred test * code refator * fix format * ut fix * cgmanifest * Revert "cgmanifest" This reverts commit 2e76a6926ee0d3d4e0510f2e04e03446c2ca8c47. * fix snap * test fix * formatting code * updated xterm * include username in command * cloudshell add exit * fix test * format fix * tets fix * fix multiple open cloudshell calls * socket time out after 20 min * remove unused code * 120 min * Addressed comments |