Skip to content

Release Python Storages v1.1.0 - #963

Merged
maksimu merged 1 commit into
masterfrom
release/sdk/python/storage/v1.1.0
Jun 4, 2026
Merged

maksimu merged 1 commit into
masterfrom
release/sdk/python/storage/v1.1.0

Conversation

@stas-schaller

@stas-schaller stas-schaller commented Mar 9, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Release branch for v1.1.0: raises the Python floor to 3.9.2 and bundles 13 bug fixes addressing thread safety, crypto hygiene, silent errors, atomic writes, and config-loading edge cases across all encrypted storage backends.

Changes

Bug Fixes

  • Thread safety (KSM-959): added threading.RLock to all 5 backends — prevents data corruption under concurrent use
  • Crypto hygiene (KSM-960): MD5 → SHA-256 for change-detection hashing; Azure AES-GCM nonce fixed 16 → 12 bytes (NIST SP 800-38D compliance)
  • Silent encrypt/decrypt errors (KSM-961, Critical): failures in __encrypt_buffer/__decrypt_buffer now raise instead of silently corrupting storage state
  • delete_all() leaving empty blob (KSM-962): now calls os.remove() on the config file instead of writing an empty encrypted blob
  • State divergence on write failure (KSM-963): __save_config writes to disk before updating self.config — prevents in-memory/on-disk divergence
  • decrypt_config() autosave default (KSM-964): changed from autosave=True to autosave=False — stray calls no longer silently overwrite the encrypted file with plaintext
  • Empty-JSON bootstrap (KSM-965): __load_config check changed from if config: to if config is not None: — a plaintext {} config is now correctly re-encrypted on first load instead of falling into the binary decrypt path
  • AWS Secrets provider silent failures (KSM-966): _get_instance_region raises when all IMDS detection methods fail; read_config raises with the actual AWS error instead of returning an empty string
  • AwsSecretStorage eager load (KSM-967): __init__ now calls __load_config() on construction, matching all peer backends; accepts any valid JSON dict (removed privateKey gate)
  • Non-UTF8 corrupt config (KSM-972): non-UTF8 bytes that are not the \xff\xff blob header now raise "<path> is not a valid encrypted config file" across all three encrypted backends (nfast, AWS KMS, Azure KeyVault) — replaces misleading encoding error messages and bare UnicodeDecodeError/JSONDecodeError escapes
  • __load_config swallows AWS errors (KSM-977, Merges KSM-977: fix AwsSecretStorage.__load_config() silently swallowing AWS errors #1025): the except Exception block now populates err before logging, so construction raises when read_config raises — fixes the KSM-966 × KSM-967 interaction where the exception was logged but never reached the caller
  • Decrypt-path parity (KSM-978, Merges KSM-978: raise on empty __decrypt_buffer result in HsmNfast and AwsKms #1026): HsmNfast and AwsKms now raise "<path> is not a valid encrypted config file" when __decrypt_buffer returns empty — matches Azure's existing behavior; HsmNfast no longer leaks a bare JSONDecodeError, AwsKms no longer silently logs without raising
  • Atomic saves (KSM-979, Merges KSM-979: atomic write for __save_config and create_config_file_if_missing #1027): __save_config and create_config_file_if_missing now write to <path>.tmp then os.replace across all three encrypted file backends — a write failure no longer truncates the existing config to 0 bytes, and an encrypt failure in create_config_file_if_missing no longer leaves a 0-byte stub on disk

Maintenance

  • Raise minimum Python version from 3.6 to 3.9.2
  • Update keeper-secrets-manager-core dependency floor to >=17.2.0
  • Add Python 3.13 classifier; remove 3.6, 3.7, 3.8 classifiers
  • 51 regression tests added across 12 test files

Breaking Changes

Python 3.6, 3.7, and 3.8 are no longer supported. Users on those versions must remain on v1.0.2.

Related Issues

  • KSM-959, KSM-960, KSM-961, KSM-962, KSM-963, KSM-964, KSM-965, KSM-966, KSM-967, KSM-972, KSM-977, KSM-978, KSM-979

@stas-schaller stas-schaller changed the title Release keeper-secrets-manager-storage v1.1.0 Release Python Storages v1.1.0 Mar 9, 2026
@stas-schaller
stas-schaller force-pushed the release/sdk/python/storage/v1.1.0 branch 2 times, most recently from 2638bf6 to f03bc6d Compare March 10, 2026 15:14
@stas-schaller
stas-schaller force-pushed the release/sdk/python/storage/v1.1.0 branch from f03bc6d to 4beeabb Compare March 27, 2026 18:30
@stas-schaller
stas-schaller force-pushed the release/sdk/python/storage/v1.1.0 branch from 4beeabb to ba3e9bb Compare April 9, 2026 19:38
@stas-schaller
stas-schaller force-pushed the release/sdk/python/storage/v1.1.0 branch from ba3e9bb to 40a2862 Compare May 12, 2026 16:14
Comment thread sdk/python/storage/keeper_secrets_manager_storages/setup.py
Comment thread .github/workflows/publish.pypi.sdk.storage.yml Outdated
Comment thread .github/workflows/publish.pypi.sdk.storage.yml Outdated

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Code review skipped — your organization has reached its monthly code review spending cap.

An organization admin can view or raise the cap at claude.ai/admin-settings/claude-code. The cap resets at the start of the next billing period.

Once the cap resets or is raised, push a new commit or reopen this pull request to trigger a review.

@socket-security

socket-security Bot commented May 20, 2026 •

Copy link
Copy Markdown

idimov-keeper
idimov-keeper previously approved these changes May 22, 2026
Bug-fix and hardening release for the storage backends, plus publish
workflow alignment with the GCP/Oracle KMS template.

Fixes:
- KSM-959: add threading.RLock to all storage backends
- KSM-960: replace MD5 with SHA-256 and fix Azure AES-GCM nonce
- KSM-961: make encrypt/decrypt failures raise instead of returning empty
- KSM-962: delete_all() removes backing file instead of writing empty blob
- KSM-963: defer config update until after successful disk write
- KSM-964: flip decrypt_config() default from autosave=True to autosave=False
- KSM-965: use 'is not None' check to avoid treating {} as a decrypt trigger
- KSM-966: propagate AwsConfigProvider region and read errors
- KSM-967: AwsSecretStorage default constructor + json-without-privateKey handling
- KSM-969: lower Python floor 3.10 -> 3.9.2 to match GCP/Oracle storage
- KSM-972: raise a clear exception on a non-UTF8 corrupt config file
- KSM-977: populate err in __load_config so construction raises on AWS errors
- KSM-978: raise on empty __decrypt_buffer result in HsmNfast and AwsKms
- KSM-979: atomic write for __save_config and create_config_file_if_missing

CI:
- align v1.1.0 publish workflow with GCP/Oracle template
- harden publish workflow, pin wheel (CVE-2026-24049), add post-build import check
- bump Manifest CLI to v0.31.0, pin ksm-action SHA (v1.3.0)
@stas-schaller
stas-schaller force-pushed the release/sdk/python/storage/v1.1.0 branch from 338fa98 to 645d278 Compare June 1, 2026 16:55
@maksimu
maksimu merged commit 3ebd332 into master Jun 4, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants