Skip to content

Commit f96b8ad

Browse files
committed
Release 1.6.4
2 parents 6899980 + 6d150ad commit f96b8ad

File tree

8 files changed

+48
-11
lines changed

8 files changed

+48
-11
lines changed

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
# Splunk SDK for Python Changelog
22

3+
## Version 1.6.4
4+
5+
### New features and APIs
6+
7+
Not Applicable
8+
9+
### Minor Changes
10+
11+
* Changed `splunklib/binding.py` Context class' constructor initialization to support default settings for encrypted http communication when creating the HttpLib object that it depends on. This is extracted from the keyword dictionary that is provided for its initializaiton. Encryption defaults to enabled if not specified.
12+
* Changed `splunklib/binding.py` HttpLib class constructor to include the `verify` parameter in order to support default encryption if the default handler is being used. Encryption defaults to enabled if not specified.
13+
* Changed `splunklib/binding.py` `handler` function to include the `verify` parameter in order to support default encryption.
14+
* Changed `splunklib/binding.py` `handler`'s nested `connect` function to create the context in as unverified if specified by the `verify` parameter.
15+
16+
### Bug fixes
17+
18+
Not Applicable
19+
20+
### Documentation
21+
22+
* Changed `examples/searchcommands_app/package/bin/filter.py` FilterCommand.update doc-string from `map` to `update` in order to align with Splunk search changes.
23+
* Changed `examples/searchcommands_app/package/default/searchbnf.conf` [filter-command].example1 from the `map` keyword to the `update` keyword in order to align with Splunk search changes.
24+
* Changed `splunklib/binding.py` Context class' doc-string to include the `verify` parameter and type information related to the new keyword dictionary parameter `verify`.
25+
* Changed `splunklib/binding.py` `handler` function's doc-string to include the `verify` parameter and type information related to the parameter `verify`.
26+
* Changed `splunklib/client.py` `connect` function doc-string to include the `verify` parameter and type information related to the new keyword dictionary parameter `verify`.
27+
* Changed `splunklib/client.py` `Service` Class' doc-string to include the `verify` parameter and type information related to the new keyword dictionary parameter `verify`.
28+
329
## Version 1.6.3
430

