microsoftgraph / microsoftgraph/msgraph-beta-sdk-python

Detection rule response action identifiers always return an empty list

オープン
#706 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

status:waiting-for-triage type:bug
主要言語
Python
スター
44
フォーク
16
平均マージ
20時間 39分
マージ済み PR(30日)
3

説明

Describe the bug

When calling a List or Get for detection rules, e.g. await self.graph_client.security.rules.detection_rules.get(), you get a DetectionRuleCollectionResponse.

This response contains a field detection_action.response_actions which is a list of type ResponseAction.

For a specific response action, e.g. IsolateDeviceResponseAction, the identifier field is always [] instead of the Enum it should be, e.g. identifier=<DeviceIdEntityIdentifier.DeviceId: 'deviceId'>.

I believe this is due to this code in the get_field_deserializers:

fields: Dict[str, Callable[[Any], None]] = {
    "identifier": lambda n : setattr(self, 'identifier', n.get_collection_of_enum_values(DeviceIdEntityIdentifier)),
    "isolationType": lambda n : setattr(self, 'isolation_type', n.get_enum_value(IsolationType)),
}

I suspect the get_collection_of_enum_values should be replaced with get_enum_value. Since I presume that this code is all generated, the root cause of this problem is probably somewhere else.

Expected behavior

Return the correct enum for all ResponseAction identifiers.

How to reproduce

Call await self.graph_client.security.rules.detection_rules.get() on a detection rule with a response action.

SDK Version

1.16.0

Latest version known to work for scenario above?

No response

Known Workarounds

No response

Debug output

No response

Configuration
  • OS: MacOS 14.5
  • Architecture: Apple ARM
Other information

No response

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Issue に示されている graph_client.security.rules.detection_rules.get() エントリポイントと ResponseAction get_field_deserializers の実装から始めます。identifier がどのように生成され、デシリアライズされるかを、該当する場合はソーススキーマまたはジェネレーターも含めて追跡します。完了条件は、detection-rule response actions が空のリストではなく適切な enum identifier を返すことです。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
api
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。