Skip to content

feat: updated dashboard methods to use request helpers#189

Open
mihirvala08 wants to merge 16 commits intomainfrom
feat/dashboard-method-util-refactor
Open

feat: updated dashboard methods to use request helpers#189
mihirvala08 wants to merge 16 commits intomainfrom
feat/dashboard-method-util-refactor

Conversation

@mihirvala08
Copy link
Collaborator

Refactored the dashboard module to use the centralized chronicle_request and chronicle_paginated_request utility functions instead of direct session method calls, improving consistency and maintainability across the codebase.

Resolves #185

Updated

  • src/secops/chronicle/dashboard.py: Migrated all dashboard functions to use chronicle_request and chronicle_paginated_request helper utilities instead of direct client.session.get/post/patch/delete calls
  • src/secops/chronicle/client.py: Minor adjustments to support the refactored dashboard methods
  • src/secops/cli/commands/dashboard.py: Updated CLI commands to work with refactored dashboard methods
  • tests/chronicle/test_dashboard.py: Refactored test suite to patch chronicle_request directly instead of mocking individual HTTP methods.

@PaperMtn
Copy link
Contributor

@mihirvala08 I've also been working on migrating dashboards. You've put the CLI parts in that i've not got to yet, but i've made a few other improvements as well:

Added:

  • Helpers for formatting (getting ID from resource name, JSON parsing etc.)
    • The idea being these can be used in other modules to standardise pulling the ID out of a resource name path.
    • Tests for these added as well
  • Ability to specify which API version to use (defaulting to the standard APIVersion.V1ALPHA for dashboards)

Fixes

  • Logic error in finding dashboard ID from full resource name
    • It wasn't correctly splitting the string correctly and getting the ID in some instances

Do you want me to include these changes on your branch so we can combine what we've been working on?

@mihirvala08
Copy link
Collaborator Author

@mihirvala08 I've also been working on migrating dashboards. You've put the CLI parts in that i've not got to yet, but i've made a few other improvements as well:

Added:

  • Helpers for formatting (getting ID from resource name, JSON parsing etc.)

    • The idea being these can be used in other modules to standardise pulling the ID out of a resource name path.
    • Tests for these added as well
  • Ability to specify which API version to use (defaulting to the standard APIVersion.V1ALPHA for dashboards)

Fixes

  • Logic error in finding dashboard ID from full resource name

    • It wasn't correctly splitting the string correctly and getting the ID in some instances

Do you want me to include these changes on your branch so we can combine what we've been working on?

Thanks @PaperMtn, these additional improvements look helpful.
Please add your changes on PR. (LMK If you are unable to push to this, I can reopen PR from forked and give you access to fork).

@PaperMtn
Copy link
Contributor

@mihirvala08 i've created a new PR [#190] into this branch, as I can't push into your branch directly

@mihirvala08
Copy link
Collaborator Author

/run-integration-tests bddd51d

@mihirvala08
Copy link
Collaborator Author

/run-integration-tests 1c97e29

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.

dashboard.list_dashboards() not implementing pagination

2 participants