Fix enable AAD dataplane feature flag behavior
This commit is contained in:
parent
fd3a83dcd8
commit
478467bda5
|
@ -19,10 +19,10 @@ const _global = typeof self === "undefined" ? window : self;
|
|||
export const tokenProvider = async (requestInfo: Cosmos.RequestInfo) => {
|
||||
const { verb, resourceId, resourceType, headers } = requestInfo;
|
||||
|
||||
if (
|
||||
(userContext.features.enableAadDataPlane && userContext.databaseAccount.properties.disableLocalAuth) ||
|
||||
(userContext.dataPlaneRbacEnabled && userContext.apiType === "SQL")
|
||||
) {
|
||||
const aadDataPlaneFeatureEnabled =
|
||||
userContext.features.enableAadDataPlane && userContext.databaseAccount.properties.disableLocalAuth;
|
||||
const dataPlaneRBACOptionEnabled = userContext.dataPlaneRbacEnabled && userContext.apiType === "SQL";
|
||||
if (aadDataPlaneFeatureEnabled || (!userContext.features.enableAadDataPlane && dataPlaneRBACOptionEnabled)) {
|
||||
if (!userContext.aadToken) {
|
||||
logConsoleError(
|
||||
`AAD token does not exist. Please use "Login for Entra ID" prior to performing Entra ID RBAC operations`,
|
||||
|
|
|
@ -276,6 +276,7 @@ async function configureHostedWithAAD(config: AAD): Promise<Explorer> {
|
|||
databaseAccount: config.databaseAccount,
|
||||
});
|
||||
|
||||
if (!userContext.features.enableAadDataPlane) {
|
||||
if (userContext.apiType === "SQL") {
|
||||
if (LocalStorageUtility.hasItem(StorageKey.DataPlaneRbacEnabled)) {
|
||||
const isDataPlaneRbacSetting = LocalStorageUtility.getEntryString(StorageKey.DataPlaneRbacEnabled);
|
||||
|
@ -295,6 +296,7 @@ async function configureHostedWithAAD(config: AAD): Promise<Explorer> {
|
|||
masterKey: keys.primaryMasterKey,
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
if (userContext.features.enableAadDataPlane) {
|
||||
console.warn(e);
|
||||
|
|
Loading…
Reference in New Issue