Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caucase
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
caucase
Commits
03da9797
Commit
03da9797
authored
Oct 28, 2019
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass text to json.loads for python3.5 compatibility
parent
98600e06
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+7
-7
caucase/ca.py
caucase/ca.py
+1
-1
caucase/cli.py
caucase/cli.py
+1
-1
caucase/client.py
caucase/client.py
+2
-2
caucase/test.py
caucase/test.py
+2
-2
caucase/wsgi.py
caucase/wsgi.py
+1
-1
No files found.
caucase/ca.py
View file @
03da9797
...
...
@@ -886,7 +886,7 @@ class UserCertificateAuthority(CertificateAuthority):
'<I'
,
read
(
struct
.
calcsize
(
'<I'
)),
)
header
=
json
.
loads
(
read
(
header_len
))
header
=
json
.
loads
(
read
(
header_len
)
.
decode
(
'utf-8'
)
)
if
header
[
'cipher'
][
'name'
]
!=
'aes256_cbc_pkcs7_hmac_10M_sha256'
:
raise
ValueError
(
'Unrecognised symetric cipher'
)
private_key
=
utils
.
load_privatekey
(
key_pem
)
...
...
caucase/cli.py
View file @
03da9797
...
...
@@ -1002,5 +1002,5 @@ def key_id(argv=None):
'<I'
,
backup_file
.
read
(
struct
.
calcsize
(
'<I'
)),
)
for
key_entry
in
json
.
loads
(
backup_file
.
read
(
header_len
))[
'key_list'
]:
for
key_entry
in
json
.
loads
(
backup_file
.
read
(
header_len
)
.
decode
(
'utf-8'
)
)[
'key_list'
]:
print
(
' '
,
key_entry
[
'id'
].
encode
(
'utf-8'
))
caucase/client.py
View file @
03da9797
...
...
@@ -195,7 +195,7 @@ class CaucaseClient(object):
"""
[AUTHENTICATED] Retrieve all pending CSRs.
"""
return
json
.
loads
(
self
.
_https
(
'GET'
,
'/csr'
))
return
json
.
loads
(
self
.
_https
(
'GET'
,
'/csr'
)
.
decode
(
'utf-8'
)
)
def
createCertificateSigningRequest
(
self
,
csr
):
"""
...
...
@@ -241,7 +241,7 @@ class CaucaseClient(object):
key
=
lambda
x
:
x
.
not_valid_before
,
)[
-
1
]
result
=
[]
for
entry
in
json
.
loads
(
self
.
_getCertificate
(
'/ca.crt.json'
)):
for
entry
in
json
.
loads
(
self
.
_getCertificate
(
'/ca.crt.json'
)
.
decode
(
'utf-8'
)
):
try
:
payload
=
utils
.
unwrap
(
entry
,
...
...
caucase/test.py
View file @
03da9797
...
...
@@ -1679,7 +1679,7 @@ class CaucaseTest(unittest.TestCase):
self
.
maxDiff
=
None
self
.
assertEqual
(
status
,
200
)
self
.
assertEqual
(
header_dict
[
'Content-Type'
],
'application/hal+json'
)
self
.
assertEqual
(
json
.
loads
(
body
),
{
self
.
assertEqual
(
json
.
loads
(
body
.
decode
(
'utf-8'
)
),
{
u"_links"
:
{
u"getCAUHAL"
:
{
u"href"
:
HATEOAS_HTTP_PREFIX
+
u"/cau"
,
...
...
@@ -1701,7 +1701,7 @@ class CaucaseTest(unittest.TestCase):
})
self
.
assertEqual
(
status
,
200
)
self
.
assertEqual
(
header_dict
[
'Content-Type'
],
'application/hal+json'
)
self
.
assertEqual
(
json
.
loads
(
body
),
{
self
.
assertEqual
(
json
.
loads
(
body
.
decode
(
'utf-8'
)
),
{
u"_actions"
:
{
u"createCertificate"
:
{
u"href"
:
HATEOAS_HTTPS_PREFIX
+
u"/cau/crt/{+crt_id}"
,
...
...
caucase/wsgi.py
View file @
03da9797
...
...
@@ -670,7 +670,7 @@ class Application(object):
raise
BadRequest
(
b'Bad Content-Type'
)
data
=
self
.
_read
(
environ
)
try
:
return
json
.
loads
(
data
)
return
json
.
loads
(
data
.
decode
(
'utf-8'
)
)
except
ValueError
:
raise
BadRequest
(
b'Invalid json'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment