[azure-mgmt-apimanagement] Backend TLS defaults: omitted tls and default TLS object produce different Portal checkbox states
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- azure, python
- Lĩnh vực
- backend-api-design, cloud
Hướng nghiên cứu
Start with the BackendTlsProperties model in the tagged 4.0.0 source at sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py, then compare its defaults and serialization with the 5.0.0 model and the REST contract. Reproduce omitted tls and default-object requests, checking the emitted PUT body and persisted GET representation. Done means determining whether the discrepancy belongs to SDK serialization, service defaults, or Portal display and identifying the responsible behavior.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- Package Name: azure-mgmt-apimanagement
- Package Version tested: 4.0.0
- Operating System: Windows 11
- Python Version: 3.12.13
- Environment: Azure China, API Management managed gateway
- REST API version used for PUT and independent GET: 2024-05-01
Summary / ownership clarification
Backend TLS configuration produces different persisted representations depending on whether the caller omits tls or passes BackendTlsProperties(). In Azure Portal, an omitted TLS configuration is displayed with both certificate-validation checkboxes unchecked, just like explicit false values, although the REST documentation lists both validation properties as defaulting to true.
I am reporting the observed default-value/display discrepancy and asking for SDK/service/Portal ownership clarification. I have NOT established that omitting None is a serializer bug, or that the gateway disables validation when tls is omitted.
Minimal SDK reproduction
from azure.mgmt.apimanagement.models import BackendContract, BackendTlsProperties
base = {"url": "https://example.com", "protocol": "http"}
cases = {
"omit-tls": BackendContract(**base),
"tls-none": BackendContract(**base, tls=None),
"sdk-default": BackendContract(**base, tls=BackendTlsProperties()),
"explicit-on": BackendContract(
**base,
tls=BackendTlsProperties(
validate_certificate_chain=True,
validate_certificate_name=True,
),
),
"explicit-off": BackendContract(
**base,
tls=BackendTlsProperties(
validate_certificate_chain=False,
validate_certificate_name=False,
),
),
}
for name, backend in cases.items():
print(name, backend.serialize())
The example URL is a placeholder; no customer endpoint or resource identifier is included.
For the live reproduction, all cases were created as separate Backend entities pointing to the same controlled HTTPS Web App, using:
apim_client.backend.create_or_update(
RESOURCE_GROUP, APIM_SERVICE_NAME, backend_id, backend_contract
)
The client used the Azure China ARM endpoint https://management.chinacloudapi.cn, credential scope https://management.core.chinacloudapi.cn/.default, and api_version="2024-05-01". The Azure CLI credential was authenticated to AzureChinaCloud.
I inspected the actual SDK PUT body with raw_request_hook, and independently checked persisted configuration with raw ARM GET, rather than relying solely on model serialization or deserialization.
Actual results
| Constructor | Actual SDK PUT properties.tls |
Independent ARM GET properties.tls |
Portal Advanced certificate-validation checkboxes |
|---|---|---|---|
No tls keyword at all |
Key absent | Key absent | Not independently observed for this additional Backend |
tls=None |
Key absent | Key absent | Both unchecked |
tls=BackendTlsProperties() |
Both properties true |
Both properties true |
Both checked |
Explicit True / True |
Both properties true |
Both properties true |
Both checked |
Explicit False / False |
Both properties false |
Both properties false |
Both unchecked |
The Portal observations above come from screenshots supplied by the operator of the test environment. The new Backend with the tls keyword completely omitted has been created and independently read back; its request and persisted TLS representation match the tls=None case, but I have not independently observed its Portal UI.
Separately, an offline serialization test with both inner parameters explicitly set to None emits "tls": {} in 4.0.0. This is distinct from tls=None; the empty-object variant was NOT created in the live environment.
Expected behavior / questions
- Is omission of the entire
tlsobject intentional SDK behavior? Should the service apply certificate-chain and certificate-name validation by default when the whole object is absent, as opposed to when individual properties are absent? - If the effective defaults are
true, Portal should represent those defaults accurately, or distinguish "not explicitly configured / use service default" from explicitfalse. Currently, the unchecked state makes these configurations appear equivalent. - If the SDK is behaving correctly and this belongs to the APIM service or Portal, could you help route the report to the responsible team or identify the supported bug-reporting channel?
I am not requesting that the serializer blindly turn every omitted optional object into explicit values; the correct fix depends on the intended contract.
Scope / limitations
- The live SDK/request/ARM reproduction was performed with 4.0.0.
- PyPI currently lists 5.0.0 as the stable release. I inspected the 5.0.0 tagged source:
BackendTlsProperties.__init__still defaults both booleans toTrue. I have NOT run the live reproduction with 5.0.0. - Requests using a trusted HTTPS certificate succeeded for the original four cases. This does NOT establish effective validation behavior for an invalid certificate.
- An invalid/self-signed server-certificate runtime comparison remains unverified in this managed-gateway reproduction.
- No self-hosted gateway conclusion is being claimed.
- No subscription IDs, resource names, private domains, credentials, or original screenshots are included.
References
- REST BackendTlsProperties documentation, including both default values:
https://learn.microsoft.com/en-us/rest/api/apimanagement/backend/create-or-update?view=rest-apimanagement-2024-05-01#backendtlsproperties - Python SDK model documentation:
https://learn.microsoft.com/en-us/python/api/azure-mgmt-apimanagement/azure.mgmt.apimanagement.models.backendtlsproperties?view=azure-python - Tested 4.0.0 tagged model source:
https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-apimanagement_4.0.0/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py - 5.0.0 tagged model source inspected, not live-tested:
https://github.com/Azure/azure-sdk-for-python/blob/azure-mgmt-apimanagement_5.0.0/sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/models/_models_py3.py
- Ngôn ngữ chính
- Python
- Star
- 5.6k
- Fork
- 3.4k
- Merge trung bình
- 1 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 189
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Azure/azure-sdk-for-python
-
needs-triage
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
Azure/azure-sdk-for-python#50155 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Teams Chatbot]: next-mypy install 404s should point to CFS auth or --pypi workaroundCó thể đã có người làm @jianingwang123 đã nhận 17 ngày trước. Đang mởneeds-triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 72/100
Azure/azure-sdk-for-python#49886 · 1 bình luận · 2 reaction · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[AI Projects] AIProjectInstrumentor: non-streamed responses.create raises AttributeError ('NonRecordingSpan' object has no attribute 'attributes') when the span is not sampledCó thể đã có người làm @14H034160212 đã nhận 19 ngày trước. Đang mởAI Projects Client customer-reported question
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Azure/azure-sdk-for-python#49854 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
azure-eventhub migration guide: legacy checkpoint sample writes "None" metadata for partitions that were never checkpointedCó thể đã có người làm @hidingmyname đã nhận 27 ngày trước. Đang mởClient customer-reported Event Hubs needs-team-attention question Service Attention
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Azure/azure-sdk-for-python#49723 · 2 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Scheduled test pipelines fail at the Analyze_Test stage due to date formattingCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởEngSys
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Azure/azure-sdk-for-python#49614 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Azure/azure-sdk-for-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
vllm-project/vllm#70030 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
TigreGotico/tugaphone#408 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
gke-labs/kube-agents#7308 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
t: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 3 ngày
-
chore
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
lugassawan/swe-workbench#841 ·