Skip to content

feat(object_storage): add multi-provider client with auto-detection - #350

Draft
jplbrun wants to merge 11 commits into
mainfrom
feat/multi-provider-objectstore
Draft

jplbrun wants to merge 11 commits into
mainfrom
feat/multi-provider-objectstore

Conversation

@jplbrun

@jplbrun jplbrun commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Disclaimer: Do not include SAP-internal or customer-specific information in this PR (e.g. internal system URLs, customer names, tenant IDs, or confidential configurations). This is a public repository.

Description

Adds a new sap_cloud_sdk.object_storage package that provides a single, provider-agnostic client for object storage across Amazon S3/MinIO, Azure Blob Storage, and Google Cloud Storage.

Users call create_client(instance=...) and get back a client satisfying the ObjectStoreClient protocol. The concrete provider is auto-detected from the service binding, so consuming code stays identical regardless of which cloud backs the instance.

Highlights:

  • Unified interface — one ObjectStoreClient protocol (put_object, put_object_from_bytes, put_object_from_file, get_object, delete_object, list_objects, head_object, object_exists) implemented by all three provider backends.
  • Automatic provider detectioncreate_client() infers the provider from the binding keys present in the secret mount / env vars. Detection requires a complete provider signature and errors clearly when keys match zero or multiple providers.
  • Explicit config escape hatch — pass S3Config, AzureConfig, or GcsConfig directly to create_client(config=...) to bypass auto-detection.
  • Config resolution follows the SDK's standard precedence (flat mount → legacy mount → env vars), consistent with the rest of the SDK.
  • Legacy objectstore module is now deprecated — its operations are marked deprecated, constructing the legacy client emits a DeprecationWarning pointing to the new package, and its user guide / README link are updated accordingly. The old module still works for a smooth migration.
  • New runtime dependencies for the Azure and GCS backends (azure-storage-blob, google-cloud-storage), so all three providers work out of the box.

This ports and generalizes the work from #291 into a dedicated multi-provider package.

Related Issue

N/A

Type of Change

Please check the relevant option:

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Code refactoring
  • Dependency update

How to Test

  1. uv sync --all-extras --group dev
  2. Run the unit suite: uv run pytest tests/object_storage/unit -q — covers detection, factory dispatch, per-provider clients, config resolution, validation, the public API surface, and the legacy deprecation warning.
  3. Run the integration suite against real bindings per docs/INTEGRATION_TESTS.md: uv run pytest tests/object_storage/integration -v.
  4. Expected result: all unit tests pass; create_client() returns the correct backend for each provider binding; the legacy objectstore client emits a DeprecationWarning.

Checklist

  • I have read the Contributing Guidelines
  • I have verified that my changes solve the issue
  • I have added/updated automated tests to cover my changes
  • All tests pass locally
  • I have verified that my code follows the Code Guidelines
  • I have updated documentation (if applicable)
  • I have added type hints for all public APIs
  • My code does not contain sensitive information (credentials, tokens, etc.)
  • I have followed Conventional Commits for commit messages

Breaking Changes

None. The new object_storage package is purely additive. The existing objectstore module is deprecated but continues to function;

Additional Notes

None

Comment thread tests/object_storage/unit/test_public_api.py Fixed
@jplbrun jplbrun changed the title Feat/multi provider objectstore feat(object_storage): add multi-provider client (S3, Azure, GCS) with auto-detection Sep 23, 2026
@jplbrun jplbrun changed the title feat(object_storage): add multi-provider client (S3, Azure, GCS) with auto-detection feat(object_storage): add multi-provider client with auto-detection Sep 23, 2026

This branch has not been deployed

No deployments
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.

2 participants