From 52e7207c4cf6e4603c410cd5fb6a62da63eee7a1 Mon Sep 17 00:00:00 2001 From: Nitish-Kulkarni3 Date: Thu, 19 Mar 2026 20:15:40 +0530 Subject: [PATCH] chore: deprecate hs-crypto --- .github/workflows/ci.yml | 6 +-- .secrets.baseline | 12 +++--- README.md | 2 + .../event_notifications_v1.py | 42 +++++++++++++++---- ibm_eventnotifications/version.py | 1 + requirements-dev.txt | 2 +- setup.py | 12 ++---- .../test_event_notifications_v1.py | 1 + test/unit/test_event_notifications_v1.py | 11 ++--- tox.ini | 12 +----- 10 files changed, 59 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cdb827..7aabf3a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: environment: ci strategy: matrix: - python-version: ['3.9', '3.10', '3.11'] + python-version: ['3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v3 with: @@ -39,7 +39,7 @@ jobs: run: tox - name: Install release dependencies - if: github.ref == 'refs/heads/main' && matrix.python-version == '3.9' + if: github.ref == 'refs/heads/main' && matrix.python-version == '3.10' run: | pip install bump-my-version build twine sudo npm install -g semantic-release \ @@ -49,7 +49,7 @@ jobs: @semantic-release/github - name: Semantic Release and Publish - if: github.ref == 'refs/heads/main' && matrix.python-version == '3.9' + if: github.ref == 'refs/heads/main' && matrix.python-version == '3.10' env: GH_TOKEN: ${{ secrets.GH_TOKEN }} run: | diff --git a/.secrets.baseline b/.secrets.baseline index 0ac0f23..e08a40b 100644 --- a/.secrets.baseline +++ b/.secrets.baseline @@ -3,7 +3,7 @@ "files": "^.secrets.baseline$", "lines": null }, - "generated_at": "2025-12-09T17:38:40Z", + "generated_at": "2026-03-19T14:44:16Z", "plugins_used": [ { "name": "AWSKeyDetector" @@ -122,7 +122,7 @@ "hashed_secret": "d4c3d66fd0c38547a3c7a4c6bdc29c36911bc030", "is_secret": false, "is_verified": false, - "line_number": 627, + "line_number": 628, "type": "Secret Keyword", "verified_result": null }, @@ -130,7 +130,7 @@ "hashed_secret": "0cc20f91828bed53ddb6294968b7f9abd631a3ba", "is_secret": false, "is_verified": false, - "line_number": 1743, + "line_number": 1744, "type": "Secret Keyword", "verified_result": null }, @@ -138,7 +138,7 @@ "hashed_secret": "3235b7f8d626cde63611d2e9ec43473f4e844c67", "is_secret": false, "is_verified": false, - "line_number": 3710, + "line_number": 3711, "type": "Base64 High Entropy String", "verified_result": null } @@ -148,7 +148,7 @@ "hashed_secret": "7eeef8638d6f283c8d76d7811ec6e5f198e16021", "is_secret": false, "is_verified": false, - "line_number": 7927, + "line_number": 7928, "type": "Base64 High Entropy String", "verified_result": null }, @@ -156,7 +156,7 @@ "hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4", "is_secret": false, "is_verified": false, - "line_number": 10934, + "line_number": 10935, "type": "Secret Keyword", "verified_result": null } diff --git a/README.md b/README.md index ec17f43..43970fc 100644 --- a/README.md +++ b/README.md @@ -968,6 +968,8 @@ integration_response = get_integration_response.get_result() ### Update Integration +> **⚠️ DEPRECATION WARNING**: The `hs-crypto` integration type is deprecated and will be removed in a future release. Please migrate to alternative encryption solutions. + For kms/hs-crypto ```py diff --git a/ibm_eventnotifications/event_notifications_v1.py b/ibm_eventnotifications/event_notifications_v1.py index e955987..661d47c 100644 --- a/ibm_eventnotifications/event_notifications_v1.py +++ b/ibm_eventnotifications/event_notifications_v1.py @@ -1,6 +1,6 @@ # coding: utf-8 -# (C) Copyright IBM Corp. 2025. +# (C) Copyright IBM Corp. 2026. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -2602,8 +2602,8 @@ def replace_integration( :param str instance_id: Unique identifier for IBM Cloud Event Notifications instance. :param str id: Unique identifier for integration. - :param str type: Integration type. Allowed values are kms, hs-crypto and - collect_failed_events. + :param str type: Integration type. Allowed values are kms, hs-crypto + (deprecated) and collect_failed_events. :param IntegrationMetadata metadata: Integration Metadata object. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. @@ -3360,9 +3360,9 @@ def get_notifications_status( **kwargs, ) -> DetailedResponse: """ - Get notification status. + Get status of webhook test notification. - Get notification status. + Status of webhook test notification. :param str instance_id: Unique identifier for IBM Cloud Event Notifications instance. @@ -3575,21 +3575,29 @@ class BounceMetrics: :attr List[BounceMetricItem] metrics: array of bounce metrics. :attr int total_count: total number of bounce metrics. + :attr int offset: Current offset. + :attr int limit: limit to show bounce metrics. """ def __init__( self, metrics: List['BounceMetricItem'], total_count: int, + offset: int, + limit: int, ) -> None: """ Initialize a BounceMetrics object. :param List[BounceMetricItem] metrics: array of bounce metrics. :param int total_count: total number of bounce metrics. + :param int offset: Current offset. + :param int limit: limit to show bounce metrics. """ self.metrics = metrics self.total_count = total_count + self.offset = offset + self.limit = limit @classmethod def from_dict(cls, _dict: Dict) -> 'BounceMetrics': @@ -3603,6 +3611,14 @@ def from_dict(cls, _dict: Dict) -> 'BounceMetrics': args['total_count'] = _dict.get('total_count') else: raise ValueError('Required property \'total_count\' not present in BounceMetrics JSON') + if 'offset' in _dict: + args['offset'] = _dict.get('offset') + else: + raise ValueError('Required property \'offset\' not present in BounceMetrics JSON') + if 'limit' in _dict: + args['limit'] = _dict.get('limit') + else: + raise ValueError('Required property \'limit\' not present in BounceMetrics JSON') return cls(**args) @classmethod @@ -3623,6 +3639,10 @@ def to_dict(self) -> Dict: _dict['metrics'] = metrics_list if hasattr(self, 'total_count') and self.total_count is not None: _dict['total_count'] = self.total_count + if hasattr(self, 'offset') and self.offset is not None: + _dict['offset'] = self.offset + if hasattr(self, 'limit') and self.limit is not None: + _dict['limit'] = self.limit return _dict def _to_dict(self): @@ -5585,7 +5605,8 @@ class IntegrationGetResponse: Integration response object. :attr str id: ID of the integration. - :attr str type: Integration type. Allowed values are kms and hs-crypto. + :attr str type: Integration type. Allowed values are kms and hs-crypto + (deprecated) and collect_failed_events. :attr IntegrationMetadata metadata: Integration Metadata object. :attr datetime created_at: Creation time of an integration. :attr datetime updated_at: Last update time of an integration. @@ -5603,7 +5624,8 @@ def __init__( Initialize a IntegrationGetResponse object. :param str id: ID of the integration. - :param str type: Integration type. Allowed values are kms and hs-crypto. + :param str type: Integration type. Allowed values are kms and hs-crypto + (deprecated) and collect_failed_events. :param IntegrationMetadata metadata: Integration Metadata object. :param datetime created_at: Creation time of an integration. :param datetime updated_at: Last update time of an integration. @@ -5817,7 +5839,8 @@ class IntegrationListItem: all Integrations response object. :attr str id: ID of the integration. - :attr str type: Integration type. Allowed values are kms and hs-crypto. + :attr str type: Integration type. Allowed values are kms, hs-crypto (deprecated) + and collect_failed_events. :attr IntegrationMetadata metadata: Integration Metadata object. :attr datetime created_at: Creation time of an integration. :attr datetime updated_at: Update time of an integration. @@ -5835,7 +5858,8 @@ def __init__( Initialize a IntegrationListItem object. :param str id: ID of the integration. - :param str type: Integration type. Allowed values are kms and hs-crypto. + :param str type: Integration type. Allowed values are kms, hs-crypto + (deprecated) and collect_failed_events. :param IntegrationMetadata metadata: Integration Metadata object. :param datetime created_at: Creation time of an integration. :param datetime updated_at: Update time of an integration. diff --git a/ibm_eventnotifications/version.py b/ibm_eventnotifications/version.py index 7627cdb..3141e03 100644 --- a/ibm_eventnotifications/version.py +++ b/ibm_eventnotifications/version.py @@ -17,4 +17,5 @@ """ Version of ibm_eventnotifications """ + __version__ = '0.22.0' diff --git a/requirements-dev.txt b/requirements-dev.txt index ed5a3e6..3626b99 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -4,4 +4,4 @@ pylint>=3.0.0,<4.0.0 pytest>=7.4.2,<8.0.0 pytest-cov>=4.1.0,<5.0.0 responses>=0.23.3,<1.0.0 -black>=24.0.0,<25.0.0 \ No newline at end of file +black>=26.3.1 \ No newline at end of file diff --git a/setup.py b/setup.py index 780a61d..042a175 100644 --- a/setup.py +++ b/setup.py @@ -14,21 +14,18 @@ # limitations under the License. from setuptools import setup -from setuptools.command.test import test as TestCommand import os import sys -import pkg_resources __version__ = '0.22.0' PACKAGE_NAME = 'ibm_eventnotifications' PACKAGE_DESC = 'Python server SDK for IBM Cloud Event Notifications service' with open('requirements.txt') as f: - install_requires = [ - str(req) for req in pkg_resources.parse_requirements(f) - ] + install_requires = [line.strip() for line in f if line.strip() and not line.startswith('#')] + with open('requirements-dev.txt') as f: - tests_require = [str(req) for req in pkg_resources.parse_requirements(f)] + tests_require = [line.strip() for line in f if line.strip() and not line.startswith('#')] if sys.argv[-1] == 'publish': # test server @@ -61,10 +58,9 @@ classifiers=[ 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.8', - 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', diff --git a/test/integration/test_event_notifications_v1.py b/test/integration/test_event_notifications_v1.py index d41c8d7..4fba340 100644 --- a/test/integration/test_event_notifications_v1.py +++ b/test/integration/test_event_notifications_v1.py @@ -16,6 +16,7 @@ """ Integration Tests for EventNotificationsV1 """ + import os from datetime import timezone, timedelta diff --git a/test/unit/test_event_notifications_v1.py b/test/unit/test_event_notifications_v1.py index 2ae30bc..ac29ec3 100644 --- a/test/unit/test_event_notifications_v1.py +++ b/test/unit/test_event_notifications_v1.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# (C) Copyright IBM Corp. 2025. +# (C) Copyright IBM Corp. 2026. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -32,7 +32,6 @@ import urllib from ibm_eventnotifications.event_notifications_v1 import * - _service = EventNotificationsV1(authenticator=NoAuthAuthenticator()) _base_url = 'https://us-south.event-notifications.cloud.ibm.com/event-notifications' @@ -278,7 +277,7 @@ def test_get_bounce_metrics_all_params(self): """ # Set up mock url = preprocess_url('/v1/instances/testString/metrics/bounce') - mock_response = '{"metrics": [{"email_address": "email_address", "subject": "subject", "error_message": "error_message", "ip_address": "ip_address", "subscription_id": "subscription_id", "timestamp": "2019-01-01T12:00:00.000Z"}], "total_count": 0}' + mock_response = '{"metrics": [{"email_address": "email_address", "subject": "subject", "error_message": "error_message", "ip_address": "ip_address", "subscription_id": "subscription_id", "timestamp": "2019-01-01T12:00:00.000Z"}], "total_count": 0, "offset": 6, "limit": 5}' responses.add( responses.GET, url, @@ -352,7 +351,7 @@ def test_get_bounce_metrics_required_params(self): """ # Set up mock url = preprocess_url('/v1/instances/testString/metrics/bounce') - mock_response = '{"metrics": [{"email_address": "email_address", "subject": "subject", "error_message": "error_message", "ip_address": "ip_address", "subscription_id": "subscription_id", "timestamp": "2019-01-01T12:00:00.000Z"}], "total_count": 0}' + mock_response = '{"metrics": [{"email_address": "email_address", "subject": "subject", "error_message": "error_message", "ip_address": "ip_address", "subscription_id": "subscription_id", "timestamp": "2019-01-01T12:00:00.000Z"}], "total_count": 0, "offset": 6, "limit": 5}' responses.add( responses.GET, url, @@ -402,7 +401,7 @@ def test_get_bounce_metrics_value_error(self): """ # Set up mock url = preprocess_url('/v1/instances/testString/metrics/bounce') - mock_response = '{"metrics": [{"email_address": "email_address", "subject": "subject", "error_message": "error_message", "ip_address": "ip_address", "subscription_id": "subscription_id", "timestamp": "2019-01-01T12:00:00.000Z"}], "total_count": 0}' + mock_response = '{"metrics": [{"email_address": "email_address", "subject": "subject", "error_message": "error_message", "ip_address": "ip_address", "subscription_id": "subscription_id", "timestamp": "2019-01-01T12:00:00.000Z"}], "total_count": 0, "offset": 6, "limit": 5}' responses.add( responses.GET, url, @@ -7223,6 +7222,8 @@ def test_bounce_metrics_serialization(self): bounce_metrics_model_json = {} bounce_metrics_model_json['metrics'] = [bounce_metric_item_model] bounce_metrics_model_json['total_count'] = 0 + bounce_metrics_model_json['offset'] = 38 + bounce_metrics_model_json['limit'] = 38 # Construct a model instance of BounceMetrics by calling from_dict on the json representation bounce_metrics_model = BounceMetrics.from_dict(bounce_metrics_model_json) diff --git a/tox.ini b/tox.ini index b237e17..6b00d2d 100644 --- a/tox.ini +++ b/tox.ini @@ -1,19 +1,11 @@ [tox] -envlist = py38, py39, py310, py311 +envlist = py310, py311, py312 [gh-actions] python = - 3.8: py38 - 3.9: py39 3.10: py310 3.11: py311 - -[testenv:py38] -basepython = python3.8 -deps = - pylint<3.0.0 - pytest -commands = pylint --rcfile=.pylintrc ibm_eventnotifications test/unit + 3.12: py312 [testenv] passenv = TOXENV CI GITHUB_*