conditionalAccessConditionSet resource type desterilizes dropping agentIdRiskLevels
まだ誰も着手していません。
評価
調査の方向性
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分
- マージ済み PR(30日)
- 3
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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
-
link-check link-check:sphinx-theme
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
OpenHands/extensions#626 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
CSCfi/sd-search-api#39 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100