microsoftgraph / microsoftgraph/msgraph-beta-sdk-python
Detection rule response action identifiers always return an empty list
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 44
- Forks
- 16
- Merge medio
- 20 h 39 min
- PR fusionados (30 d)
- 3
Descripción
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
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con el punto de entrada graph_client.security.rules.detection_rules.get() y la implementación de ResponseAction get_field_deserializers mostrada en el issue. Rastrea cómo se genera y deserializa identifier, incluido el esquema de origen o el generador, si corresponde. Se considera terminado cuando las detection-rule response actions devuelven el enum identifier apropiado en lugar de una lista vacía.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- python
- Área
- api
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 38/100