From 05ebc3778155e04e621c9d85ab077d254ab05681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20J=C4=99drecki?= Date: Mon, 19 Jan 2026 16:25:46 +0100 Subject: [PATCH 1/2] Deprecate encr_password --- splunklib/client.py | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/splunklib/client.py b/splunklib/client.py index 0d69773f8..25cb3d6a4 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,6 +43,18 @@ 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 @@ -64,12 +63,12 @@ import logging import re import socket -from datetime import datetime, timedelta +from datetime import timedelta from time import sleep from urllib import parse +from warnings import deprecated from . import data -from .data import record from .binding import ( AuthenticationError, Context, @@ -80,17 +79,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 +2007,10 @@ 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 4c394c1dce5e3f9b10f628aeeb51a5bd58a05597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20J=C4=99drecki?= Date: Mon, 19 Jan 2026 17:10:09 +0100 Subject: [PATCH 2/2] Fix a datetime import gotcha --- splunklib/client.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/splunklib/client.py b/splunklib/client.py index 25cb3d6a4..73df5f275 100644 --- a/splunklib/client.py +++ b/splunklib/client.py @@ -58,12 +58,11 @@ """ import contextlib -import datetime import json import logging import re import socket -from datetime import timedelta +from datetime import datetime, timedelta from time import sleep from urllib import parse from warnings import deprecated