Hello community, here is the log from the commit of package python-castellan for openSUSE:Factory checked in at 2018-10-09 15:53:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-castellan (Old) and /work/SRC/openSUSE:Factory/.python-castellan.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-castellan" Tue Oct 9 15:53:40 2018 rev:7 rq:640677 version:0.19.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-castellan/python-castellan.changes 2018-09-07 15:36:56.186695799 +0200 +++ /work/SRC/openSUSE:Factory/.python-castellan.new/python-castellan.changes 2018-10-09 15:53:40.722317479 +0200 @@ -1,0 +2,9 @@ +Tue Sep 11 07:52:14 UTC 2018 - [email protected] + +- update to version 0.19.0 + - Update UPPER_CONSTRAINTS_FILE for stable/rocky + - Update .gitreview for stable/rocky + - import zuul job settings from project-config + - Add code to generate private keys + +------------------------------------------------------------------- Old: ---- castellan-0.18.0.tar.gz New: ---- castellan-0.19.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-castellan.spec ++++++ --- /var/tmp/diff_new_pack.K1Si1t/_old 2018-10-09 15:53:41.114317015 +0200 +++ /var/tmp/diff_new_pack.K1Si1t/_new 2018-10-09 15:53:41.114317015 +0200 @@ -17,13 +17,13 @@ Name: python-castellan -Version: 0.18.0 +Version: 0.19.0 Release: 0 Summary: Generic Key Manager interface for OpenStack License: Apache-2.0 Group: Development/Languages/Python URL: https://launchpad.net/castellan -Source0: https://files.pythonhosted.org/packages/source/c/castellan/castellan-0.18.0.tar.gz +Source0: https://files.pythonhosted.org/packages/source/c/castellan/castellan-0.19.0.tar.gz BuildRequires: openstack-macros BuildRequires: python2-barbicanclient >= 4.5.2 BuildRequires: python2-cryptography >= 2.1 @@ -73,7 +73,7 @@ This package contains the documentation %prep -%autosetup -p1 -n castellan-0.18.0 +%autosetup -p1 -n castellan-0.19.0 %py_req_cleanup sed -i 's/^warning-is-error.*/warning-is-error = 0/g' setup.cfg ++++++ castellan-0.18.0.tar.gz -> castellan-0.19.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/castellan-0.18.0/.zuul.yaml new/castellan-0.19.0/.zuul.yaml --- old/castellan-0.18.0/.zuul.yaml 2018-05-15 06:17:35.000000000 +0200 +++ new/castellan-0.19.0/.zuul.yaml 2018-08-21 22:00:55.000000000 +0200 @@ -59,3 +59,10 @@ - castellan-functional-devstack - openstack-tox-lower-constraints - barbican-simple-crypto-devstack-tempest-castellan-from-git + templates: + - openstack-python-jobs + - openstack-python35-jobs + - release-notes-jobs-python3 + - publish-openstack-docs-pti + - check-requirements + - periodic-stable-jobs diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/castellan-0.18.0/AUTHORS new/castellan-0.19.0/AUTHORS --- old/castellan-0.18.0/AUTHORS 2018-05-15 06:20:30.000000000 +0200 +++ new/castellan-0.19.0/AUTHORS 2018-08-21 22:04:14.000000000 +0200 @@ -1,3 +1,4 @@ +Ade Lee <[email protected]> Akihiro Motoki <[email protected]> Alan Bishop <[email protected]> Andreas Jaeger <[email protected]> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/castellan-0.18.0/ChangeLog new/castellan-0.19.0/ChangeLog --- old/castellan-0.18.0/ChangeLog 2018-05-15 06:20:30.000000000 +0200 +++ new/castellan-0.19.0/ChangeLog 2018-08-21 22:04:14.000000000 +0200 @@ -1,6 +1,14 @@ CHANGES ======= +0.19.0 +------ + +* Add code to generate private keys +* import zuul job settings from project-config +* Update UPPER\_CONSTRAINTS\_FILE for stable/rocky +* Update .gitreview for stable/rocky + 0.18.0 ------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/castellan-0.18.0/PKG-INFO new/castellan-0.19.0/PKG-INFO --- old/castellan-0.18.0/PKG-INFO 2018-05-15 06:20:32.000000000 +0200 +++ new/castellan-0.19.0/PKG-INFO 2018-08-21 22:04:15.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: castellan -Version: 0.18.0 +Version: 0.19.0 Summary: Generic Key Manager interface for OpenStack Home-page: https://docs.openstack.org/castellan/latest/ Author: OpenStack diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/castellan-0.18.0/castellan/key_manager/vault_key_manager.py new/castellan-0.19.0/castellan/key_manager/vault_key_manager.py --- old/castellan-0.18.0/castellan/key_manager/vault_key_manager.py 2018-05-15 06:17:35.000000000 +0200 +++ new/castellan-0.19.0/castellan/key_manager/vault_key_manager.py 2018-08-21 22:00:30.000000000 +0200 @@ -15,6 +15,13 @@ """ import binascii +from cryptography.hazmat.backends import default_backend +from cryptography.hazmat.primitives.asymmetric import rsa +from cryptography.hazmat.primitives.serialization import Encoding +from cryptography.hazmat.primitives.serialization import NoEncryption +from cryptography.hazmat.primitives.serialization import PrivateFormat +from cryptography.hazmat.primitives.serialization import PublicFormat + import os import time import uuid @@ -95,8 +102,53 @@ def create_key_pair(self, context, algorithm, length, expiration=None, name=None): """Creates an asymmetric key pair.""" - raise NotImplementedError( - "VaultKeyManager does not support asymmetric keys") + + # Confirm context is provided, if not raise forbidden + if not context: + msg = _("User is not authorized to use key manager.") + raise exception.Forbidden(msg) + + if algorithm.lower() != 'rsa': + raise NotImplementedError( + "VaultKeyManager only implements rsa keys" + ) + + priv_key = rsa.generate_private_key( + public_exponent=65537, + key_size=length, + backend=default_backend() + ) + + private_key = pri_key.PrivateKey( + 'RSA', + length, + priv_key.private_bytes( + Encoding.PEM, PrivateFormat.PKCS8, NoEncryption() + ) + ) + + private_key_id = uuid.uuid4().hex + private_id = self._store_key_value( + private_key_id, + private_key + ) + + # pub_key = priv_key.public_key() + public_key = pub_key.PublicKey( + 'RSA', + length, + priv_key.public_key().public_bytes( + Encoding.PEM, PublicFormat.SubjectPublicKeyInfo + ) + ) + + public_key_id = uuid.uuid4().hex + public_id = self._store_key_value( + public_key_id, + public_key + ) + + return private_id, public_id def _store_key_value(self, key_id, value): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/castellan-0.18.0/castellan/tests/functional/key_manager/test_vault_key_manager.py new/castellan-0.19.0/castellan/tests/functional/key_manager/test_vault_key_manager.py --- old/castellan-0.18.0/castellan/tests/functional/key_manager/test_vault_key_manager.py 2018-05-15 06:17:35.000000000 +0200 +++ new/castellan-0.19.0/castellan/tests/functional/key_manager/test_vault_key_manager.py 2018-08-21 22:00:30.000000000 +0200 @@ -56,18 +56,21 @@ def tearDown(self): super(VaultKeyManagerTestCase, self).tearDown() - def test_create_key_pair(self): - self.assertRaises(NotImplementedError, - self.key_mgr.create_key_pair, None, None, None) - def test_create_null_context(self): self.assertRaises(exception.Forbidden, self.key_mgr.create_key, None, 'AES', 256) def test_create_key_pair_null_context(self): - self.assertRaises(NotImplementedError, + self.assertRaises(exception.Forbidden, self.key_mgr.create_key_pair, None, 'RSA', 2048) + def test_create_key_pair_bad_algorithm(self): + self.assertRaises( + NotImplementedError, + self.key_mgr.create_key_pair, + self.ctxt, 'DSA', 2048 + ) + def test_delete_null_context(self): key_uuid = self._get_valid_object_uuid( test_key_manager._get_test_symmetric_key()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/castellan-0.18.0/castellan.egg-info/PKG-INFO new/castellan-0.19.0/castellan.egg-info/PKG-INFO --- old/castellan-0.18.0/castellan.egg-info/PKG-INFO 2018-05-15 06:20:30.000000000 +0200 +++ new/castellan-0.19.0/castellan.egg-info/PKG-INFO 2018-08-21 22:04:14.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: castellan -Version: 0.18.0 +Version: 0.19.0 Summary: Generic Key Manager interface for OpenStack Home-page: https://docs.openstack.org/castellan/latest/ Author: OpenStack diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/castellan-0.18.0/castellan.egg-info/pbr.json new/castellan-0.19.0/castellan.egg-info/pbr.json --- old/castellan-0.18.0/castellan.egg-info/pbr.json 2018-05-15 06:20:30.000000000 +0200 +++ new/castellan-0.19.0/castellan.egg-info/pbr.json 2018-08-21 22:04:14.000000000 +0200 @@ -1 +1 @@ -{"git_version": "6336a59", "is_release": true} \ No newline at end of file +{"git_version": "a99da51", "is_release": true} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/castellan-0.18.0/tox.ini new/castellan-0.19.0/tox.ini --- old/castellan-0.18.0/tox.ini 2018-05-15 06:17:35.000000000 +0200 +++ new/castellan-0.19.0/tox.ini 2018-08-21 22:00:55.000000000 +0200 @@ -11,7 +11,7 @@ VIRTUAL_ENV={envdir} OS_TEST_PATH=./castellan/tests/unit deps = - -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=stable/rocky} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = python setup.py testr --slowest --testr-args='{posargs}'
