Add more logs for RBAC features

This commit is contained in:
Senthamil Sindhu 2024-07-10 07:38:37 -07:00
parent 2b11e0e52b
commit 5a16eec29d
2 changed files with 5 additions and 17 deletions

View File

@ -11,7 +11,7 @@ import { logConsoleError } from "../Utils/NotificationConsoleUtils";
import * as PriorityBasedExecutionUtils from "../Utils/PriorityBasedExecutionUtils";
import { EmulatorMasterKey, HttpHeaders } from "./Constants";
import { getErrorMessage } from "./ErrorHandlingUtils";
import * as Logger from "../Common/Logger"
import * as Logger from "../Common/Logger";
const _global = typeof self === "undefined" ? window : self;
@ -85,9 +85,7 @@ export const tokenProvider = async (requestInfo: Cosmos.RequestInfo) => {
}
if (userContext.masterKey) {
Logger.logInfo(
`Master Key exists`, "Explorer/tokenProvider",
);
Logger.logInfo(`Master Key exists`, "Explorer/tokenProvider");
// TODO This SDK method mutates the headers object. Find a better one or fix the SDK.
await Cosmos.setAuthorizationTokenHeaderUsingMasterKey(
verb,

View File

@ -281,13 +281,9 @@ async function configureHostedWithAAD(config: AAD): Promise<Explorer> {
"Explorer/configureHostedWithAAD",
);
if (!userContext.features.enableAadDataPlane) {
Logger.logInfo(
`AAD Feature flag is not enabled for account ${account.name}`,
"Explorer/configureHostedWithAAD",
);
Logger.logInfo(`AAD Feature flag is not enabled for account ${account.name}`, "Explorer/configureHostedWithAAD");
if (userContext.apiType === "SQL") {
if (LocalStorageUtility.hasItem(StorageKey.DataPlaneRbacEnabled)) {
const isDataPlaneRbacSetting = LocalStorageUtility.getEntryString(StorageKey.DataPlaneRbacEnabled);
Logger.logInfo(
`Local storage RBAC setting for ${userContext.apiType} account ${account.name} is ${isDataPlaneRbacSetting}`,
@ -471,15 +467,9 @@ function configureEmulator(): Explorer {
async function fetchAndUpdateKeys(subscriptionId: string, resourceGroup: string, account: string) {
try {
Logger.logInfo(
`Fetching keys for ${userContext.apiType} account ${account}`,
"Explorer/fetchAndUpdateKeys",
);
Logger.logInfo(`Fetching keys for ${userContext.apiType} account ${account}`, "Explorer/fetchAndUpdateKeys");
const keys = await listKeys(subscriptionId, resourceGroup, account);
Logger.logInfo(
`Keys fetched for ${userContext.apiType} account ${account}`,
"Explorer/fetchAndUpdateKeys",
);
Logger.logInfo(`Keys fetched for ${userContext.apiType} account ${account}`, "Explorer/fetchAndUpdateKeys");
updateUserContext({
masterKey: keys.primaryMasterKey,