[Cosmos] Disable key authentication in AAD live-test lanes

未关闭
#49,020 0 条评论 1 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@simorenoh 已经在做这个了。

开始于 2026年9月15日。

评估

这个 Issue 还没有评估数据。

描述

Cosmos

Is your feature request related to a problem? Please describe.

The Cosmos AAD live-test lanes set COSMOS_TEST_DATA_AUTH_MODE=aad, but their provisioned accounts still allow local/key authentication. This means accidental key-authenticated data-plane usage can succeed instead of exposing gaps in AAD coverage.

Simply setting disableLocalAuth today would break the test harness. Shared session setup in tests/conftest.py creates databases and containers with ACCOUNT_KEY, and TestConfig.create_test_clients() plus its async counterpart deliberately create key-authenticated setup clients. The custom AAD role in sdk/cosmos/test-resources.bicep also needs to be reviewed for the database lifecycle operations currently performed through those key clients.

This follow-up was identified while reviewing PR #48459.

Describe the solution you'd like

Make the seven AAD live-test lanes run against provisioned Cosmos accounts with local/key authentication disabled.

  • Audit every test selected by the AAD markers for direct or helper-mediated key authentication.
  • Convert shared database/container setup and cleanup to use AAD or an appropriate ARM control-plane path.
  • Update the custom AAD role with only the additional data actions required for test-owned database lifecycle operations.
  • Add a Bicep parameter for disableLocalAuth and enable it only for AAD matrix configurations, leaving key-auth lanes unchanged.
  • Ensure AAD lanes do not depend on ACCOUNT_KEY after deployment.
  • Add a targeted assertion that key authentication is rejected on the AAD account so regressions are visible.
  • Validate all seven AAD lanes, including long, query, split, multi-region, circuit-breaker, and per-partition automatic-failover coverage.

Describe alternatives you've considered

Leaving local authentication enabled preserves the current harness but cannot detect accidental key usage. Enabling disableLocalAuth immediately without migrating setup would fail during session initialization rather than provide meaningful AAD coverage.

Additional context

PR #48459 intentionally keeps AAD lanes on per-run provisioned accounts because their role assignments target the current test tenant's principal. This issue is separate from moving key-auth lanes to fixed rotation-friendly accounts and should be completed before considering the AAD lanes fully key-independent.

主要语言
Python
星标
5.6k
派生
3.4k
平均合并
1 天 22 小时
30 天内合并 PR
189

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Azure/azure-sdk-for-python 的其他 Issue

查看 Azure/azure-sdk-for-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。