conditionalAccessConditionSet resource type desterilizes dropping agentIdRiskLevels
還沒有人認領這個 Issue。
評估
研究方向
從 conditional_access_condition_set.py 以及 kiota-serialization-json 中 get_collection_of_enum_values 的實作開始;透過文件所述的原則擷取來重現純量 "high" 回應。確定問題是由 API 還是序列化器負責,然後驗證 agent_id_risk_levels 是否將該值保留為 [ConditionalAccessAgentIdRiskLevels.High]。
由索引模型根據 Issue 內容生成。
描述
Describe the bug
The SDK model in conditional_access_condition_set.py correctly declares this as a collection:
"agentIdRiskLevels": lambda n: setattr(
self, 'agent_id_risk_levels',
n.get_collection_of_enum_values(ConditionalAccessAgentIdRiskLevels)
)
However, kiota-serialization-json's get_collection_of_enum_values only handles list inputs:
def get_collection_of_enum_values(self, enum_class: K) -> Optional[list[K]]:
if isinstance(self._json_node, list): # scalar string fails this check
return list(map(
lambda x: self._create_new_node(x).get_enum_value(enum_class),
self._json_node
))
return [] # ← value silently dropped
When the API returns "high" (a string, not a list), isinstance(self._json_node, list) is False, so the method returns [] and the actual value is silently lost.
Expected behavior
policy.conditions.agent_id_risk_levels should return [ConditionalAccessAgentIdRiskLevels.High].
The issue could be:
API-side: The API should return ["high"] (array) per the documentation, which describes this as a collection
Kiota-side: get_collection_of_enum_values should handle a scalar gracefully by wrapping it in a list (this may warrant a separate issue on microsoft/kiota-serialization-json-python)
How to reproduce
-
Have a Conditional Access policy with an agent ID risk level condition set (e.g. high)
-
Fetch policies via the Beta SDK:
result = await graph_client.identity.conditional_access.policies.get() -
Inspect policy.conditions.agent_id_risk_levels — it will be [] instead of [ConditionalAccessAgentIdRiskLevels.High]
SDK Version
1.57
Latest version known to work for scenario above?
No response
Known Workarounds
No response
Debug output
Click to expand log
```</details>
### Configuration
_No response_
### Other information
_No response_
- 主要語言
- Python
- 星號
- 44
- 分支
- 16
- 平均合併
- 20 小時 39 分鐘
- 30 天內合併 PR
- 3
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoftgraph/msgraph-beta-sdk-python 的其他 Issue
-
enhancement
難度 1/5 1 小時以內 新手友好度 72/100
-
status:waiting-for-triage type:bug
難度 3/5 1-2 天 新手友好度 55/100
-
status:waiting-for-triage type:bug
難度 3/5 1-2 天 新手友好度 42/100
microsoftgraph/msgraph-beta-sdk-python#1006 · 1 則留言 ·
-
status:waiting-for-triage type:bug
難度 2/5 1-3 小時 新手友好度 48/100
microsoftgraph/msgraph-beta-sdk-python#987 · 2 則留言 ·
-
status:waiting-for-triage type:bug
難度 4/5 3-5 天 新手友好度 45/100
查看 microsoftgraph/msgraph-beta-sdk-python 的全部 Issue
相似的 Issue
-
triage/confirmed
難度 2/5 1-3 小時 新手友好度 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
難度 1/5 1 小時以內 新手友好度 92/100
NousResearch/hermes-agent#118866 ·
-
bug
難度 1/5 1 小時以內 新手友好度 90/100
apache/cloudstack#14222 ·
-
難度 2/5 1-3 小時 新手友好度 76/100
-
bug
難度 2/5 1-3 小時 新手友好度 82/100