Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
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
Boxiang Sun
slapos.buildout
Commits
e4837fc4
Commit
e4837fc4
authored
Aug 16, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid importing slapos.libnetworkcache.
Instead use provided system level tools to generate keys.
parent
262a4fd5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
src/zc/buildout/networkcache.txt
src/zc/buildout/networkcache.txt
+15
-2
src/zc/buildout/testing.py
src/zc/buildout/testing.py
+0
-10
No files found.
src/zc/buildout/networkcache.txt
View file @
e4837fc4
...
@@ -247,7 +247,14 @@ Now lets clean up buildout directory:
...
@@ -247,7 +247,14 @@ Now lets clean up buildout directory:
Creating the signature files:
Creating the signature files:
>>> signature_data = tmpdir('signature_data')
>>> signature_data = tmpdir('signature_data')
>>> public_certificate_path, private_key_path = create_signature_file_list(signature_data)
>>> keydir = tmpdir('keydir')
>>> public_certificate_path = os.path.join(keydir, 'public.pem')
>>> private_key_path = os.path.join(keydir, 'private.pem')
>>> ignored = system(os.path.join(sample_buildout, 'bin', 'generate-signature-key') + ' --signature-certificate-file=' + public_certificate_path + ' --signature-private-key-file=' + private_key_path)
>>> ls(keydir)
- private.pem
- public.pem
Enable signature, so it should not download any content which is not trusted :
Enable signature, so it should not download any content which is not trusted :
>>> write(sample_buildout, 'buildout.cfg',
>>> write(sample_buildout, 'buildout.cfg',
...
@@ -328,7 +335,13 @@ Now lets clean up buildout directory:
...
@@ -328,7 +335,13 @@ Now lets clean up buildout directory:
>>> remove('.installed.cfg')
>>> remove('.installed.cfg')
Now lets create new signature files:
Now lets create new signature files:
>>> new_public_certificate_path, new_private_key_path = create_signature_file_list(signature_data, 'private2.pem', 'public2.pem')
>>> new_keydir = tmpdir('newkeydir')
>>> new_public_certificate_path = os.path.join(new_keydir, 'public2.pem')
>>> new_private_key_path = os.path.join(new_keydir, 'private2.pem')
>>> ignored = system(os.path.join(sample_buildout, 'bin', 'generate-signature-key') + ' --signature-certificate-file=' + new_public_certificate_path + ' --signature-private-key-file=' + new_private_key_path)
>>> ls(new_keydir)
- private2.pem
- public2.pem
There is a new certificate file, so it should not download the old content:
There is a new certificate file, so it should not download the old content:
>>> write(sample_buildout, 'buildout.cfg',
>>> write(sample_buildout, 'buildout.cfg',
...
...
src/zc/buildout/testing.py
View file @
e4837fc4
...
@@ -389,15 +389,6 @@ def buildoutSetUp(test):
...
@@ -389,15 +389,6 @@ def buildoutSetUp(test):
register_teardown(lambda: stop_server(url, thread))
register_teardown(lambda: stop_server(url, thread))
return url
return url
def create_signature_file_list(path,
private_key_file='private.pem',
certificate_file='public.pem'):
from slapos.signature import createPrivateKeyAndCertificateFile
private_key_file = os.path.join(path, private_key_file)
certificate_file = os.path.join(path, certificate_file)
createPrivateKeyAndCertificateFile(certificate_file, private_key_file)
return certificate_file, private_key_file
def make_py(initialization=''):
def make_py(initialization=''):
"""Returns paths to new executable and to its site-packages.
"""Returns paths to new executable and to its site-packages.
"""
"""
...
@@ -462,7 +453,6 @@ def buildoutSetUp(test):
...
@@ -462,7 +453,6 @@ def buildoutSetUp(test):
bdist_egg = bdist_egg,
bdist_egg = bdist_egg,
start_server = start_server,
start_server = start_server,
start_nc = start_nc,
start_nc = start_nc,
create_signature_file_list = create_signature_file_list,
buildout = os.path.join(sample, 'bin', 'buildout'),
buildout = os.path.join(sample, 'bin', 'buildout'),
wait_until = wait_until,
wait_until = wait_until,
make_py = make_py,
make_py = make_py,
...
...
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