Skip to content

Add unit tests and documentation for DDM connection string authentication fix#2354

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/sub-pr-2353
Draft

Add unit tests and documentation for DDM connection string authentication fix#2354
Copilot wants to merge 2 commits intomasterfrom
copilot/sub-pr-2353

Conversation

Copy link
Contributor

Copilot AI commented Jan 27, 2026

The existing fix for DDM tab visibility during connection string authentication lacks test coverage and inline documentation explaining the authentication scenario.

Changes

  • Add unit tests for isDataMaskingEnabled() covering:

    • Capability-based access (AAD authentication)
    • Policy-based access (connection string authentication)
    • Edge cases (null/undefined policies, empty arrays)
  • Add inline documentation explaining why policy existence check supports connection string authentication where databaseAccount capabilities are unavailable

Context

When users authenticate via connection string, isCapabilityEnabled() returns false because databaseAccount is unavailable. The function correctly falls back to checking hasDataMaskingPolicyFromCollection, allowing the DDM tab to appear if a policy exists:

export const isDataMaskingEnabled = (dataMaskingPolicy?: DataModels.DataMaskingPolicy): boolean => {
  const hasDataMaskingCapability = isCapabilityEnabled(Constants.CapabilityNames.EnableDynamicDataMasking);
  const hasDataMaskingPolicyFromCollection =
    dataMaskingPolicy?.includedPaths?.length > 0 || dataMaskingPolicy?.excludedPaths?.length > 0;

  return hasDataMaskingCapability || hasDataMaskingPolicyFromCollection;
};

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix DDM login issue when logging in via connection string Add unit tests and documentation for DDM connection string authentication fix Jan 27, 2026
Base automatically changed from users/sakshig/ddmChanges to master February 2, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants