Skip to content

Commit 05ebc37

Browse files
committed
Deprecate encr_password
1 parent f1b5dc0 commit 05ebc37

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

splunklib/client.py

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,6 @@
1111
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
1212
# License for the specific language governing permissions and limitations
1313
# under the License.
14-
#
15-
# The purpose of this module is to provide a friendlier domain interface to
16-
# various Splunk endpoints. The approach here is to leverage the binding
17-
# layer to capture endpoint context and provide objects and methods that
18-
# offer simplified access their corresponding endpoints. The design avoids
19-
# caching resource state. From the perspective of this module, the 'policy'
20-
# for caching resource state belongs in the application or a higher level
21-
# framework, and its the purpose of this module to provide simplified
22-
# access to that resource state.
23-
#
24-
# A side note, the objects below that provide helper methods for updating eg:
25-
# Entity state, are written so that they may be used in a fluent style.
26-
#
2714

2815
"""The **splunklib.client** module provides a Pythonic interface to the
2916
`Splunk REST API <http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTcontents>`_,
@@ -56,6 +43,18 @@
5643
5744
print(my_app['author']) # Or: print(my_app.author)
5845
my_app.package() # Creates a compressed package of this application
46+
47+
The purpose of this module is to provide a friendlier domain interface to
48+
various Splunk endpoints. The approach here is to leverage the binding
49+
layer to capture endpoint context and provide objects and methods that
50+
offer simplified access their corresponding endpoints. The design avoids
51+
caching resource state. From the perspective of this module, the 'policy'
52+
for caching resource state belongs in the application or a higher level
53+
framework, and its the purpose of this module to provide simplified
54+
access to that resource state.
55+
56+
A side note, the objects below that provide helper methods for updating eg:
57+
Entity state, are written so that they may be used in a fluent style.
5958
"""
6059

6160
import contextlib
@@ -64,12 +63,12 @@
6463
import logging
6564
import re
6665
import socket
67-
from datetime import datetime, timedelta
66+
from datetime import timedelta
6867
from time import sleep
6968
from urllib import parse
69+
from warnings import deprecated
7070

7171
from . import data
72-
from .data import record
7372
from .binding import (
7473
AuthenticationError,
7574
Context,
@@ -80,17 +79,18 @@
8079
_NoAuthenticationToken,
8180
namespace,
8281
)
82+
from .data import record
8383

8484
logger = logging.getLogger(__name__)
8585

8686
__all__ = [
87-
"connect",
87+
"AuthenticationError",
88+
"IncomparableException",
8889
"NotSupportedError",
8990
"OperationError",
90-
"IncomparableException",
9191
"Service",
92+
"connect",
9293
"namespace",
93-
"AuthenticationError",
9494
]
9595

9696
PATH_APPS = "apps/local/"
@@ -2007,6 +2007,10 @@ def clear_password(self):
20072007
return self.content.get("clear_password")
20082008

20092009
@property
2010+
@deprecated(
2011+
"To improve security, this field now returns an empty \
2012+
string and will be removed from Splunk in a future release."
2013+
)
20102014
def encrypted_password(self):
20112015
return self.content.get("encr_password")
20122016

0 commit comments

Comments
 (0)