From 66210ff115e68fa401363ec32a3b5b3158390134 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Dec 2025 00:04:35 +0000 Subject: [PATCH 01/12] Bump actions/setup-python from 6.0.0 to 6.1.0 Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6.0.0 to 6.1.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/e797f83bcb11b83ae66e0230d6156d7c80228e7c...83679a892e2d95755f2dac6acb0bfd1e9ac5d548) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: 6.1.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/pre-release.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 92f6895e..019d050c 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -15,7 +15,7 @@ jobs: - name: Checkout source uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 with: python-version: ${{ env.PYTHON_VERSION }} - name: Install dependencies diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 677c73dc..c909d9e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: - name: Checkout source uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 with: python-version: ${{ env.PYTHON_VERSION }} - name: Install dependencies diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fa829a8f..72be3864 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: - name: Launch Splunk Docker instance run: SPLUNK_VERSION=${{ matrix.splunk-version }} docker compose up -d - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 with: python-version: ${{ matrix.python-version }} - name: (Python 3.7) Install dependencies From f1b5dc04ce4046380a357180c9cd87ece50dacb6 Mon Sep 17 00:00:00 2001 From: Mateusz Poliwczak Date: Fri, 9 Jan 2026 12:21:13 +0100 Subject: [PATCH 02/12] Add patch and put methods to the service (#693) Co-authored-by: Simon Noser --- splunklib/binding.py | 248 ++++++++++++++++++++++++++-- tests/integration/test_binding.py | 266 +++++++++++++++++++++++++++++- tests/system/test_cre_apps.py | 43 ++++- 3 files changed, 536 insertions(+), 21 deletions(-) diff --git a/splunklib/binding.py b/splunklib/binding.py index cddd32e2..064add74 100644 --- a/splunklib/binding.py +++ b/splunklib/binding.py @@ -862,6 +862,158 @@ def post( response = self.http.post(path, all_headers, **query) return response + @_authentication + @_log_duration + def put( + self, + path_segment, + owner=None, + app=None, + sharing=None, + headers=None, + **query, + ): + """Performs a PUT operation from the REST path segment with the given object, + namespace and query. + + This method is named to match the HTTP method. ``put`` makes at least + one round trip to the server, one additional round trip for each 303 + status returned, and at most two additional round trips if + the ``autologin`` field of :func:`connect` is set to ``True``. + + If *owner*, *app*, and *sharing* are omitted, this method uses the + default :class:`Context` namespace. All other keyword arguments are + included in the URL as query parameters. + + If you provide a ``body`` argument to ``put``, it will be used as the PUT body, + and all other keyword arguments will be passed as GET-style arguments in the URL. + + :raises AuthenticationError: Raised when the ``Context`` object is not + logged in. + :raises HTTPError: Raised when an error occurred in a PUT operation from + *path_segment*. + :param path_segment: A REST path segment. + :type path_segment: ``string`` + :param owner: The owner context of the namespace (optional). + :type owner: ``string`` + :param app: The app context of the namespace (optional). + :type app: ``string`` + :param sharing: The sharing mode of the namespace (optional). + :type sharing: ``string`` + :param headers: List of extra HTTP headers to send (optional). + :type headers: ``list`` of 2-tuples. + :param query: All other keyword arguments, which are used as query + parameters. + :param body: Parameters to be used in the put body. If specified, + any parameters in the query will be applied to the URL instead of + the body. If a dict is supplied, the key-value pairs will be form + encoded. If a string is supplied, the body will be passed through + in the request unchanged. + :type body: ``dict`` or ``str`` + :return: The response from the server. + :rtype: ``dict`` with keys ``body``, ``headers``, ``reason``, + and ``status`` + + **Example**:: + + c = binding.connect(...) + # Call an HTTP endpoint, exposed as Custom Rest Endpoint in a Splunk App. + # PUT /servicesNS/-/app_name/custom_rest_endpoint + c.put( + app="app_name", + path_segment="custom_rest_endpoint", + body=json.dumps({"key": "val"}), + headers=[("Content-Type", "application/json")], + ) + """ + if headers is None: + headers = [] + + path = self.authority + self._abspath( + path_segment, owner=owner, app=app, sharing=sharing + ) + + logger.debug("PUT request to %s (body: %s)", path, mask_sensitive_data(query)) + all_headers = headers + self.additional_headers + self._auth_headers + response = self.http.put(path, all_headers, **query) + return response + + @_authentication + @_log_duration + def patch( + self, + path_segment, + owner=None, + app=None, + sharing=None, + headers=None, + **query, + ): + """Performs a PATCH operation from the REST path segment with the given object, + namespace and query. + + This method is named to match the HTTP method. ``patch`` makes at least + one round trip to the server, one additional round trip for each 303 + status returned, and at most two additional round trips if + the ``autologin`` field of :func:`connect` is set to ``True``. + + If *owner*, *app*, and *sharing* are omitted, this method uses the + default :class:`Context` namespace. All other keyword arguments are + included in the URL as query parameters. + + If you provide a ``body`` argument to ``patch``, it will be used as the PATCH body, + and all other keyword arguments will be passed as GET-style arguments in the URL. + + :raises AuthenticationError: Raised when the ``Context`` object is not + logged in. + :raises HTTPError: Raised when an error occurred in a PATCH operation from + *path_segment*. + :param path_segment: A REST path segment. + :type path_segment: ``string`` + :param owner: The owner context of the namespace (optional). + :type owner: ``string`` + :param app: The app context of the namespace (optional). + :type app: ``string`` + :param sharing: The sharing mode of the namespace (optional). + :type sharing: ``string`` + :param headers: List of extra HTTP headers to send (optional). + :type headers: ``list`` of 2-tuples. + :param query: All other keyword arguments, which are used as query + parameters. + :param body: Parameters to be used in the patch body. If specified, + any parameters in the query will be applied to the URL instead of + the body. If a dict is supplied, the key-value pairs will be form + encoded. If a string is supplied, the body will be passed through + in the request unchanged. + :type body: ``dict`` or ``str`` + :return: The response from the server. + :rtype: ``dict`` with keys ``body``, ``headers``, ``reason``, + and ``status`` + + **Example**:: + + c = binding.connect(...) + # Call an HTTP endpoint, exposed as Custom Rest Endpoint in a Splunk App. + # PATCH /servicesNS/-/app_name/custom_rest_endpoint + c.patch( + app="app_name", + path_segment="custom_rest_endpoint", + body=json.dumps({"key": "val"}), + headers=[("Content-Type", "application/json")], + ) + """ + if headers is None: + headers = [] + + path = self.authority + self._abspath( + path_segment, owner=owner, app=app, sharing=sharing + ) + + logger.debug("PATCH request to %s (body: %s)", path, mask_sensitive_data(query)) + all_headers = headers + self.additional_headers + self._auth_headers + response = self.http.patch(path, all_headers, **query) + return response + @_authentication @_log_duration def request( @@ -1305,6 +1457,40 @@ def __init__( self.retries = retries self.retryDelay = retryDelay + def _prepare_request_body_and_url(self, url, headers, **kwargs): + """Helper function to prepare the request body and URL. + + :param url: The URL. + :type url: ``string`` + :param headers: A list of pairs specifying the headers for the HTTP request. + :type headers: ``list`` + :param kwargs: Additional keyword arguments (optional). + :type kwargs: ``dict`` + :returns: A tuple containing the updated URL, headers, and body. + :rtype: ``tuple`` + """ + if headers is None: + headers = [] + + # We handle GET-style arguments and an unstructured body. This is here + # to support the receivers/stream endpoint. + if "body" in kwargs: + # We only use application/x-www-form-urlencoded if there is no other + # Content-Type header present. This can happen in cases where we + # send requests as application/json, e.g. for KV Store. + if len([x for x in headers if x[0].lower() == "content-type"]) == 0: + headers.append(("Content-Type", "application/x-www-form-urlencoded")) + + body = kwargs.pop("body") + if isinstance(body, dict): + body = _encode(**body).encode("utf-8") + if len(kwargs) > 0: + url = url + UrlEncoded("?" + _encode(**kwargs), skip_encode=True) + else: + body = _encode(**kwargs).encode("utf-8") + + return url, headers, body + def delete(self, url, headers=None, **kwargs): """Sends a DELETE request to a URL. @@ -1379,26 +1565,52 @@ def post(self, url, headers=None, **kwargs): its structure). :rtype: ``dict`` """ - if headers is None: - headers = [] + url, headers, body = self._prepare_request_body_and_url(url, headers, **kwargs) + message = {"method": "POST", "headers": headers, "body": body} + return self.request(url, message) - # We handle GET-style arguments and an unstructured body. This is here - # to support the receivers/stream endpoint. - if "body" in kwargs: - # We only use application/x-www-form-urlencoded if there is no other - # Content-Type header present. This can happen in cases where we - # send requests as application/json, e.g. for KV Store. - if len([x for x in headers if x[0].lower() == "content-type"]) == 0: - headers.append(("Content-Type", "application/x-www-form-urlencoded")) + def put(self, url, headers=None, **kwargs): + """Sends a PUT request to a URL. - body = kwargs.pop("body") - if isinstance(body, dict): - body = _encode(**body).encode("utf-8") - if len(kwargs) > 0: - url = url + UrlEncoded("?" + _encode(**kwargs), skip_encode=True) - else: - body = _encode(**kwargs).encode("utf-8") - message = {"method": "POST", "headers": headers, "body": body} + :param url: The URL. + :type url: ``string`` + :param headers: A list of pairs specifying the headers for the HTTP + response (for example, ``[('Content-Type': 'text/cthulhu'), ('Token': 'boris')]``). + :type headers: ``list`` + :param kwargs: Additional keyword arguments (optional). If the argument + is ``body``, the value is used as the body for the request, and the + keywords and their arguments will be URL encoded. If there is no + ``body`` keyword argument, all the keyword arguments are encoded + into the body of the request in the format ``x-www-form-urlencoded``. + :type kwargs: ``dict`` + :returns: A dictionary describing the response (see :class:`HttpLib` for + its structure). + :rtype: ``dict`` + """ + url, headers, body = self._prepare_request_body_and_url(url, headers, **kwargs) + message = {"method": "PUT", "headers": headers, "body": body} + return self.request(url, message) + + def patch(self, url, headers=None, **kwargs): + """Sends a PATCH request to a URL. + + :param url: The URL. + :type url: ``string`` + :param headers: A list of pairs specifying the headers for the HTTP + response (for example, ``[('Content-Type': 'text/cthulhu'), ('Token': 'boris')]``). + :type headers: ``list`` + :param kwargs: Additional keyword arguments (optional). If the argument + is ``body``, the value is used as the body for the request, and the + keywords and their arguments will be URL encoded. If there is no + ``body`` keyword argument, all the keyword arguments are encoded + into the body of the request in the format ``x-www-form-urlencoded``. + :type kwargs: ``dict`` + :returns: A dictionary describing the response (see :class:`HttpLib` for + its structure). + :rtype: ``dict`` + """ + url, headers, body = self._prepare_request_body_and_url(url, headers, **kwargs) + message = {"method": "PATCH", "headers": headers, "body": body} return self.request(url, message) def request(self, url, message, **kwargs): diff --git a/tests/integration/test_binding.py b/tests/integration/test_binding.py index 4a43c2b0..3e6c4c51 100755 --- a/tests/integration/test_binding.py +++ b/tests/integration/test_binding.py @@ -937,7 +937,31 @@ def handler(url, message, **kwargs): body={"testkey": "testvalue"}, ) - def test_post_with_params_and_no_body(self): + def test_post_with_params_and_body_json(self): + def handler(url, message, **kwargs): + assert ( + url + == "https://localhost:8089/servicesNS/testowner/testapp/foo/bar?extrakey=extraval" + ) + assert message["body"] == '{"testkey": "testvalue"}' + return splunklib.data.Record( + { + "status": 200, + "headers": [], + } + ) + + ctx = binding.Context(handler=handler) + ctx.post( + "foo/bar", + extrakey="extraval", + owner="testowner", + app="testapp", + body=json.dumps({"testkey": "testvalue"}), + headers=[("Content-Type", "application/json")], + ) + + def test_post_with_urlencoded_params(self): def handler(url, message, **kwargs): assert url == "https://localhost:8089/servicesNS/testowner/testapp/foo/bar" assert message["body"] == b"extrakey=extraval" @@ -952,6 +976,164 @@ def handler(url, message, **kwargs): ctx.post("foo/bar", extrakey="extraval", owner="testowner", app="testapp") +class TestPutWithBodyParam(unittest.TestCase): + def test_put(self): + def handler(url, message, **kwargs): + assert url == "https://localhost:8089/servicesNS/testowner/testapp/foo/bar" + assert message["body"] == b"testkey=testvalue" + return splunklib.data.Record( + { + "status": 200, + "headers": [], + } + ) + + ctx = binding.Context(handler=handler) + ctx.put( + "foo/bar", owner="testowner", app="testapp", body={"testkey": "testvalue"} + ) + + def test_put_with_params_and_body_form(self): + def handler(url, message, **kwargs): + assert ( + url + == "https://localhost:8089/servicesNS/testowner/testapp/foo/bar?extrakey=extraval" + ) + assert message["body"] == b"testkey=testvalue" + return splunklib.data.Record( + { + "status": 200, + "headers": [], + } + ) + + ctx = binding.Context(handler=handler) + ctx.put( + "foo/bar", + extrakey="extraval", + owner="testowner", + app="testapp", + body={"testkey": "testvalue"}, + ) + + def test_put_with_params_and_body_json(self): + def handler(url, message, **kwargs): + assert ( + url + == "https://localhost:8089/servicesNS/testowner/testapp/foo/bar?extrakey=extraval" + ) + assert message["body"] == '{"testkey": "testvalue"}' + return splunklib.data.Record( + { + "status": 200, + "headers": [], + } + ) + + ctx = binding.Context(handler=handler) + ctx.put( + "foo/bar", + extrakey="extraval", + owner="testowner", + app="testapp", + body=json.dumps({"testkey": "testvalue"}), + headers=[("Content-Type", "application/json")], + ) + + def test_put_with_urlencoded_params(self): + def handler(url, message, **kwargs): + assert url == "https://localhost:8089/servicesNS/testowner/testapp/foo/bar" + assert message["body"] == b"extrakey=extraval" + return splunklib.data.Record( + { + "status": 200, + "headers": [], + } + ) + + ctx = binding.Context(handler=handler) + ctx.put("foo/bar", extrakey="extraval", owner="testowner", app="testapp") + + +class TestPatchWithBodyParam(unittest.TestCase): + def test_patch(self): + def handler(url, message, **kwargs): + assert url == "https://localhost:8089/servicesNS/testowner/testapp/foo/bar" + assert message["body"] == b"testkey=testvalue" + return splunklib.data.Record( + { + "status": 200, + "headers": [], + } + ) + + ctx = binding.Context(handler=handler) + ctx.patch( + "foo/bar", owner="testowner", app="testapp", body={"testkey": "testvalue"} + ) + + def test_patch_with_params_and_body_form(self): + def handler(url, message, **kwargs): + assert ( + url + == "https://localhost:8089/servicesNS/testowner/testapp/foo/bar?extrakey=extraval" + ) + assert message["body"] == b"testkey=testvalue" + return splunklib.data.Record( + { + "status": 200, + "headers": [], + } + ) + + ctx = binding.Context(handler=handler) + ctx.patch( + "foo/bar", + extrakey="extraval", + owner="testowner", + app="testapp", + body={"testkey": "testvalue"}, + ) + + def test_patch_with_params_and_body_json(self): + def handler(url, message, **kwargs): + assert ( + url + == "https://localhost:8089/servicesNS/testowner/testapp/foo/bar?extrakey=extraval" + ) + assert message["body"] == '{"testkey": "testvalue"}' + return splunklib.data.Record( + { + "status": 200, + "headers": [], + } + ) + + ctx = binding.Context(handler=handler) + ctx.patch( + "foo/bar", + extrakey="extraval", + owner="testowner", + app="testapp", + body=json.dumps({"testkey": "testvalue"}), + headers=[("Content-Type", "application/json")], + ) + + def test_patch_with_urlencoded_params(self): + def handler(url, message, **kwargs): + assert url == "https://localhost:8089/servicesNS/testowner/testapp/foo/bar" + assert message["body"] == b"extrakey=extraval" + return splunklib.data.Record( + { + "status": 200, + "headers": [], + } + ) + + ctx = binding.Context(handler=handler) + ctx.patch("foo/bar", extrakey="extraval", owner="testowner", app="testapp") + + def _wrap_handler(func, response_code=200, body=""): def wrapped(handler_self): result = func(handler_self) @@ -1038,5 +1220,87 @@ def check_response(handler): ctx.post("/", foo="bar", body={"baz": "baf", "hep": "cat"}) +class TestFullPut(unittest.TestCase): + def test_put_with_body_urlencoded(self): + def check_response(handler): + length = int(handler.headers.get("content-length", 0)) + body = handler.rfile.read(length) + assert body.decode("utf-8") == "foo=bar" + + with MockServer(PUT=check_response): + ctx = binding.connect(port=9093, scheme="http", token="waffle") + ctx.put("/", foo="bar") + + def test_put_with_body_string(self): + def check_response(handler): + length = int(handler.headers.get("content-length", 0)) + body = handler.rfile.read(length) + assert handler.headers["content-type"] == "application/json" + assert json.loads(body)["baz"] == "baf" + + with MockServer(PUT=check_response): + ctx = binding.connect( + port=9093, + scheme="http", + token="waffle", + headers=[("Content-Type", "application/json")], + ) + ctx.put("/", foo="bar", body='{"baz": "baf"}') + + def test_put_with_body_dict(self): + def check_response(handler): + length = int(handler.headers.get("content-length", 0)) + body = handler.rfile.read(length) + assert ( + handler.headers["content-type"] == "application/x-www-form-urlencoded" + ) + assert ensure_str(body) in ["baz=baf&hep=cat", "hep=cat&baz=baf"] + + with MockServer(PUT=check_response): + ctx = binding.connect(port=9093, scheme="http", token="waffle") + ctx.put("/", foo="bar", body={"baz": "baf", "hep": "cat"}) + + +class TestFullPatch(unittest.TestCase): + def test_patch_with_body_urlencoded(self): + def check_response(handler): + length = int(handler.headers.get("content-length", 0)) + body = handler.rfile.read(length) + assert body.decode("utf-8") == "foo=bar" + + with MockServer(PATCH=check_response): + ctx = binding.connect(port=9093, scheme="http", token="waffle") + ctx.patch("/", foo="bar") + + def test_patch_with_body_string(self): + def check_response(handler): + length = int(handler.headers.get("content-length", 0)) + body = handler.rfile.read(length) + assert handler.headers["content-type"] == "application/json" + assert json.loads(body)["baz"] == "baf" + + with MockServer(PATCH=check_response): + ctx = binding.connect( + port=9093, + scheme="http", + token="waffle", + headers=[("Content-Type", "application/json")], + ) + ctx.patch("/", foo="bar", body='{"baz": "baf"}') + + def test_patch_with_body_dict(self): + def check_response(handler): + length = int(handler.headers.get("content-length", 0)) + body = handler.rfile.read(length) + assert ( + handler.headers["content-type"] == "application/x-www-form-urlencoded" + ) + assert ensure_str(body) in ["baz=baf&hep=cat", "hep=cat&baz=baf"] + + with MockServer(PATCH=check_response): + ctx = binding.connect(port=9093, scheme="http", token="waffle") + ctx.patch("/", foo="bar", body={"baz": "baf", "hep": "cat"}) + + if __name__ == "__main__": unittest.main() diff --git a/tests/system/test_cre_apps.py b/tests/system/test_cre_apps.py index e1f5c9fb..6632e484 100644 --- a/tests/system/test_cre_apps.py +++ b/tests/system/test_cre_apps.py @@ -15,10 +15,8 @@ # under the License. import json -import pytest from tests import testlib -from splunklib import results class TestJSONCustomRestEndpointsSpecialMethodHelpers(testlib.SDKTestCase): @@ -59,6 +57,47 @@ def test_POST(self): }, ) + def test_PUT(self): + body = json.dumps({"foo": "bar"}) + resp = self.service.put( + app=self.app_name, + path_segment="execute", + body=body, + headers=[("x-bar", "baz")], + ) + self.assertIn(("x-foo", "bar"), resp.headers) + self.assertEqual(resp.status, 200) + self.assertEqual( + json.loads(str(resp.body)), + { + "payload": '{"foo": "bar"}', + "headers": {"x-bar": "baz"}, + "method": "PUT", + }, + ) + + def test_PATCH(self): + if self.service.splunk_version[0] < 10: + self.skipTest("PATCH custom REST endpoints not supported on splunk < 10") + + body = json.dumps({"foo": "bar"}) + resp = self.service.patch( + app=self.app_name, + path_segment="execute", + body=body, + headers=[("x-bar", "baz")], + ) + self.assertIn(("x-foo", "bar"), resp.headers) + self.assertEqual(resp.status, 200) + self.assertEqual( + json.loads(str(resp.body)), + { + "payload": '{"foo": "bar"}', + "headers": {"x-bar": "baz"}, + "method": "PATCH", + }, + ) + def test_DELETE(self): # delete does allow specifying body and custom headers. resp = self.service.delete( From 5afbf580e1c678d833f82f08ef162fa1151722df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 18:18:38 +0100 Subject: [PATCH 03/12] Bump actions/checkout from 6.pre.beta to 6.0.2 (#696) Bumps [actions/checkout](https://github.com/actions/checkout) from 6.pre.beta to 6.0.2. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/71cf2267d89c5cb81562390fa70a37fa40b1305e...de0fac2e4500dabe0009e67214ff5f5447ce83dd) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 6.0.2 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/pre-release.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 019d050c..ab98f505 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -13,7 +13,7 @@ jobs: name: splunk-test-pypi steps: - name: Checkout source - uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c909d9e7..61a93627 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,7 +15,7 @@ jobs: name: splunk-pypi steps: - name: Checkout source - uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 with: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 72be3864..5b117ff8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,7 +22,7 @@ jobs: splunk-version: latest steps: - name: Checkout code - uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - name: Launch Splunk Docker instance run: SPLUNK_VERSION=${{ matrix.splunk-version }} docker compose up -d - name: Setup Python ${{ matrix.python-version }} From a0b9c916a7c8c9977a8fedbbb594ff7f5a259d37 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 18:42:02 +0100 Subject: [PATCH 04/12] Bump actions/setup-python from 6.1.0 to 6.2.0 (#697) Bumps [actions/setup-python](https://github.com/actions/setup-python) from 6.1.0 to 6.2.0. - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/83679a892e2d95755f2dac6acb0bfd1e9ac5d548...a309ff8b426b58ec0e2a45f0f869d46889d02405) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: 6.2.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/pre-release.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index ab98f505..9c9bfef8 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -15,7 +15,7 @@ jobs: - name: Checkout source uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 with: python-version: ${{ env.PYTHON_VERSION }} - name: Install dependencies diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 61a93627..46bc07c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: - name: Checkout source uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 with: python-version: ${{ env.PYTHON_VERSION }} - name: Install dependencies diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5b117ff8..3de38452 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: - name: Launch Splunk Docker instance run: SPLUNK_VERSION=${{ matrix.splunk-version }} docker compose up -d - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 with: python-version: ${{ matrix.python-version }} - name: (Python 3.7) Install dependencies From f4b451e691f364979e15ea9accfd00a0f9cb550f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20J=C4=99drecki?= Date: Tue, 10 Feb 2026 13:11:12 +0100 Subject: [PATCH 05/12] Adjust top-level comments in all files (#699) * Adjust top-level comments in all files --- docs/conf.py | 2 -- sitecustomize.py | 4 +--- splunklib/__init__.py | 2 +- splunklib/binding.py | 2 +- splunklib/client.py | 2 +- splunklib/data.py | 2 +- splunklib/modularinput/argument.py | 2 +- splunklib/modularinput/event.py | 2 +- splunklib/modularinput/event_writer.py | 2 +- splunklib/modularinput/input_definition.py | 2 +- splunklib/modularinput/scheme.py | 2 +- splunklib/modularinput/script.py | 2 +- splunklib/modularinput/utils.py | 2 +- splunklib/modularinput/validation_definition.py | 2 +- splunklib/results.py | 2 +- splunklib/searchcommands/__init__.py | 4 +--- splunklib/searchcommands/decorators.py | 4 +--- splunklib/searchcommands/environment.py | 4 +--- splunklib/searchcommands/eventing_command.py | 4 +--- splunklib/searchcommands/external_search_command.py | 4 +--- splunklib/searchcommands/generating_command.py | 4 +--- splunklib/searchcommands/internals.py | 4 +--- splunklib/searchcommands/reporting_command.py | 4 +--- splunklib/searchcommands/search_command.py | 6 ++---- splunklib/searchcommands/streaming_command.py | 4 +--- splunklib/searchcommands/validators.py | 4 +--- splunklib/utils.py | 2 +- tests/integration/test_app.py | 4 +--- tests/integration/test_binding.py | 4 +--- tests/integration/test_collection.py | 4 +--- tests/integration/test_conf.py | 4 +--- tests/integration/test_event_type.py | 4 +--- tests/integration/test_fired_alert.py | 4 +--- tests/integration/test_index.py | 4 +--- tests/integration/test_input.py | 4 +--- tests/integration/test_job.py | 4 +--- tests/integration/test_kvstore_batch.py | 4 +--- tests/integration/test_kvstore_conf.py | 4 +--- tests/integration/test_kvstore_data.py | 4 +--- tests/integration/test_logger.py | 4 +--- tests/integration/test_macro.py | 4 +--- tests/integration/test_message.py | 4 +--- tests/integration/test_modular_input_kinds.py | 4 +--- tests/integration/test_role.py | 4 +--- tests/integration/test_saved_search.py | 4 +--- tests/integration/test_service.py | 4 +--- tests/integration/test_storage_passwords.py | 4 +--- tests/integration/test_user.py | 4 +--- tests/system/test_apps/eventing_app/bin/eventingcsc.py | 5 +---- tests/system/test_apps/generating_app/bin/generatingcsc.py | 5 +---- tests/system/test_apps/modularinput_app/bin/modularinput.py | 4 +--- tests/system/test_apps/reporting_app/bin/reportingcsc.py | 5 +---- tests/system/test_apps/streaming_app/bin/streamingcsc.py | 5 +---- tests/system/test_cre_apps.py | 4 +--- tests/system/test_csc_apps.py | 4 +--- tests/system/test_modularinput_app.py | 4 +--- tests/testlib.py | 4 +--- tests/unit/modularinput/modularinput_testlib.py | 4 +--- tests/unit/modularinput/test_event.py | 4 +--- tests/unit/modularinput/test_input_definition.py | 4 +--- tests/unit/modularinput/test_scheme.py | 3 +-- tests/unit/modularinput/test_validation_definition.py | 4 +--- tests/unit/searchcommands/__init__.py | 5 +---- tests/unit/searchcommands/test_builtin_options.py | 5 +---- tests/unit/searchcommands/test_configuration_settings.py | 5 +---- tests/unit/searchcommands/test_decorators.py | 5 +---- tests/unit/searchcommands/test_internals_v1.py | 4 +--- tests/unit/searchcommands/test_internals_v2.py | 5 +---- tests/unit/searchcommands/test_search_command.py | 5 +---- tests/unit/searchcommands/test_validators.py | 5 +---- tests/unit/test_data.py | 4 +--- tests/unit/test_utils.py | 4 +--- utils/__init__.py | 2 +- utils/cmdopts.py | 2 +- 74 files changed, 74 insertions(+), 200 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 25c60a3d..20d094dd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# # Splunk SDK for Python documentation build configuration file, created by # sphinx-quickstart on Fri Apr 13 12:28:15 2012. # diff --git a/sitecustomize.py b/sitecustomize.py index 6a23233a..965fafbe 100644 --- a/sitecustomize.py +++ b/sitecustomize.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/__init__.py b/splunklib/__init__.py index 84c4a061..04919345 100644 --- a/splunklib/__init__.py +++ b/splunklib/__init__.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/binding.py b/splunklib/binding.py index 064add74..78bf7a95 100644 --- a/splunklib/binding.py +++ b/splunklib/binding.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/client.py b/splunklib/client.py index 0d69773f..6e9ae009 100644 --- a/splunklib/client.py +++ b/splunklib/client.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/data.py b/splunklib/data.py index 1f026ed8..2e8d4259 100644 --- a/splunklib/data.py +++ b/splunklib/data.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/modularinput/argument.py b/splunklib/modularinput/argument.py index 99203ca2..5fca9cd3 100644 --- a/splunklib/modularinput/argument.py +++ b/splunklib/modularinput/argument.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/modularinput/event.py b/splunklib/modularinput/event.py index 4d243c75..ad541a5d 100644 --- a/splunklib/modularinput/event.py +++ b/splunklib/modularinput/event.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/modularinput/event_writer.py b/splunklib/modularinput/event_writer.py index 51c3cb0f..4305dcf6 100644 --- a/splunklib/modularinput/event_writer.py +++ b/splunklib/modularinput/event_writer.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/modularinput/input_definition.py b/splunklib/modularinput/input_definition.py index 9886374c..1b841098 100644 --- a/splunklib/modularinput/input_definition.py +++ b/splunklib/modularinput/input_definition.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/modularinput/scheme.py b/splunklib/modularinput/scheme.py index 76b13a63..a046ccf1 100644 --- a/splunklib/modularinput/scheme.py +++ b/splunklib/modularinput/scheme.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/modularinput/script.py b/splunklib/modularinput/script.py index 2192eb72..83d39564 100644 --- a/splunklib/modularinput/script.py +++ b/splunklib/modularinput/script.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/modularinput/utils.py b/splunklib/modularinput/utils.py index 2218c0d2..a8f7af58 100644 --- a/splunklib/modularinput/utils.py +++ b/splunklib/modularinput/utils.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/modularinput/validation_definition.py b/splunklib/modularinput/validation_definition.py index c90dc2aa..a87af1d3 100644 --- a/splunklib/modularinput/validation_definition.py +++ b/splunklib/modularinput/validation_definition.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/results.py b/splunklib/results.py index 7bce883f..09cbe00a 100644 --- a/splunklib/results.py +++ b/splunklib/results.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/searchcommands/__init__.py b/splunklib/searchcommands/__init__.py index 94dbbda9..92cf983f 100644 --- a/splunklib/searchcommands/__init__.py +++ b/splunklib/searchcommands/__init__.py @@ -1,6 +1,4 @@ -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/searchcommands/decorators.py b/splunklib/searchcommands/decorators.py index 6d2f7a28..505d2a22 100644 --- a/splunklib/searchcommands/decorators.py +++ b/splunklib/searchcommands/decorators.py @@ -1,6 +1,4 @@ -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/searchcommands/environment.py b/splunklib/searchcommands/environment.py index 7f8cb6d3..96360b00 100644 --- a/splunklib/searchcommands/environment.py +++ b/splunklib/searchcommands/environment.py @@ -1,6 +1,4 @@ -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/searchcommands/eventing_command.py b/splunklib/searchcommands/eventing_command.py index d9f90b78..bf1555df 100644 --- a/splunklib/searchcommands/eventing_command.py +++ b/splunklib/searchcommands/eventing_command.py @@ -1,6 +1,4 @@ -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/searchcommands/external_search_command.py b/splunklib/searchcommands/external_search_command.py index cceeb508..b54b62f5 100644 --- a/splunklib/searchcommands/external_search_command.py +++ b/splunklib/searchcommands/external_search_command.py @@ -1,6 +1,4 @@ -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/searchcommands/generating_command.py b/splunklib/searchcommands/generating_command.py index d2d12931..d02265c4 100644 --- a/splunklib/searchcommands/generating_command.py +++ b/splunklib/searchcommands/generating_command.py @@ -1,6 +1,4 @@ -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/searchcommands/internals.py b/splunklib/searchcommands/internals.py index 40b9107c..cae74b78 100644 --- a/splunklib/searchcommands/internals.py +++ b/splunklib/searchcommands/internals.py @@ -1,6 +1,4 @@ -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/searchcommands/reporting_command.py b/splunklib/searchcommands/reporting_command.py index 39edebc7..60030510 100644 --- a/splunklib/searchcommands/reporting_command.py +++ b/splunklib/searchcommands/reporting_command.py @@ -1,6 +1,4 @@ -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/searchcommands/search_command.py b/splunklib/searchcommands/search_command.py index 2c4f2ab5..3e101630 100644 --- a/splunklib/searchcommands/search_command.py +++ b/splunklib/searchcommands/search_command.py @@ -1,6 +1,4 @@ -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain @@ -1230,8 +1228,8 @@ def dispatch( .. code-block:: python :linenos: - #!/usr/bin/env python from splunklib.searchcommands import dispatch, StreamingCommand, Configuration, Option, validators + @Configuration() class SomeStreamingCommand(StreamingCommand): ... diff --git a/splunklib/searchcommands/streaming_command.py b/splunklib/searchcommands/streaming_command.py index 4a2548d3..26574ed4 100644 --- a/splunklib/searchcommands/streaming_command.py +++ b/splunklib/searchcommands/streaming_command.py @@ -1,6 +1,4 @@ -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/searchcommands/validators.py b/splunklib/searchcommands/validators.py index 17cae428..80fbfb72 100644 --- a/splunklib/searchcommands/validators.py +++ b/splunklib/searchcommands/validators.py @@ -1,6 +1,4 @@ -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/splunklib/utils.py b/splunklib/utils.py index 9b1631de..c4ae0f91 100644 --- a/splunklib/utils.py +++ b/splunklib/utils.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_app.py b/tests/integration/test_app.py index 85b5c8d0..0026cc57 100755 --- a/tests/integration/test_app.py +++ b/tests/integration/test_app.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_binding.py b/tests/integration/test_binding.py index 3e6c4c51..ef16d1c2 100755 --- a/tests/integration/test_binding.py +++ b/tests/integration/test_binding.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_collection.py b/tests/integration/test_collection.py index baa71a4a..dbc8e6ea 100755 --- a/tests/integration/test_collection.py +++ b/tests/integration/test_collection.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_conf.py b/tests/integration/test_conf.py index 248fd53a..6d424494 100755 --- a/tests/integration/test_conf.py +++ b/tests/integration/test_conf.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_event_type.py b/tests/integration/test_event_type.py index cacb9573..7b83e1e6 100755 --- a/tests/integration/test_event_type.py +++ b/tests/integration/test_event_type.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_fired_alert.py b/tests/integration/test_fired_alert.py index 803287e0..49cc2ecc 100755 --- a/tests/integration/test_fired_alert.py +++ b/tests/integration/test_fired_alert.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_index.py b/tests/integration/test_index.py index 5135682a..a452d902 100755 --- a/tests/integration/test_index.py +++ b/tests/integration/test_index.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_input.py b/tests/integration/test_input.py index ad502721..ba99aaf3 100755 --- a/tests/integration/test_input.py +++ b/tests/integration/test_input.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_job.py b/tests/integration/test_job.py index 95c4f872..590bd652 100755 --- a/tests/integration/test_job.py +++ b/tests/integration/test_job.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_kvstore_batch.py b/tests/integration/test_kvstore_batch.py index 5cba9085..1d67ad0a 100755 --- a/tests/integration/test_kvstore_batch.py +++ b/tests/integration/test_kvstore_batch.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_kvstore_conf.py b/tests/integration/test_kvstore_conf.py index 78e2e67d..79f60c51 100755 --- a/tests/integration/test_kvstore_conf.py +++ b/tests/integration/test_kvstore_conf.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright 2011-2020 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_kvstore_data.py b/tests/integration/test_kvstore_data.py index 40c89264..0fa2eef8 100755 --- a/tests/integration/test_kvstore_data.py +++ b/tests/integration/test_kvstore_data.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_logger.py b/tests/integration/test_logger.py index f67d743a..0bd2af27 100755 --- a/tests/integration/test_logger.py +++ b/tests/integration/test_logger.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_macro.py b/tests/integration/test_macro.py index 58061317..e8fd8b63 100755 --- a/tests/integration/test_macro.py +++ b/tests/integration/test_macro.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright 2011-2015 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_message.py b/tests/integration/test_message.py index b4026a00..fea376af 100755 --- a/tests/integration/test_message.py +++ b/tests/integration/test_message.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_modular_input_kinds.py b/tests/integration/test_modular_input_kinds.py index 654a1112..730808e6 100755 --- a/tests/integration/test_modular_input_kinds.py +++ b/tests/integration/test_modular_input_kinds.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_role.py b/tests/integration/test_role.py index 76878720..ed41b983 100755 --- a/tests/integration/test_role.py +++ b/tests/integration/test_role.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_saved_search.py b/tests/integration/test_saved_search.py index 39d3c651..ca6ce894 100755 --- a/tests/integration/test_saved_search.py +++ b/tests/integration/test_saved_search.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_service.py b/tests/integration/test_service.py index 2c94faf9..c46323f6 100755 --- a/tests/integration/test_service.py +++ b/tests/integration/test_service.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_storage_passwords.py b/tests/integration/test_storage_passwords.py index c9fbd42c..2b412c2e 100644 --- a/tests/integration/test_storage_passwords.py +++ b/tests/integration/test_storage_passwords.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/integration/test_user.py b/tests/integration/test_user.py index 94f52529..6ec4212d 100755 --- a/tests/integration/test_user.py +++ b/tests/integration/test_user.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/system/test_apps/eventing_app/bin/eventingcsc.py b/tests/system/test_apps/eventing_app/bin/eventingcsc.py index 94cfee89..4420ad75 100644 --- a/tests/system/test_apps/eventing_app/bin/eventingcsc.py +++ b/tests/system/test_apps/eventing_app/bin/eventingcsc.py @@ -1,7 +1,4 @@ -#!/usr/bin/env python -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/system/test_apps/generating_app/bin/generatingcsc.py b/tests/system/test_apps/generating_app/bin/generatingcsc.py index e4d03f6b..278ad30c 100644 --- a/tests/system/test_apps/generating_app/bin/generatingcsc.py +++ b/tests/system/test_apps/generating_app/bin/generatingcsc.py @@ -1,7 +1,4 @@ -#!/usr/bin/env python -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/system/test_apps/modularinput_app/bin/modularinput.py b/tests/system/test_apps/modularinput_app/bin/modularinput.py index 0b12660d..cf032f22 100755 --- a/tests/system/test_apps/modularinput_app/bin/modularinput.py +++ b/tests/system/test_apps/modularinput_app/bin/modularinput.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python - -# Copyright © 2011-2025 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/system/test_apps/reporting_app/bin/reportingcsc.py b/tests/system/test_apps/reporting_app/bin/reportingcsc.py index f676e691..32eaf262 100644 --- a/tests/system/test_apps/reporting_app/bin/reportingcsc.py +++ b/tests/system/test_apps/reporting_app/bin/reportingcsc.py @@ -1,7 +1,4 @@ -#!/usr/bin/env python -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/system/test_apps/streaming_app/bin/streamingcsc.py b/tests/system/test_apps/streaming_app/bin/streamingcsc.py index d3b3ea18..e1644f82 100644 --- a/tests/system/test_apps/streaming_app/bin/streamingcsc.py +++ b/tests/system/test_apps/streaming_app/bin/streamingcsc.py @@ -1,7 +1,4 @@ -#!/usr/bin/env python -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/system/test_cre_apps.py b/tests/system/test_cre_apps.py index 6632e484..780f5e91 100644 --- a/tests/system/test_cre_apps.py +++ b/tests/system/test_cre_apps.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2025 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/system/test_csc_apps.py b/tests/system/test_csc_apps.py index e269be9d..a4a590e7 100755 --- a/tests/system/test_csc_apps.py +++ b/tests/system/test_csc_apps.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/system/test_modularinput_app.py b/tests/system/test_modularinput_app.py index d408601a..a1794986 100644 --- a/tests/system/test_modularinput_app.py +++ b/tests/system/test_modularinput_app.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2025 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/testlib.py b/tests/testlib.py index 010c4ac2..0e8eef78 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/unit/modularinput/modularinput_testlib.py b/tests/unit/modularinput/modularinput_testlib.py index 5abc1edd..d81942ef 100644 --- a/tests/unit/modularinput/modularinput_testlib.py +++ b/tests/unit/modularinput/modularinput_testlib.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/unit/modularinput/test_event.py b/tests/unit/modularinput/test_event.py index 4fd8e177..31968ea7 100644 --- a/tests/unit/modularinput/test_event.py +++ b/tests/unit/modularinput/test_event.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/unit/modularinput/test_input_definition.py b/tests/unit/modularinput/test_input_definition.py index 7ac617e6..e2c29df7 100644 --- a/tests/unit/modularinput/test_input_definition.py +++ b/tests/unit/modularinput/test_input_definition.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/unit/modularinput/test_scheme.py b/tests/unit/modularinput/test_scheme.py index 6fa3260c..fc37063f 100644 --- a/tests/unit/modularinput/test_scheme.py +++ b/tests/unit/modularinput/test_scheme.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/unit/modularinput/test_validation_definition.py b/tests/unit/modularinput/test_validation_definition.py index 53e8426b..bde82e7b 100644 --- a/tests/unit/modularinput/test_validation_definition.py +++ b/tests/unit/modularinput/test_validation_definition.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/unit/searchcommands/__init__.py b/tests/unit/searchcommands/__init__.py index 1cbd2bb8..ab42e892 100644 --- a/tests/unit/searchcommands/__init__.py +++ b/tests/unit/searchcommands/__init__.py @@ -1,7 +1,4 @@ -#!/usr/bin/env python -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/unit/searchcommands/test_builtin_options.py b/tests/unit/searchcommands/test_builtin_options.py index aa964837..feabdfe1 100644 --- a/tests/unit/searchcommands/test_builtin_options.py +++ b/tests/unit/searchcommands/test_builtin_options.py @@ -1,7 +1,4 @@ -#!/usr/bin/env python -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/unit/searchcommands/test_configuration_settings.py b/tests/unit/searchcommands/test_configuration_settings.py index 9c4f4170..a74249e6 100644 --- a/tests/unit/searchcommands/test_configuration_settings.py +++ b/tests/unit/searchcommands/test_configuration_settings.py @@ -1,7 +1,4 @@ -#!/usr/bin/env python -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/unit/searchcommands/test_decorators.py b/tests/unit/searchcommands/test_decorators.py index 1ac657b7..20578232 100755 --- a/tests/unit/searchcommands/test_decorators.py +++ b/tests/unit/searchcommands/test_decorators.py @@ -1,7 +1,4 @@ -#!/usr/bin/env python -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/unit/searchcommands/test_internals_v1.py b/tests/unit/searchcommands/test_internals_v1.py index 7ac8e50f..8e054180 100755 --- a/tests/unit/searchcommands/test_internals_v1.py +++ b/tests/unit/searchcommands/test_internals_v1.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/unit/searchcommands/test_internals_v2.py b/tests/unit/searchcommands/test_internals_v2.py index 03255c07..c55a7e3f 100755 --- a/tests/unit/searchcommands/test_internals_v2.py +++ b/tests/unit/searchcommands/test_internals_v2.py @@ -1,7 +1,4 @@ -#!/usr/bin/env python -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/unit/searchcommands/test_search_command.py b/tests/unit/searchcommands/test_search_command.py index 6bd28944..e4b8a8b5 100755 --- a/tests/unit/searchcommands/test_search_command.py +++ b/tests/unit/searchcommands/test_search_command.py @@ -1,7 +1,4 @@ -#!/usr/bin/env python -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/unit/searchcommands/test_validators.py b/tests/unit/searchcommands/test_validators.py index 62e6fcc9..98d831d9 100755 --- a/tests/unit/searchcommands/test_validators.py +++ b/tests/unit/searchcommands/test_validators.py @@ -1,7 +1,4 @@ -#!/usr/bin/env python -# coding=utf-8 -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/unit/test_data.py b/tests/unit/test_data.py index 7fb24f96..54883cd4 100755 --- a/tests/unit/test_data.py +++ b/tests/unit/test_data.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/tests/unit/test_utils.py b/tests/unit/test_utils.py index c6f826ed..fb9b870b 100644 --- a/tests/unit/test_utils.py +++ b/tests/unit/test_utils.py @@ -1,6 +1,4 @@ -#!/usr/bin/env python -# -# Copyright © 2011-2025 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/utils/__init__.py b/utils/__init__.py index 9711f0a2..8ca1fbc7 100644 --- a/utils/__init__.py +++ b/utils/__init__.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain diff --git a/utils/cmdopts.py b/utils/cmdopts.py index cd0d08a6..3e731667 100644 --- a/utils/cmdopts.py +++ b/utils/cmdopts.py @@ -1,4 +1,4 @@ -# Copyright © 2011-2024 Splunk, Inc. +# Copyright © 2011-2026 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain From eb2c24733f4a115280a0bf996008cf2e4152416b Mon Sep 17 00:00:00 2001 From: Mateusz Poliwczak Date: Thu, 19 Mar 2026 14:47:53 +0100 Subject: [PATCH 06/12] Fix test_list_with_sort_dir (#703) Splunk orders these case insensitively, thus we have to lower these before doing a compare. --- tests/integration/test_collection.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_collection.py b/tests/integration/test_collection.py index dbc8e6ea..bed2df57 100755 --- a/tests/integration/test_collection.py +++ b/tests/integration/test_collection.py @@ -158,11 +158,11 @@ def test(coll_name): expected_kwargs["sort_key"] = "sid" found_kwargs["sort_key"] = "sid" expected = list( - reversed([ent.name for ent in coll.list(**expected_kwargs)]) + reversed([ent.name.lower() for ent in coll.list(**expected_kwargs)]) ) if len(expected) == 0: logging.debug(f"No entities in collection {coll_name}; skipping test.") - found = [ent.name for ent in coll.list(**found_kwargs)] + found = [ent.name.lower() for ent in coll.list(**found_kwargs)] if expected != found: logging.warning( From 6a1658538e93821311c61874041ef401775a8f9b Mon Sep 17 00:00:00 2001 From: Mateusz Poliwczak Date: Thu, 19 Mar 2026 17:25:46 +0100 Subject: [PATCH 07/12] Support all ML-KEM key exchange algorithms (#702) --- splunklib/binding.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/splunklib/binding.py b/splunklib/binding.py index 78bf7a95..1684a50e 100644 --- a/splunklib/binding.py +++ b/splunklib/binding.py @@ -1762,7 +1762,21 @@ def connect(scheme, host, port): kwargs["cert_file"] = cert_file if not verify: - kwargs["context"] = ssl._create_unverified_context() # nosemgrep + ctx = ssl._create_unverified_context() # nosemgrep + # Support all ML-KEM key exchange algorithms, by default OpenSSL only + # includes the X25519MLKEM768 from all of the below listed MLKEM key + # exchanges. + # + # set_groups method is only available with Python 3.15, but Splunk comes + # with patched python that includes set_groups on 3.9 and 3.13, thus we + # check for the existence of set_groups, not the python version. + if hasattr(ctx, "set_groups"): + ctx.set_groups( # pyright: ignore[reportUnknownMemberType, reportAttributeAccessIssue] + "X25519MLKEM768:SecP256r1MLKEM768:SecP384r1MLKEM1024:" + + "MLKEM512:MLKEM768:MLKEM1024:" + + "X25519:secp256r1:X448:secp384r1:secp521r1:ffdhe2048:ffdhe3072" + ) + kwargs["context"] = ctx elif context: # verify is True in elif branch and context is not None kwargs["context"] = context From f7b41fe918045a827abe7258e5e5fb8700842d77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20J=C4=99drecki?= Date: Thu, 26 Mar 2026 14:32:14 +0100 Subject: [PATCH 08/12] Implement a dummy `deprecated()` when ran on Python pre-3.13 (#695) --- docker-compose.yml | 3 ++- splunklib/client.py | 45 +++++++++++++++++++++++++++------------------ 2 files changed, 29 insertions(+), 19 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 3160978a..bfc3873a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,7 @@ services: splunk: image: "splunk/splunk:${SPLUNK_VERSION}" container_name: splunk + platform: linux/amd64 environment: - SPLUNK_START_ARGS=--accept-license - SPLUNK_GENERAL_TERMS=--accept-sgt-current-at-splunk-com @@ -13,7 +14,7 @@ services: - "8088:8088" - "8089:8089" healthcheck: - test: ['CMD', 'curl', '-f', 'http://localhost:8000'] + test: ["CMD", "curl", "-f", "http://localhost:8000"] interval: 5s timeout: 5s retries: 20 diff --git a/splunklib/client.py b/splunklib/client.py index 6e9ae009..8e745442 100644 --- a/splunklib/client.py +++ b/splunklib/client.py @@ -11,19 +11,6 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -# -# The purpose of this module is to provide a friendlier domain interface to -# various Splunk endpoints. The approach here is to leverage the binding -# layer to capture endpoint context and provide objects and methods that -# offer simplified access their corresponding endpoints. The design avoids -# caching resource state. From the perspective of this module, the 'policy' -# for caching resource state belongs in the application or a higher level -# framework, and its the purpose of this module to provide simplified -# access to that resource state. -# -# A side note, the objects below that provide helper methods for updating eg: -# Entity state, are written so that they may be used in a fluent style. -# """The **splunklib.client** module provides a Pythonic interface to the `Splunk REST API `_, @@ -56,10 +43,21 @@ print(my_app['author']) # Or: print(my_app.author) my_app.package() # Creates a compressed package of this application + +The purpose of this module is to provide a friendlier domain interface to +various Splunk endpoints. The approach here is to leverage the binding +layer to capture endpoint context and provide objects and methods that +offer simplified access their corresponding endpoints. The design avoids +caching resource state. From the perspective of this module, the 'policy' +for caching resource state belongs in the application or a higher level +framework, and its the purpose of this module to provide simplified +access to that resource state. + +A side note, the objects below that provide helper methods for updating eg: +Entity state, are written so that they may be used in a fluent style. """ import contextlib -import datetime import json import logging import re @@ -68,8 +66,15 @@ from time import sleep from urllib import parse +try: + from warnings import deprecated +except ImportError: + + def deprecated(message): # pyright: ignore[reportUnknownParameterType] + return lambda _msg: None + + from . import data -from .data import record from .binding import ( AuthenticationError, Context, @@ -80,17 +85,18 @@ _NoAuthenticationToken, namespace, ) +from .data import record logger = logging.getLogger(__name__) __all__ = [ - "connect", + "AuthenticationError", + "IncomparableException", "NotSupportedError", "OperationError", - "IncomparableException", "Service", + "connect", "namespace", - "AuthenticationError", ] PATH_APPS = "apps/local/" @@ -2007,6 +2013,9 @@ def clear_password(self): return self.content.get("clear_password") @property + @deprecated( + "To improve security, this field now returns an empty string and will be removed from Splunk in a future release.", + ) def encrypted_password(self): return self.content.get("encr_password") From b581ae10d996b65e58e521d5855be6680d2c8f6c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 15:48:25 +0200 Subject: [PATCH 09/12] Bump actions/upload-artifact from 5.0.0 to 7.0.0 (#700) Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5.0.0 to 7.0.0. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/330a01c490aca151604b8cf639adc76d48f6c5d4...bbbca2ddaa5d8feaa63e36b76fdaad77386f024f) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 46bc07c6..5514b8d8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: - name: Generate API reference run: make -C ./docs html - name: Upload docs artifact - uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f with: name: python-sdk-docs path: docs/_build/html From e4d76a25d388ab4f31a77ce0da40eb84f18f057a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20J=C4=99drecki?= Date: Mon, 13 Apr 2026 17:40:37 +0200 Subject: [PATCH 10/12] Add Python scans to Dependabot (#707) --- .github/dependabot.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 2b4c26c1..24aac2bc 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -5,3 +5,7 @@ updates: target-branch: "develop" schedule: interval: "weekly" + - package-ecosystem: "uv" + directory: "/" + schedule: + interval: "weekly" From 854f0d316bb2b6ce01bacb0e83bb7590a6090fd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20J=C4=99drecki?= Date: Tue, 14 Apr 2026 10:10:11 +0200 Subject: [PATCH 11/12] Upstream updates to some workflows (#708) * Upstream updates to some workflows * Grammar fix --- .github/workflows/pre-release.yml | 13 ++++++-- .github/workflows/release.yml | 12 +++++-- .github/workflows/test.yml | 52 ++++++++++++++++++------------- 3 files changed, 50 insertions(+), 27 deletions(-) diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index 9c9bfef8..e6ed2cb1 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -12,16 +12,23 @@ jobs: environment: name: splunk-test-pypi steps: - - name: Checkout source + - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 with: python-version: ${{ env.PYTHON_VERSION }} + cache: pip + - name: Set up uv + uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 + with: + version: 0.11.6 + activate-environment: true + enable-cache: true - name: Install dependencies - run: python -m pip install . --group build + run: SDK_DEPS_GROUP="release" make uv-sync-ci - name: Build packages for distribution - run: python -m build + run: uv build - name: Publish packages to Test PyPI uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5514b8d8..71118be5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,16 +14,22 @@ jobs: environment: name: splunk-pypi steps: - - name: Checkout source + - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 with: python-version: ${{ env.PYTHON_VERSION }} + cache: pip + - name: Set up uv + uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 + with: + activate-environment: true + enable-cache: true - name: Install dependencies - run: python -m pip install . --group release + run: SDK_DEPS_GROUP="release" make uv-sync-ci - name: Build packages for distribution - run: python -m build + run: uv build - name: Publish packages to PyPI uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e - name: Generate API reference diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3de38452..b82a7b39 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,39 +1,49 @@ -name: Python CI -on: [push, workflow_dispatch] +name: Python SDK CI +on: + push: + branches: [master, develop] jobs: - run-test-suite: + test-stage: runs-on: ${{ matrix.os }} strategy: - fail-fast: false matrix: os: [ubuntu-latest] python-version: [3.9] splunk-version: [9.4, latest] include: - # Oldest possible configuration - # Last Ubuntu version with Python 3.7 binaries available - - os: ubuntu-22.04 - python-version: 3.7 - splunk-version: 9.1 - # Latest possible configuration - os: ubuntu-latest python-version: 3.13 splunk-version: latest steps: - name: Checkout code uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd - - name: Launch Splunk Docker instance - run: SPLUNK_VERSION=${{ matrix.splunk-version }} docker compose up -d - - name: Setup Python ${{ matrix.python-version }} + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 with: python-version: ${{ matrix.python-version }} - - name: (Python 3.7) Install dependencies - if: ${{ matrix.python-version == '3.7' }} - run: python -m pip install python-dotenv pytest - - name: (Python >= 3.9) Install dependencies - if: ${{ matrix.python-version != '3.7' }} - run: python -m pip install . --group test - - name: Run entire test suite - run: python -m pytest ./tests + cache: pip + - name: Set up latest uv + uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 + with: + version: 0.11.6 + activate-environment: true + enable-cache: true + - name: Install Python dependencies + run: SDK_DEPS_GROUP="test" make uv-sync-ci + - name: Launch Splunk Docker instance + run: SPLUNK_VERSION=${{ matrix.splunk-version }} docker compose up -d + - name: Set up `.env` + run: cp .env.template .env + - name: Restore `pytest` cache + if: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/develop' }} + uses: actions/cache@565629816435f6c0b50676926c9b05c254113c0c + with: + path: .pytest_cache + key: pytest-cache-${{ runner.os }}-py${{ matrix.python-version }}-${{ github.ref_name }}-${{ github.sha }} + restore-keys: | + pytest-cache-${{ runner.os }}-py${{ matrix.python-version }}-${{ github.ref_name }}- + - name: Run unit tests + run: make test-unit + - name: Run integration/system tests + run: make test-integration From 2f34471a98642686369488d7710d8ea588862d25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20J=C4=99drecki?= Date: Tue, 14 Apr 2026 15:22:19 +0200 Subject: [PATCH 12/12] Remove fossa scan (#709) --- .github/workflows/fossa.yml | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 .github/workflows/fossa.yml diff --git a/.github/workflows/fossa.yml b/.github/workflows/fossa.yml deleted file mode 100644 index 5ded8d27..00000000 --- a/.github/workflows/fossa.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: Fossa OSS Scan -on: [push] - -jobs: - fossa-scan: - uses: splunk/oss-scanning-public/.github/workflows/oss-scan.yml@main - secrets: inherit