Skip to content

AIFW-24958: connection status unspecified not handled in event model enum#106

Merged
sridhre2 merged 2 commits into
cisco-ai-defense:mainfrom
vokit-cisco:AIFW-24958-ConnectionStatusUnspecified-not-handled-in-event-model-enum
Jun 5, 2026
Merged

AIFW-24958: connection status unspecified not handled in event model enum#106
sridhre2 merged 2 commits into
cisco-ai-defense:mainfrom
vokit-cisco:AIFW-24958-ConnectionStatusUnspecified-not-handled-in-event-model-enum

Conversation

@vokit-cisco

@vokit-cisco vokit-cisco commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for the API value ConnectionStatusUnspecified in management connection models.

This change prevents parsing failures when connection or expanded event responses include an unspecified connection status. It adds enum coverage, validates the behavior through connection and event client unit tests, and updates one management example call to match the current event conversation API signature.

Changes

  • Added ConnectionStatus.Unspecified enum value mapped to ConnectionStatusUnspecified.
  • Added unit test coverage for get_connection() parsing connections with unspecified status.
  • Added unit test coverage for expanded event responses containing connections with unspecified status:
    • list_events()
    • get_event()
  • Updated management_client_usage.py to call get_event_conversation(first_event.event_id) without the removed/unsupported expanded=True argument.

Test Plan

  • Branch diff inspected against main.
  • Targeted test files identified:
    • aidefense/tests/test_connection_management_client.py
    • aidefense/tests/test_event_management_client.py

Compatibility Notes

  • Additive change: Adds a new enum member without changing existing enum values.
  • Client code: Existing callers continue to work; responses containing ConnectionStatusUnspecified now parse correctly.
  • Integration impact: Low risk. This fixes handling for an API value that can already appear in responses.

Files Modified

  • aidefense/management/models/connection.py - Added ConnectionStatus.Unspecified.
  • aidefense/tests/test_connection_management_client.py - Added connection parsing test for unspecified status.
  • aidefense/tests/test_event_management_client.py - Added expanded event parsing tests for unspecified connection status.
  • examples/management/management_client_usage.py - Updated get_event_conversation() example call.

Total: 86 insertions(+), 1 deletion(-)

@sridhre2 sridhre2 merged commit 0ec35ee into cisco-ai-defense:main Jun 5, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants