Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ jobs:
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
Expand All @@ -29,11 +23,7 @@ jobs:
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' }}
- name: Install dependencies
run: python -m pip install . --group test
- name: Run entire test suite
run: python -m pytest ./tests
7 changes: 5 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name = "splunk-sdk"
dynamic = ["version"]
description = "Splunk Software Development Kit for Python"
readme = "README.md"
requires-python = ">=3.7"
requires-python = ">=3.9"
license = { text = "Apache-2.0" }
authors = [{ name = "Splunk, Inc.", email = "devinfo@splunk.com" }]
keywords = ["splunk", "sdk"]
Expand All @@ -29,7 +29,10 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Application Frameworks",
]

dependencies = ["python-dotenv>=0.21.1"]
dependencies = [
"deprecated>=1.2.0",
"python-dotenv>=0.21.1",
]
optional-dependencies = { compat = ["six>=1.17.0"] }

[dependency-groups]
Expand Down
40 changes: 22 additions & 18 deletions splunklib/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTcontents>`_,
Expand Down Expand Up @@ -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
Expand All @@ -68,8 +66,9 @@
from time import sleep
from urllib import parse

from deprecated import deprecated

from . import data
from .data import record
from .binding import (
AuthenticationError,
Context,
Expand All @@ -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/"
Expand Down Expand Up @@ -2007,6 +2007,10 @@ def clear_password(self):
return self.content.get("clear_password")

@property
@deprecated(
version="2.2.0",
reason="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")

Expand Down
Loading
Loading