Skip to content

Commit 5e757e5

Browse files
authored
Merge pull request #145 from DevoInc/fix/keep-alive-spaces-bug
Fix/keep alive spaces bug
2 parents f64fd84 + efb2cef commit 5e757e5

File tree

12 files changed

+188
-68
lines changed

12 files changed

+188
-68
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [3.6.4] - 2022-07-21
8+
### Fixed
9+
* Fixed bug when processing keep alive empty tokens
10+
11+
712
## [3.6.3] - 2022-07-12
813
### Fixed
914
* Dependencies updated for `click` and `PyYAML`

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
[![master Build Status](https://travis-ci.com/DevoInc/python-sdk.svg?branch=master)](https://travis-ci.com/DevoInc/python-sdk) [![LICENSE](https://img.shields.io/dub/l/vibe-d.svg)](https://github.com/DevoInc/python-sdk/blob/master/LICENSE)
33

4-
[![wheel](https://img.shields.io/badge/wheel-yes-brightgreen.svg)](https://pypi.org/project/devo-sdk/) [![version](https://img.shields.io/badge/version-3.6.3-blue.svg)](https://pypi.org/project/devo-sdk/) [![python](https://img.shields.io/badge/python-3.5%20%7C%203.6%20%7C%203.7%20%7C%203.8%20%7C%203.9-blue.svg)](https://pypi.org/project/devo-sdk/)
4+
[![wheel](https://img.shields.io/badge/wheel-yes-brightgreen.svg)](https://pypi.org/project/devo-sdk/) [![version](https://img.shields.io/badge/version-3.6.4-blue.svg)](https://pypi.org/project/devo-sdk/) [![python](https://img.shields.io/badge/python-3.5%20%7C%203.6%20%7C%203.7%20%7C%203.8%20%7C%203.9-blue.svg)](https://pypi.org/project/devo-sdk/)
55

66

77
# Devo Python SDK
@@ -69,9 +69,9 @@ To send data with Devo SDK, first choose the required endpoint depending on the
6969
|-------- |--------------------------- |------ |
7070
| USA | us.elb.relay.logtrust.net | 443 |
7171
| Europe | eu.elb.relay.logtrust.net | 443 |
72-
| VDC | es.elb.relay.logtrust.net | 443 |
72+
| Spain | es.elb.relay.logtrust.net | 443 |
7373

74-
You have more information in the official documentation of Devo, [Sending data to Devo](https://docs.devo.com/confluence/ndt/sending-data-to-devo).
74+
You have more information in the official documentation of Devo, [Sending data to Devo](https://docs.devo.com/space/latest/94652410/Sending%20data%20to%20Devo).
7575

7676
##### API
7777
To perform a request with API, first choose the required endpoint depending on the region your are accessing from:
@@ -81,13 +81,14 @@ To perform a request with API, first choose the required endpoint depending on t
8181
| USA | https://apiv2-us.devo.com/search/query |
8282
| Canada | https://apiv2-ca.devo.com/search/query |
8383
| Europe | https://apiv2-eu.devo.com/search/query |
84-
| VDC | https://apiv2-es.devo.com/search/query |
84+
| Spain | https://apiv2-es.devo.com/search/query |
85+
| APAC | https://api-apac.devo.com/search/query |
8586

86-
You have more information in the official documentation of Devo, [REST API](https://docs.devo.com/confluence/ndt/latest/api-reference/query-api) .
87+
You have more information in the official documentation of Devo, [REST API](https://docs.devo.com/space/latest/95128275/Query%20API).
8788

8889
## Credentials
8990
To obtain the access credentials necessary to use this SDK, you must have an account in [DEVO](https://www.devo.com/).<br/>
90-
Check the [security credentials](https://docs.devo.com/confluence/ndt/domain-administration/security-credentials) info for more details.
91+
Check the [security credentials](https://docs.devo.com/space/latest/94763701/Security%20credentials) info for more details.
9192

9293
##### Certificates
9394
You need use a three files (Cert, key and chain) to secure send data to Devo.

devo/__version__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
__description__ = 'Devo Python Library.'
22
__url__ = 'http://www.devo.com'
3-
__version__ = "3.6.3"
3+
__version__ = "3.6.4"
44
__author__ = 'Devo'
55
__author_email__ = 'support@devo.com'
66
__license__ = 'MIT'
7-
__copyright__ = 'Copyright 2021 Devo'
7+
__copyright__ = 'Copyright 2022 Devo'

devo/api/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
from .client import Client, DevoClientException, DEFAULT, TO_STR, \
2-
TO_BYTES, JSON, JSON_SIMPLE, COMPACT_TO_ARRAY, \
3-
SIMPLECOMPACT_TO_ARRAY, SIMPLECOMPACT_TO_OBJ, ClientConfig
1+
from .client import (COMPACT_TO_ARRAY, DEFAULT, JSON, JSON_SIMPLE,
2+
SIMPLECOMPACT_TO_ARRAY, SIMPLECOMPACT_TO_OBJ, TO_BYTES,
3+
TO_STR, Client, ClientConfig, DevoClientException)

devo/api/processors.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ def proc_json():
2626
Return json object processor
2727
:return: json object
2828
"""
29-
return lambda data: json.loads(data if isinstance(data, str)
30-
else data.decode("utf-8"))\
31-
if data else None
29+
return lambda data: json.loads(data
30+
if isinstance(data, str) else data.decode(
31+
"utf-8")) if data and proc_bytes_to_str(
32+
)(data) != '' else None
3233

3334

3435
def proc_json_simple():
@@ -42,22 +43,30 @@ def proc_json_compact_to_array():
4243
"""
4344
:return: json object
4445
"""
45-
return lambda data: proc_json()(data)['object']['d'] if data else None
46+
return lambda data: proc_json()(data)['object']['d'] \
47+
if data and isinstance(
48+
data, bytes) and proc_bytes_to_str()(data) != '' else None
4649

4750

4851
def json_compact_simple_names(data):
49-
return [item for item in sorted(data, key=lambda x: data[x]['index'])]
52+
if isinstance(data, bytes) and proc_bytes_to_str()(data) == '':
53+
return []
54+
else:
55+
return [item for item in sorted(data, key=lambda x: data[x]['index'])]
5056

5157

5258
def proc_json_compact_simple_to_jobj(names=None):
5359
return proc_json_compact_simple_to_array() if not names else \
5460
lambda data: dict(zip(names,
55-
proc_json_compact_simple_to_array()(data))) \
56-
if data else {}
61+
proc_json_compact_simple_to_array()(
62+
data))) if data and isinstance(
63+
data, bytes) and proc_bytes_to_str()(
64+
data) != '' else {}
5765

5866

5967
def proc_json_compact_simple_to_array():
60-
return lambda data: proc_json()(data)['d'] if data else []
68+
return lambda data: proc_json()(data)['d'] if data and isinstance(
69+
data, bytes) and proc_bytes_to_str()(data) != '' else []
6170

6271

6372
def processors():

devo/api/scripts/client_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@click.group(invoke_without_command=True)
1515
@click.option('--version', "-v", is_flag=True, default=False)
1616
def cli(version):
17-
""" Initialize click """
17+
"""Devo API Command-line Interface"""
1818
if version:
1919
pkg_dir = os.path.abspath(os.path.join(
2020
os.path.dirname(__file__), "..", "..",

devo/sender/scripts/sender_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
@click.group(invoke_without_command=True)
2323
@click.option('--version', "-v", is_flag=True, default=False)
2424
def cli(version):
25-
""" Initialize click """
25+
"""Devo Sender Command-line Interface"""
2626
if version:
2727
pkg_dir = os.path.abspath(os.path.join(
2828
os.path.dirname(__file__), "..", "..",

docs/api/api.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ To perform a request with API, first choose the required endpoint depending on t
1111
| USA | https://apiv2-us.devo.com/search/query |
1212
| Canada | https://apiv2-ca.devo.com/search/query |
1313
| Europe | https://apiv2-eu.devo.com/search/query |
14-
| VDC | https://apiv2-es.devo.com/search/query |
14+
| Spain | https://apiv2-es.devo.com/search/query |
15+
| APAC | https://api-apac.devo.com/search/query |
1516

16-
You have more information in the official documentation of Devo, [REST API](https://docs.devo.com/confluence/ndt/api-reference/rest-api) .
17+
You have more information in the official documentation of Devo, [REST API](https://docs.devo.com/space/latest/95128275/Query%20API).
1718

1819
#### Differences in use from version 2 to 3:
1920

docs/sender/sender.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ To send data with Devo SDK, first choose the required endpoint depending on the
2121
|-------- |--------------------------- |------ |
2222
| USA | us.elb.relay.logtrust.net | 443 |
2323
| Europe | eu.elb.relay.logtrust.net | 443 |
24-
| VDC | es.elb.relay.logtrust.net | 443 |
24+
| Spain | es.elb.relay.logtrust.net | 443 |
2525

26-
You have more information in the official documentation of Devo, [Sending data to Devo](https://docs.devo.com/confluence/ndt/sending-data-to-devo).
26+
You have more information in the official documentation of Devo, [Sending data to Devo](https://docs.devo.com/space/latest/94652410/Sending%20data%20to%20Devo).
2727

2828
#### Differences in use from version 2 to 3:
2929

tests/api/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
"""Python library for Devo."""
2-

0 commit comments

Comments
 (0)