Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update test_kms.py to use covercrypt 14.0.0 (not on PyPI yet) #217

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crate/pyo3/python/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cover-crypt>=13.0
cover-crypt>=14.0
maturin==1.4
mypy>=1.8
12 changes: 6 additions & 6 deletions crate/pyo3/python/scripts/test_kms.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ async def asyncSetUp(self) -> None:
(
self.pub_key_uid,
self.priv_key_uid,
) = await self.client.create_cover_crypt_master_key_pair(b'{"version":"V2","last_attribute_value":6,"dimensions":{"Security Level":{"Ordered":{"Protected":{"id":1,"encryption_hint":"Classic","write_status":"EncryptDecrypt"},"Confidential":{"id":2,"encryption_hint":"Hybridized","write_status":"EncryptDecrypt"},"Top Secret":{"id":3,"encryption_hint":"Hybridized","write_status":"EncryptDecrypt"}}},"Department":{"Unordered":{"FIN":{"id":4,"encryption_hint":"Classic","write_status":"EncryptDecrypt"},"MKG":{"id":5,"encryption_hint":"Classic","write_status":"EncryptDecrypt"},"HR":{"id":6,"encryption_hint":"Classic","write_status":"EncryptDecrypt"}}}}}')
) = await self.client.create_cover_crypt_master_key_pair(self.policy.to_bytes())

"""async def test_master_keys(self) -> None:
async def test_master_keys(self) -> None:
# Query public key from KMS
pub_key = await self.client.get_object(self.pub_key_uid)
self.assertEqual(pub_key.object_type(), 'PublicKey')
Expand Down Expand Up @@ -79,7 +79,7 @@ async def asyncSetUp(self) -> None:
self.priv_key_uid,
'my_custom_pub_key',
)
self.assertEqual(custom_pub_key_uid, 'my_custom_pub_key')"""
self.assertEqual(custom_pub_key_uid, 'my_custom_pub_key')

async def test_user_key_generation(self) -> None:
# Generate user key
Expand All @@ -91,9 +91,9 @@ async def test_user_key_generation(self) -> None:
# Query private key from KMS
user_key = await self.client.get_object(user_key_uid)
self.assertEqual(user_key.object_type(), 'PrivateKey')
#self.assertIsInstance(
# UserSecretKey.from_bytes(user_key.key_block()), UserSecretKey
#)
self.assertIsInstance(
UserSecretKey.from_bytes(user_key.key_block()), UserSecretKey
)

# Import custom user key
custom_user_key_uid = await self.client.import_cover_crypt_user_decryption_key(
Expand Down
Loading