Skip to content

Commit f5e5fae

Browse files
committed
Change SHA-1 to SHA-256 hashing algorithm for authentication (#7)
* Start using SHA256 for SSO authentication * Remove anyjson from dependencies to fix use_2to3 deprecation error in CircleCI
1 parent 6bf9036 commit f5e5fae

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

elastic_site_search/client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import time
55
import hashlib
66

7-
import anyjson
7+
import json
88
from six.moves.urllib_parse import urlunparse, urlencode
99

1010
try:
@@ -238,7 +238,7 @@ def _request(self, method, path, params={}, data={}):
238238
if query:
239239
full_path += '?' + query
240240

241-
body = anyjson.serialize(data) if data else ''
241+
body = json.dumps(data) if data else ''
242242

243243
connection = httplib.HTTPConnection(self.__host)
244244
connection.request(method, full_path, body, headers)
@@ -248,7 +248,7 @@ def _request(self, method, path, params={}, data={}):
248248
if (response.status // 100 == 2):
249249
if response.body:
250250
try:
251-
response.body = anyjson.deserialize(response.body.decode('utf-8'))
251+
response.body = json.loads(response.body.decode('utf-8'))
252252
except ValueError as e:
253253
raise InvalidResponseFromServer('The JSON response could not be parsed: %s.\n%s' % (e, response.body))
254254
ret = {'status': response.status, 'body':response.body }

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
anyjson==0.3.3
21
six==1.12.0

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
author_email = 'support@elastic.co',
2525
url = 'https://github.com/elastic/site-search-python',
2626
packages = find_packages(exclude=['tests', 'fixtures']),
27-
install_requires = ["anyjson", "six"],
27+
install_requires = ["six"],
2828
tests_require=['nose', 'vcrpy', 'mock', 'unittest2'],
2929
test_suite='nose.collector',
3030
classifiers = [

0 commit comments

Comments
 (0)