microsoftgraph / microsoftgraph/msgraph-beta-sdk-python
Detection rule response action identifiers always return an empty list
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 44
- Forks
- 16
- Merge médio
- 20h 39min
- PRs com merge (30d)
- 3
Descrição
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
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece pelo ponto de entrada graph_client.security.rules.detection_rules.get() e pela implementação de ResponseAction get_field_deserializers mostrada na issue. Rastreie como identifier é gerado e desserializado, incluindo o esquema de origem ou o gerador, se aplicável. Considera-se concluído quando as detection-rule response actions retornarem o enum identifier apropriado em vez de uma lista vazia.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- python
- Domínio
- api
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 38/100