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
6
Merge Requests
6
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
slapos.buildout
Commits
c4dec598
Commit
c4dec598
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
8ca41f42
Changes
2
Hide 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 @
c4dec598
...
...
@@ -247,7 +247,14 @@ Now lets clean up buildout directory:
Creating the signature files:
>>> 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 :
>>> write(sample_buildout, 'buildout.cfg',
...
...
@@ -328,7 +335,13 @@ Now lets clean up buildout directory:
>>> remove('.installed.cfg')
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:
>>> write(sample_buildout, 'buildout.cfg',
...
...
src/zc/buildout/testing.py
View file @
c4dec598
...
...
@@ -389,15 +389,6 @@ def buildoutSetUp(test):
register_teardown(lambda: stop_server(url, thread))
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=''):
"""Returns paths to new executable and to its site-packages.
"""
...
...
@@ -462,7 +453,6 @@ def buildoutSetUp(test):
bdist_egg = bdist_egg,
start_server = start_server,
start_nc = start_nc,
create_signature_file_list = create_signature_file_list,
buildout = os.path.join(sample, 'bin', 'buildout'),
wait_until = wait_until,
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