Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Integration][Jira] Added support for oauth2 for live events (#1429)
### **User description** # Description What - Added support for live events using OAuth2 bearer token for authentication Why - Enabling oauth flow for creating integrations including live events How - Adding a new flow for creating webhooks using the REST API v3 of Jira for creating dynamic webhooks ## Type of change Please leave one option from the following and delete the rest: - [ ] Bug fix (non-breaking change which fixes an issue) - [x] New feature (non-breaking change which adds functionality) - [ ] New Integration (non-breaking change which adds a new integration) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Non-breaking change (fix of existing functionality that will not change current behavior) - [ ] Documentation (added/updated documentation) <h4> All tests should be run against the port production environment(using a testing org). </h4> ### Core testing checklist - [ ] Integration able to create all default resources from scratch - [ ] Resync finishes successfully - [ ] Resync able to create entities - [ ] Resync able to update entities - [ ] Resync able to detect and delete entities - [ ] Scheduled resync able to abort existing resync and start a new one - [ ] Tested with at least 2 integrations from scratch - [ ] Tested with Kafka and Polling event listeners - [ ] Tested deletion of entities that don't pass the selector ### Integration testing checklist - [ ] Integration able to create all default resources from scratch - [ ] Resync able to create entities - [ ] Resync able to update entities - [ ] Resync able to detect and delete entities - [ ] Resync finishes successfully - [ ] If new resource kind is added or updated in the integration, add example raw data, mapping and expected result to the `examples` folder in the integration directory. - [ ] If resource kind is updated, run the integration with the example data and check if the expected result is achieved - [ ] If new resource kind is added or updated, validate that live-events for that resource are working as expected - [ ] Docs PR link [here](#) ### Preflight checklist - [ ] Handled rate limiting - [ ] Handled pagination - [ ] Implemented the code in async - [ ] Support Multi account ## Screenshots Include screenshots from your environment showing how the resources of the integration will look. ## API Documentation Provide links to the API documentation used for this integration. ___ ### **PR Type** Enhancement, Tests ___ ### **Description** - Added OAuth2 support for Jira live events using webhooks. - Refactored webhook creation logic for OAuth and non-OAuth hosts. - Updated tests to validate new webhook creation flow. - Incremented version and updated changelog for release. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>client.py</strong><dd><code>Add OAuth2 webhook creation and refactor logic</code> </dd></summary> <hr> integrations/jira/jira/client.py <li>Added OAuth2-specific webhook creation logic.<br> <li> Introduced <code>is_oauth_host</code> method to determine host type.<br> <li> Refactored webhook creation into separate methods for OAuth and <br>non-OAuth.<br> <li> Updated request authentication handling for OAuth hosts. </details> </td> <td><a href="https://github.com/port-labs/ocean/pull/1429/files#diff-a98c78f4ca9c522a3bfdb5542ddb9f19e863b787dff0b39169b91f02facb53be">+51/-10</a> </td> </tr> <tr> <td> <details> <summary><strong>main.py</strong><dd><code>Update webhook setup to use new method</code> </dd></summary> <hr> integrations/jira/main.py - Updated to use the new `create_webhooks` method. </details> </td> <td><a href="https://github.com/port-labs/ocean/pull/1429/files#diff-2b2f2f1d5fe354b3995d362c13d0ef5e3ffe4161ab827726410de8039337e56f">+1/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests</strong></td><td><table> <tr> <td> <details> <summary><strong>test_client.py</strong><dd><code>Update tests for new webhook creation logic</code> </dd></summary> <hr> integrations/jira/tests/test_client.py <li>Updated tests to use <code>create_webhooks</code> instead of <code>create_events_webhook</code>.<br> <li> Verified OAuth and non-OAuth webhook creation flows. </details> </td> <td><a href="https://github.com/port-labs/ocean/pull/1429/files#diff-60921df7af01aa40bb94b945d9226ba1137e1e4c7f55aa67678f3e26a6e299a0">+2/-2</a> </td> </tr> </table></td></tr><tr><td><strong>Documentation</strong></td><td><table> <tr> <td> <details> <summary><strong>CHANGELOG.md</strong><dd><code>Update changelog for OAuth live events support</code> </dd></summary> <hr> integrations/jira/CHANGELOG.md <li>Documented addition of OAuth live events support.<br> <li> Added version 0.3.2 release notes. </details> </td> <td><a href="https://github.com/port-labs/ocean/pull/1429/files#diff-7a3a5e341adb6a81f8d0177dfc07d8b2d4230c39ede5d93de91c7b205a0e29fa">+9/-0</a> </td> </tr> </table></td></tr><tr><td><strong>Configuration changes</strong></td><td><table> <tr> <td> <details> <summary><strong>pyproject.toml</strong><dd><code>Bump version to 0.3.2</code> </dd></summary> <hr> integrations/jira/pyproject.toml - Incremented version to 0.3.2. </details> </td> <td><a href="https://github.com/port-labs/ocean/pull/1429/files#diff-58a3ec0700a093f3b96dda2068e48b8e26665e1c83dd8207ef3c8cac8480e8cc">+1/-1</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > <details> <summary> Need help?</summary><li>Type <code>/help how to ...</code> in the comments thread for any questions about Qodo Merge usage.</li><li>Check out the <a href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a> for more information.</li></details>
- Loading branch information