Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Hardik Juneja
erp5
Commits
ab87d7b1
Commit
ab87d7b1
authored
Oct 10, 2012
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use openssl from the PATH and do not use tool property
parent
7eb2610a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
28 deletions
+12
-28
product/ERP5/Tool/CertificateAuthorityTool.py
product/ERP5/Tool/CertificateAuthorityTool.py
+12
-17
product/ERP5/Tool/IntrospectionTool.py
product/ERP5/Tool/IntrospectionTool.py
+0
-2
product/ERP5/tests/testCertificateAuthorityTool.py
product/ERP5/tests/testCertificateAuthorityTool.py
+0
-2
product/ERP5/www/CertificateAuthorityTool_editPropertyList.zpt
...ct/ERP5/www/CertificateAuthorityTool_editPropertyList.zpt
+0
-7
No files found.
product/ERP5/Tool/CertificateAuthorityTool.py
View file @
ab87d7b1
...
@@ -48,6 +48,15 @@ def popenCommunicate(command_list, input=None, **kwargs):
...
@@ -48,6 +48,15 @@ def popenCommunicate(command_list, input=None, **kwargs):
command_list
,
result
))
command_list
,
result
))
return
result
return
result
def
binary_search
(
binary
):
env_path_list
=
[
p
for
p
in
os
.
getenv
(
'PATH'
,
''
).
split
(
os
.
pathsep
)
if
os
.
path
.
isdir
(
p
)]
mode
=
os
.
R_OK
|
os
.
X_OK
for
path
in
env_path_list
:
pathbin
=
os
.
path
.
join
(
path
,
binary
)
if
os
.
access
(
pathbin
,
mode
)
==
1
:
return
pathbin
class
CertificateAuthorityBusy
(
Exception
):
class
CertificateAuthorityBusy
(
Exception
):
"""Exception raised when certificate authority is busy"""
"""Exception raised when certificate authority is busy"""
pass
pass
...
@@ -71,7 +80,7 @@ class CertificateAuthorityTool(BaseTool):
...
@@ -71,7 +80,7 @@ class CertificateAuthorityTool(BaseTool):
isIndexable
=
0
isIndexable
=
0
certificate_authority_path
=
os
.
environ
.
get
(
'CA_PATH'
,
''
)
certificate_authority_path
=
os
.
environ
.
get
(
'CA_PATH'
,
''
)
openssl_binary
=
os
.
environ
.
get
(
'OPENSSL_BINARY'
,
'
'
)
openssl_binary
=
binary_search
(
'openssl
'
)
manage_options
=
(({
'label'
:
'Edit'
,
manage_options
=
(({
'label'
:
'Edit'
,
'action'
:
'manage_editCertificateAuthorityToolForm'
,},
'action'
:
'manage_editCertificateAuthorityToolForm'
,},
...
@@ -83,11 +92,6 @@ class CertificateAuthorityTool(BaseTool):
...
@@ -83,11 +92,6 @@ class CertificateAuthorityTool(BaseTool):
'mode'
:
'w'
,
'mode'
:
'w'
,
'label'
:
'Absolute path to certificate authority'
,
'label'
:
'Absolute path to certificate authority'
,
},
},
{
'id'
:
'openssl_binary'
,
'type'
:
'string'
,
'mode'
:
'w'
,
'label'
:
'Absolute path to OpenSSL binary'
},
)
)
)
)
...
@@ -118,11 +122,7 @@ class CertificateAuthorityTool(BaseTool):
...
@@ -118,11 +122,7 @@ class CertificateAuthorityTool(BaseTool):
raise
CertificateAuthorityDamaged
(
'Path to Certificate Authority %r is '
raise
CertificateAuthorityDamaged
(
'Path to Certificate Authority %r is '
'wrong'
%
self
.
certificate_authority_path
)
'wrong'
%
self
.
certificate_authority_path
)
if
not
self
.
openssl_binary
:
if
not
self
.
openssl_binary
:
raise
CertificateAuthorityDamaged
(
'OpenSSL binary path is not '
raise
CertificateAuthorityDamaged
(
'OpenSSL binary was not found!'
)
'configured'
%
self
.
certificate_authority_path
)
if
not
os
.
path
.
isfile
(
self
.
openssl_binary
):
raise
CertificateAuthorityDamaged
(
'OpenSSL binary %r does not exists'
%
self
.
openssl_binary
)
self
.
serial
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
'serial'
)
self
.
serial
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
'serial'
)
self
.
crl
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
'crlnumber'
)
self
.
crl
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
'crlnumber'
)
self
.
index
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
'index.txt'
)
self
.
index
=
os
.
path
.
join
(
self
.
certificate_authority_path
,
'index.txt'
)
...
@@ -159,7 +159,7 @@ class CertificateAuthorityTool(BaseTool):
...
@@ -159,7 +159,7 @@ class CertificateAuthorityTool(BaseTool):
security
.
declareProtected
(
Permissions
.
ManageProperties
,
security
.
declareProtected
(
Permissions
.
ManageProperties
,
'manage_editCertificateAuthorityTool'
)
'manage_editCertificateAuthorityTool'
)
def
manage_editCertificateAuthorityTool
(
self
,
certificate_authority_path
,
def
manage_editCertificateAuthorityTool
(
self
,
certificate_authority_path
,
openssl_binary
,
RESPONSE
=
None
):
RESPONSE
=
None
):
"""Edit the object"""
"""Edit the object"""
error_message
=
''
error_message
=
''
...
@@ -168,11 +168,6 @@ class CertificateAuthorityTool(BaseTool):
...
@@ -168,11 +168,6 @@ class CertificateAuthorityTool(BaseTool):
else
:
else
:
self
.
certificate_authority_path
=
certificate_authority_path
self
.
certificate_authority_path
=
certificate_authority_path
if
openssl_binary
==
''
or
openssl_binary
is
None
:
error_message
+=
'Invalid OpenSSL binary'
else
:
self
.
openssl_binary
=
openssl_binary
#Redirect
#Redirect
if
RESPONSE
is
not
None
:
if
RESPONSE
is
not
None
:
if
error_message
!=
''
:
if
error_message
!=
''
:
...
...
product/ERP5/Tool/IntrospectionTool.py
View file @
ab87d7b1
...
@@ -396,8 +396,6 @@ class IntrospectionTool(LogMixin, BaseTool):
...
@@ -396,8 +396,6 @@ class IntrospectionTool(LogMixin, BaseTool):
if
certificate_authority
is
not
None
:
if
certificate_authority
is
not
None
:
collect_information_by_property
(
certificate_authority
,
collect_information_by_property
(
certificate_authority
,
'certificate_authority_path'
)
'certificate_authority_path'
)
collect_information_by_property
(
certificate_authority
,
'openssl_binary'
)
return
connection_dict
return
connection_dict
security
.
declareProtected
(
Permissions
.
ManagePortal
,
security
.
declareProtected
(
Permissions
.
ManagePortal
,
...
...
product/ERP5/tests/testCertificateAuthorityTool.py
View file @
ab87d7b1
...
@@ -41,8 +41,6 @@ class TestCertificateAuthority(ERP5TypeTestCase):
...
@@ -41,8 +41,6 @@ class TestCertificateAuthority(ERP5TypeTestCase):
def
afterSetUp
(
self
):
def
afterSetUp
(
self
):
self
.
portal
.
portal_certificate_authority
.
certificate_authority_path
=
\
self
.
portal
.
portal_certificate_authority
.
certificate_authority_path
=
\
os
.
environ
[
'TEST_CA_PATH'
]
os
.
environ
[
'TEST_CA_PATH'
]
self
.
portal
.
portal_certificate_authority
.
openssl_binary
=
\
os
.
environ
[
'OPENSSL_BINARY'
]
def
getBusinessTemplateList
(
self
):
def
getBusinessTemplateList
(
self
):
return
(
'erp5_base'
,
'erp5_certificate_authority'
)
return
(
'erp5_base'
,
'erp5_certificate_authority'
)
...
...
product/ERP5/www/CertificateAuthorityTool_editPropertyList.zpt
View file @
ab87d7b1
...
@@ -17,13 +17,6 @@
...
@@ -17,13 +17,6 @@
tal:attributes="value certificate_authority_path;" />
tal:attributes="value certificate_authority_path;" />
</td>
</td>
</tr>
</tr>
<tr>
<td>Absolute path to OpenSSL binary</td>
<td>
<input type="text" name="openssl_binary" value=""
tal:attributes="value openssl_binary;" />
</td>
</tr>
<tr>
<tr>
<td colspan="2">
<td colspan="2">
<input type="submit" value="save"/>
<input type="submit" value="save"/>
...
...
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