531
### New features and APIs

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[![Build Status](https://travis-ci.org/splunk/splunk-sdk-python.svg?branch=master)](https://travis-ci.org/splunk/splunk-sdk-python)
22
# The Splunk Software Development Kit for Python
33

4-
#### Version 1.6.3
4+
#### Version 1.6.4
55

66
The Splunk Software Development Kit (SDK) for Python contains library code and
77
examples designed to enable developers to build applications using Splunk.

examples/searchcommands_app/package/bin/filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class FilterCommand(EventingCommand):
5959
''', validate=Code('eval'))
6060

6161
update = Option(doc='''
62-
**Syntax:** **map=***<statements>*
62+
**Syntax:** **update=***<statements>*
6363
**Description:** Augments or modifies records for which the predicate is True before they are returned.
6464
6565
''', validate=Code('exec'))

examples/searchcommands_app/package/default/searchbnf.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ comment1 = \
3535
of the records produced by the generatetext command.
3636
example1 = \
3737
| generatetext text="Hello world! How the heck are you?" count=6 \
38-
| filter predicate="(long(_serial) & 1) == 0" map="_raw = _raw.replace('world', 'Splunk')"
38+
| filter predicate="(long(_serial) & 1) == 0" update="_raw = _raw.replace('world', 'Splunk')"
3939
category = events
4040
appears-in = 1.5
4141
maintainer = dnoble

examples/searchcommands_app/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ def run(self):
439439
setup(
440440
description='Custom Search Command examples',
441441
name=os.path.basename(project_dir),
442-
version='1.6.3',
442+
version='1.6.4',
443443
author='Splunk, Inc.',
444444
author_email='[email protected]',
445445
url='http://github.com/splunk/splunk-sdk-python',

splunklib/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@
1616

1717
from __future__ import absolute_import
1818
from splunklib.six.moves import map
19-
__version_info__ = (1, 6, 3)
19+
__version_info__ = (1, 6, 4)
2020
__version__ = ".".join(map(str, __version_info__))
21-

splunklib/binding.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,8 @@ class Context(object):
431431
:type port: ``integer``
432432
:param scheme: The scheme for accessing the service (the default is "https").
433433
:type scheme: "https" or "http"
434+
:param verify: Enable (True) or disable (False) SSL verrification for https connections.
435+
:type verify: ``Boolean``
434436
:param sharing: The sharing mode for the namespace (the default is "user").
435437
:type sharing: "global", "system", "app", or "user"
436438
:param owner: The owner context of the namespace (optional, the default is "None").
@@ -463,7 +465,7 @@ class Context(object):
463465
c = binding.Context(cookie="splunkd_8089=...")
464466
"""
465467
def __init__(self, handler=None, **kwargs):
466-
self.http = HttpLib(handler)
468+
self.http = HttpLib(handler, kwargs.get("verify", True))
467469
self.token = kwargs.get("token", _NoAuthenticationToken)
468470
if self.token is None: # In case someone explicitly passes token=None
469471
self.token = _NoAuthenticationToken
@@ -1103,9 +1105,11 @@ class HttpLib(object):
11031105
The response dictionary is returned directly by ``HttpLib``'s methods with
11041106
no further processing. By default, ``HttpLib`` calls the :func:`handler` function
11051107
to get a handler function.
1108+
1109+
If using the default handler, SSL verification can be disabled by passing verify=False.
11061110
"""
1107-
def __init__(self, custom_handler=None):
1108-
self.handler = handler() if custom_handler is None else custom_handler
1111+
def __init__(self, custom_handler=None, verify=True):
1112+
self.handler = handler(verify=verify) if custom_handler is None else custom_handler
11091113
self._cookies = {}
11101114

11111115
def delete(self, url, headers=None, **kwargs):
@@ -1313,7 +1317,7 @@ def readinto(self, byte_array):
13131317
return bytes_read
13141318

13151319

1316-
def handler(key_file=None, cert_file=None, timeout=None):
1320+
def handler(key_file=None, cert_file=None, timeout=None, verify=True):
13171321
"""This class returns an instance of the default HTTP request handler using
13181322
the values you provide.
13191323
@@ -1323,6 +1327,8 @@ def handler(key_file=None, cert_file=None, timeout=None):
13231327
:type cert_file: ``string``
13241328
:param `timeout`: The request time-out period, in seconds (optional).
13251329
:type timeout: ``integer`` or "None"
1330+
:param `verify`: Set to False to disable SSL verification on https connections.
1331+
:type verify: ``Boolean``
13261332
"""
13271333

13281334
def connect(scheme, host, port):
@@ -1335,7 +1341,7 @@ def connect(scheme, host, port):
13351341
if cert_file is not None: kwargs['cert_file'] = cert_file
13361342

13371343
# If running Python 2.7.9+, disable SSL certificate validation
1338-
if sys.version_info >= (2,7,9) and key_file is None and cert_file is None:
1344+
if (sys.version_info >= (2,7,9) and key_file is None and cert_file is None) or not verify:
13391345
kwargs['context'] = ssl._create_unverified_context()
13401346
return six.moves.http_client.HTTPSConnection(host, port, **kwargs)
13411347
raise ValueError("unsupported scheme: %s" % scheme)

splunklib/client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ def connect(**kwargs):
289289
:type port: ``integer``
290290
:param scheme: The scheme for accessing the service (the default is "https").
291291
:type scheme: "https" or "http"
292+
:param verify: Enable (True) or disable (False) SSL verrification for
293+
https connections. (optional, the default is True)
294+
:type verify: ``Boolean``
292295
:param `owner`: The owner context of the namespace (optional).
293296
:type owner: ``string``
294297
:param `app`: The app context of the namespace (optional).
@@ -356,6 +359,9 @@ class Service(_BaseService):
356359
:type port: ``integer``
357360
:param scheme: The scheme for accessing the service (the default is "https").
358361
:type scheme: "https" or "http"
362+
:param verify: Enable (True) or disable (False) SSL verrification for
363+
https connections. (optional, the default is True)
364+
:type verify: ``Boolean``
359365
:param `owner`: The owner context of the namespace (optional; use "-" for wildcard).
360366
:type owner: ``string``
361367
:param `app`: The app context of the namespace (optional; use "-" for wildcard).

0 commit comments

Comments
 (0)