pyvider
2025-10-09
Complete rewrite of the encryption module with modern security practices (random salt per...
58 files · 6,538+ · 819-
Encryption Module Rewrite
33 files changed
encryption.pyUpdated encryption.py (+356/-65 lines)settings.local.jsonUpdated settings.local.json (+16/-2 lines).gitignoreAdded .gitignore (+2 lines).venv_darwin_arm64Added .venv_darwin_arm64 (+1 lines)FOUNDATION_INTEGRATION_PLAN.mdAdded FOUNDATION_INTEGRATION_PLAN.md (+890 lines)coverage.jsonAdded coverage.json (+1 lines)pyproject.tomlUpdated pyproject.toml (+1/-1 lines)__main__.pyUpdated __main__.py (+6/-1 lines)utils.pyUpdated utils.py (+102/-31 lines)__init__.pyAdded __init__.py (+69 lines)apply_resource_change.pyAdded apply_resource_change.py (+23 lines)call_function.pyAdded call_function.py (+23 lines)close_ephemeral_resource.pyAdded close_ephemeral_resource.py (+25 lines)configure_provider.pyAdded configure_provider.py (+23 lines)get_functions.pyAdded get_functions.py (+23 lines)get_metadata.pyAdded get_metadata.py (+23 lines)get_provider_schema.pyAdded get_provider_schema.py (+23 lines)import_resource_state.pyAdded import_resource_state.py (+26 lines)move_resource_state.pyAdded move_resource_state.py (+26 lines)open_ephemeral_resource.pyAdded open_ephemeral_resource.py (+25 lines)plan_resource_change.pyAdded plan_resource_change.py (+24 lines)read_data_source.pyAdded read_data_source.py (+27 lines)read_resource.pyAdded read_resource.py (+22 lines)renew_ephemeral_resource.pyAdded renew_ephemeral_resource.py (+25 lines)stop_provider.pyUpdated stop_provider.py (+23/-1 lines)upgrade_resource_state.pyAdded upgrade_resource_state.py (+25 lines)validate_data_resource_config.pyAdded validate_data_resource_config.py (+26 lines)validate_ephemeral_resource_config.pyAdded validate_ephemeral_resource_config.py (+25 lines)validate_provider_config.pyAdded validate_provider_config.py (+24 lines)validate_resource_config.pyAdded validate_resource_config.py (+27 lines)context.pyUpdated context.py (+1/-1 lines)lifecycle.pyUpdated lifecycle.py (+2/-2 lines)uv.lockUpdated uv.lock (+2233/-602 lines)
- Rewrote
src/pyvider/common/encryption.pyfrom a simple module-level function approach to a fullEncryptionManagerclass decouple internal1 file
encryption.py
- New encryption format:
[1 byte: version][16 bytes: salt][12 bytes: nonce][N bytes: ciphertext+tag]baseline errata1 file
encryption.py
- Random salt per encryption operation (prevents rainbow table attacks) replacing the static salt approach
decouple
internal
1 file
encryption.py
- Thread-safe key caching using
threading.Lockinstead of global mutable_ENCRYPTION_KEYbaseline internal1 file
encryption.py
- Added version byte (0x01) for future algorithm flexibility
baseline
internal
1 file
encryption.py
- Added custom
EncryptionErrorexception class instantiate internal1 file
encryption.py
- Replaced
FrameworkConfigurationErrorwithConfigurationErrorfrom provide.foundation decouple internal1 file
encryption.py
- Added comprehensive error messages as module-level constants
instantiate
internal
1 file
encryption.py
- Added structured logging throughout encryption operations
instantiate
behavioral
1 file
encryption.py
Foundation Logger Initialization
2 files changed
__init__.pyChanges to __init__.py__init__.pyChanges to __init__.py
- Added
logger.debug("Pyvider CLI starting")to CLI entry point to trigger foundation logging auto-initialization in CLI mode instantiate behavioral2 files
__init__.py__init__.py
Observability Metrics
25 files changed
metrics.pyAdded metrics.py (+147 lines)test_metrics.pyAdded test_metrics.py (+358 lines)test_decorators.pyAdded test_decorators.py (+99 lines)test_cli_entrypoints.pyAdded test_cli_entrypoints.py (+64 lines)test_cli_utils.pyAdded test_cli_utils.py (+180 lines)test_install_utils.pyAdded test_install_utils.py (+187 lines)test_attrs_factory.pyAdded test_attrs_factory.py (+89 lines)test_availability.pyAdded test_availability.py (+83 lines)test_base_context.pyAdded test_base_context.py (+64 lines)test_encryption_unit.pyUpdated test_encryption_unit.py (+131/-109 lines)test_launch_context.pyAdded test_launch_context.py (+163 lines)test_launch_context_extra.pyAdded test_launch_context_extra.py (+86 lines)test_context_package.pyAdded test_context_package.py (+14 lines)test_utils.pyAdded test_utils.py (+65 lines)test_private_state_encryption.pyUpdated test_private_state_encryption.py (+5/-4 lines)__init__.pyAdded __init__.py (+1 lines)test_handler_metrics.pyAdded test_handler_metrics.py (+194 lines)test_service.pyAdded test_service.py (+104 lines)test_exceptions.pyAdded test_exceptions.py (+34 lines)test_lifecycle.pyAdded test_lifecycle.py (+38 lines)test_resource_context.pyAdded test_resource_context.py (+40 lines)test_resource_protocol.pyAdded test_resource_protocol.py (+34 lines)test_exceptions.pyAdded test_exceptions.py (+56 lines)test_handler.pyAdded test_handler.py (+98 lines)test_version.pyAdded test_version.py (+36 lines)