mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-25 15:06:55 +00:00
Removes feature flag from passing masterKey to SDK (#843)
* Remove Feature flag from master key usage * Adds flag to fallback * format
This commit is contained in:
parent
5417e1e120
commit
69b8196cf0
@ -83,7 +83,7 @@ export function client(): Cosmos.CosmosClient {
|
|||||||
if (_client) return _client;
|
if (_client) return _client;
|
||||||
const options: Cosmos.CosmosClientOptions = {
|
const options: Cosmos.CosmosClientOptions = {
|
||||||
endpoint: endpoint() || "https://cosmos.azure.com", // CosmosClient gets upset if we pass a bad URL. This should never actually get called
|
endpoint: endpoint() || "https://cosmos.azure.com", // CosmosClient gets upset if we pass a bad URL. This should never actually get called
|
||||||
...(!userContext.features.enableAadDataPlane && { key: userContext.masterKey }),
|
key: userContext.masterKey,
|
||||||
tokenProvider,
|
tokenProvider,
|
||||||
connectionPolicy: {
|
connectionPolicy: {
|
||||||
enableEndpointDiscovery: false,
|
enableEndpointDiscovery: false,
|
||||||
|
@ -106,7 +106,11 @@ async function configureHostedWithAAD(config: AAD, explorerParams: ExplorerParam
|
|||||||
try {
|
try {
|
||||||
keys = await listKeys(subscriptionId, resourceGroup, account.name);
|
keys = await listKeys(subscriptionId, resourceGroup, account.name);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn(e);
|
if (userContext.features.enableAadDataPlane) {
|
||||||
|
console.warn(e);
|
||||||
|
} else {
|
||||||
|
throw new Error(`List keys failed: ${e.message}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
updateUserContext({
|
updateUserContext({
|
||||||
subscriptionId,
|
subscriptionId,
|
||||||
|
Loading…
Reference in New Issue
Block a user