Repository navigation
Doppel API V2 Support: Add Client Credentials Support - #1344
siddharths1-metron wants to merge 40 commits into
Conversation
…endpoint playbook
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Hello @adarshtwy Just following up on the PR. Did you get a chance to take a look? Thanks! |
|
Hi @adarshtwy, just checking in on the PR. Have you had a chance to review it? We have a number of mutual customers eagerly waiting for this release. Any ETA you could share based on your current bandwidth would be greatly appreciated. Thanks! |
| @@ -0,0 +1 @@ | |||
| 3.11 | |||
There was a problem hiding this comment.
Could you please remove .python-version from the repository root so this PR stays scoped strictly to content/response_integrations/third_party/partner/doppel_vision/?
| while preserving v1 API-key compatibility. Added Get Alerts page-size support, | ||
| improved Ping and configuration handling, and removed the deprecated Create Abuse | ||
| Alert action because its Doppel endpoint is no longer available.' | ||
| version: 8.0 |
There was a problem hiding this comment.
Let's prefix the release note description with the component name (Integration - ...) so it follows the standard {Component Name} - {Description} convention:
| version: 8.0 | |
| description: "Integration - Added support for Doppel API v2 OAuth authentication (Client ID and Client Secret) while retaining backward compatibility with v1 API keys." |
There was a problem hiding this comment.
Committing this single-line suggestion in the GitHub UI replaced version: 8.0 on line 50 with a second description: key, leaving duplicate description keys and removing version: 8.0. Let's restore version: 8.0 and update the single description block on lines 44–49 to start with Integration - ....
| param_name="Page Size", | ||
| input_type=str, | ||
| default_value="30", | ||
| ) |
There was a problem hiding this comment.
We can collapse this call onto a single line (106 chars <= 120) and add an explicit type annotation on page_size since extract_action_param returns Any. Also, please add Page Size to the Get Alerts parameters table in resources/ai/actions_ai_description.yaml so the AI metadata stays in sync with GetAlerts.yaml.
| ) | |
| page_size: str = siemplify.extract_action_param("Page Size", print_value=True, default_value="") or "" |
There was a problem hiding this comment.
Applying the suggestion directly on line 49 replaced only the closing ) while leaving lines 45–48 (page_size = siemplify.extract_action_param(...)) open, resulting in a SyntaxError. Please replace the full multi-line call (lines 45–49) with the single-line statement.
| siemplify.end( | ||
| f"Failed to connect to the Doppel Vision server: {e}", | ||
| False, | ||
| ) |
There was a problem hiding this comment.
Nit: this siemplify.end(...) call fits comfortably on a single line (83 chars <= 120):
| ) | |
| siemplify.end(output_message, True, EXECUTION_STATE_COMPLETED) |
There was a problem hiding this comment.
Because this comment was anchored on the closing ) (line 27), committing the suggestion in the UI left the opening siemplify.end( on lines 24–26 unclosed (SyntaxError). Let's replace the entire siemplify.end(...) call (lines 24–27) with a single-line call.
| siemplify.end( | ||
| f"Failed to connect to the Doppel Vision server: {e!s}", | ||
| False, | ||
| ) |
There was a problem hiding this comment.
Nit: we can also keep this siemplify.end(...) call on a single line (85 chars <= 120):
| ) | |
| siemplify.end(output_message, False, EXECUTION_STATE_FAILED) |
There was a problem hiding this comment.
Similarly here, committing the suggestion on line 32 replaced only the closing ) of siemplify.end( from lines 29–31 (SyntaxError). Please replace the entire multi-line call on lines 29–32.
| api_key="org-key", | ||
| user_api_key="user-key", | ||
| org_code="ACM", | ||
| ).get_auth_headers() |
There was a problem hiding this comment.
Nit: this AuthProviderV1(...) call fits on a single line (108 chars <= 120) (and similarly for AuthProviderV2(...) on lines 45–47 at 105 chars):
| ).get_auth_headers() | |
| provider = AuthProviderV1(api_key="org-key", user_api_key="user-key") |
There was a problem hiding this comment.
Applying the suggestion on line 19 replaced only the closing ).get_auth_headers() of headers = AuthProviderV1( from lines 15–18 (SyntaxError). Please replace the entire multi-line call on lines 15–19.
| def test_existing_v1_config_without_new_fields_still_loads() -> None: | ||
| siemplify = MagicMock() | ||
|
|
||
| def extract(provider_name: str, param_name: str, **_kwargs): |
There was a problem hiding this comment.
Please add type annotations for **_kwargs and the return type on extract here (and on line 78):
| def extract(provider_name: str, param_name: str, **_kwargs): | |
| def extract(param_name: str, **_kwargs: object) -> str | None: |
There was a problem hiding this comment.
Removing provider_name: str from def extract(...) on line 54 causes del provider_name on line 55 to fail with F821 Undefined name provider_name (and siemplify.extract_configuration_param passes provider_name as its first positional argument). Let's keep provider_name: str in the signature: def extract(provider_name: str, param_name: str, **_kwargs: object) -> str | None:.
| self.ok = 200 <= status_code < 300 | ||
|
|
||
| def json(self): | ||
| return self._payload |
There was a problem hiding this comment.
Let's parameterize payload: dict[str, object] | None = None on line 15 and add a return type annotation def json(self) -> dict[str, object]: on line 22.
| self.ok = 200 <= status_code < 300 | ||
|
|
||
| def json(self): | ||
| return self._payload |
There was a problem hiding this comment.
Similarly here, let's parameterize payload: dict[str, object] on line 11 and annotate def json(self) -> dict[str, object]: on line 18.
| return self.store.get((context_type, identifier, property_key)) | ||
|
|
||
| def try_set_context_property(self, context_type, identifier, property_key, property_value): | ||
| self.store[(context_type, identifier, property_key)] = property_value |
There was a problem hiding this comment.
Please add parameter and return type annotations to the helper methods on ContextStore (lines 19 and 22) and SetOnlyContextStore (lines 31 and 34), and collapse the single-line calls on lines 41–43 (113 chars) and 139–141 (102 chars).
…n/release_notes.yaml Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/actions/GetAlerts.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/actions/Ping.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/actions/Ping.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/actions/UpdateAlert.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/tests/test_core/test_auth.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/tests/test_core/test_config.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/actions/UpdateAlert.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/actions/UpdateAlert.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/DoppelManager.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/DoppelManager.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/DoppelManager.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/DoppelManager.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/DoppelManager.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/alert_models.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/alert_models.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/auth_provider_v2.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/auth_provider_v2.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/config.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/config.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/config.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/config.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/config.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/token_cache.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
…n/core/http_client.py Co-authored-by: Adarsh Tiwary <61533527+adarshtwy@users.noreply.github.com> Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
Tighten types, docstrings, and IntegrationConfig construction so the Doppel v2 changes stay scoped and review-clean. Signed-off-by: Siddharth Sabale <siddharth.sabale@metronlabs.com>
|
Hi @adarshtwy I have made the requested changes. Can you PTAL? Thanks! |
Doppel API V2 Support: Add Client Credentials Support
Description
This PR adds Doppel API V2 Support to existing Doppel Integration.
What problem does this PR solve?
Allows Doppel Customers to use client credentials to setup the integration.
How does this PR solve the problem?
Adds Client Id and Client Secret in Config UI for Doppel Integration with supporting backend logic.
Checklist:
Please ensure you have completed the following items before submitting your PR.
This helps us review your contribution faster and more efficiently.
General Checks:
Open-Source Specific Checks:
For Google Team Members and Reviewers Only:
Screenshots (If Applicable)
If your changes involve UI or visual elements, please include screenshots or GIFs here.
Ensure any sensitive data is redacted or generalized.
Further Comments / Questions
Any additional comments, questions, or areas where you'd like specific feedback.