Implement governed encryption lifecycle

This commit is contained in:
2026-08-01 20:57:27 +02:00
parent c78deab5b5
commit 858c41d5ad
14 changed files with 3667 additions and 111 deletions
+17 -20
View File
@@ -2,37 +2,34 @@ from __future__ import annotations
import unittest
from govoplan_encryption.backend.manifest import (
ADMIN_SCOPE,
RECOVERY_SCOPE,
USE_SCOPE,
get_manifest,
from govoplan_core.core.encryption import (
CAPABILITY_ENCRYPTION_CONTENT_PROTECTION,
CAPABILITY_ENCRYPTION_DISABLE_PREFLIGHT,
CAPABILITY_ENCRYPTION_KEY_VAULT,
CAPABILITY_ENCRYPTION_RECOVERY,
)
from govoplan_encryption.backend.manifest import get_manifest
class EncryptionManifestTests(unittest.TestCase):
def test_manifest_is_an_optional_contract_only_seed(self) -> None:
def test_manifest_exposes_headless_governed_capabilities(self) -> None:
manifest = get_manifest()
self.assertEqual(manifest.id, "encryption")
self.assertEqual(manifest.dependencies, ())
self.assertIn("access", manifest.optional_dependencies)
self.assertEqual("encryption", manifest.id)
self.assertEqual((), manifest.dependencies)
self.assertEqual(
{permission.scope for permission in manifest.permissions},
{USE_SCOPE, ADMIN_SCOPE, RECOVERY_SCOPE},
)
self.assertEqual(
{provider.name for provider in manifest.provides_interfaces},
{
"encryption.key_vault",
"encryption.content_protection",
"encryption.recovery_ceremony",
"encryption.disable_preflight",
CAPABILITY_ENCRYPTION_KEY_VAULT,
CAPABILITY_ENCRYPTION_CONTENT_PROTECTION,
CAPABILITY_ENCRYPTION_RECOVERY,
CAPABILITY_ENCRYPTION_DISABLE_PREFLIGHT,
},
set(manifest.capability_factories),
)
self.assertIsNone(manifest.route_factory)
self.assertIsNone(manifest.migration_spec)
self.assertIsNotNone(manifest.route_factory)
self.assertIsNotNone(manifest.migration_spec)
self.assertIsNone(manifest.frontend)
self.assertEqual("vertical_slice", manifest.architecture.maturity)
if __name__ == "__main__":