mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-22 10:21:37 +00:00
Fix Fabric native mode
This commit is contained in:
@@ -53,9 +53,8 @@ export enum CosmosDbArtifactType {
|
|||||||
|
|
||||||
export interface FabricNativeDatabaseConnectionInfo {
|
export interface FabricNativeDatabaseConnectionInfo {
|
||||||
accessToken: string;
|
accessToken: string;
|
||||||
accountName: string;
|
|
||||||
databaseName: string;
|
databaseName: string;
|
||||||
connectionString: string;
|
accountEndpoint: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CosmosDBTokenResponse {
|
export interface CosmosDBTokenResponse {
|
||||||
|
|||||||
@@ -439,7 +439,7 @@ const createExplorerFabric = (params: {
|
|||||||
updateUserContext({
|
updateUserContext({
|
||||||
fabricContext: {
|
fabricContext: {
|
||||||
connectionId: params.connectionId,
|
connectionId: params.connectionId,
|
||||||
mirroredConnectionInfo: undefined,
|
mirroredConnectionInfo: undefined, // Set with resource token response
|
||||||
isReadOnly: params.isReadOnly,
|
isReadOnly: params.isReadOnly,
|
||||||
isVisible: params.isVisible,
|
isVisible: params.isVisible,
|
||||||
artifactType: params.artifactType,
|
artifactType: params.artifactType,
|
||||||
@@ -454,7 +454,7 @@ const createExplorerFabric = (params: {
|
|||||||
id: "",
|
id: "",
|
||||||
location: "",
|
location: "",
|
||||||
type: "",
|
type: "",
|
||||||
name: "Mounted",
|
name: "Mounted", // TODO: not used?
|
||||||
kind: AccountKind.Default,
|
kind: AccountKind.Default,
|
||||||
properties: {
|
properties: {
|
||||||
documentEndpoint: undefined,
|
documentEndpoint: undefined,
|
||||||
@@ -462,20 +462,21 @@ const createExplorerFabric = (params: {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
} else if (params.artifactType === CosmosDbArtifactType.NATIVE) {
|
} else if (params.artifactType === CosmosDbArtifactType.NATIVE) {
|
||||||
|
// Make it behave like Hosted/AAD/RBAC
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
databaseAccount: {
|
databaseAccount: {
|
||||||
id: "",
|
id: "",
|
||||||
location: "",
|
location: "",
|
||||||
type: "",
|
type: "",
|
||||||
name: params.nativeConnectionInfo.accountName,
|
name: "Native", // TODO: not used?
|
||||||
kind: AccountKind.Default,
|
kind: AccountKind.Default,
|
||||||
properties: {
|
properties: {
|
||||||
documentEndpoint: params.nativeConnectionInfo.connectionString, // TODO: verify that <artifactid>.sql.cosmos.fabric.microsoft.com is passed to the client as account endpoint
|
documentEndpoint: params.nativeConnectionInfo.accountEndpoint,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// For legacy reasons lots of code expects a connection string login to look and act like an encrypted token login
|
authType: AuthType.AAD,
|
||||||
authType: AuthType.EncryptedToken,
|
dataPlaneRbacEnabled: true,
|
||||||
accessToken: params.nativeConnectionInfo.accessToken,
|
aadToken: params.nativeConnectionInfo.accessToken,
|
||||||
masterKey: undefined,
|
masterKey: undefined,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user