Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emulator Settings Configurable #2053

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions configs/emulator.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"EmulatorMasterKey": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==",
"Account": {
"name": "",
"id": "",
"location": "",
"type": "",
"kind": "DocumentDB",
"properties": {
"documentEndpoint": "",
"tableEndpoint": "",
"gremlinEndpoint": "",
"cassandraEndpoint": "",
"capabilities": [
{
"name": "EnableNoSQLVectorSearch",
"description": "Enable Vector Search on NoSQL account"
}
]
}
}
}
4 changes: 0 additions & 4 deletions src/Common/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,6 @@ export enum PoolIdType {
QueryCopilot = "query-copilot",
}

export const EmulatorMasterKey =
//[SuppressMessage("Microsoft.Security", "CS002:SecretInNextLine", Justification="Well known public masterKey for emulator")]
"C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==";

export class Notebook {
public static readonly defaultBasePath = "./notebooks";
public static readonly heartbeatDelayMs = 60000;
Expand Down
3 changes: 2 additions & 1 deletion src/Common/CosmosClient.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as Cosmos from "@azure/cosmos";
import { getAuthorizationTokenUsingResourceTokens } from "Common/getAuthorizationTokenUsingResourceTokens";
import { AuthorizationToken } from "Contracts/FabricMessageTypes";
import { EmulatorMasterKey } from "Platform/Emulator/emulatorAccount";
import { checkDatabaseResourceTokensValidity } from "Platform/Fabric/FabricUtil";
import { LocalStorageUtility, StorageKey } from "Shared/StorageUtility";
import { useNewPortalBackendEndpoint } from "Utils/EndpointUtils";
Expand All @@ -11,7 +12,7 @@ import { Platform, configContext } from "../ConfigContext";
import { updateUserContext, userContext } from "../UserContext";
import { logConsoleError } from "../Utils/NotificationConsoleUtils";
import * as PriorityBasedExecutionUtils from "../Utils/PriorityBasedExecutionUtils";
import { EmulatorMasterKey, HttpHeaders } from "./Constants";
import { HttpHeaders } from "./Constants";
import { getErrorMessage } from "./ErrorHandlingUtils";

const _global = typeof self === "undefined" ? window : self;
Expand Down
23 changes: 3 additions & 20 deletions src/Platform/Emulator/emulatorAccount.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
import { AccountKind } from "../../Common/Constants";
import emulatorConfig from "../../../configs/emulator.json";

export const emulatorAccount = {
name: "",
id: "",
location: "",
type: "",
kind: AccountKind.DocumentDB,
properties: {
documentEndpoint: "",
tableEndpoint: "",
gremlinEndpoint: "",
cassandraEndpoint: "",
capabilities: [
{
name: "EnableNoSQLVectorSearch",
description: "Enable Vector Search on NoSQL account",
},
],
},
};
export const EmulatorMasterKey = emulatorConfig.EmulatorMasterKey || "";
export const emulatorAccount = emulatorConfig.Account || {};
Loading