Skip to content

refactor!: remove implicit audit logging from ObjectStore#33

Merged
ArthurTonial merged 6 commits intomainfrom
remove-implicit-auditlog
Mar 31, 2026
Merged

refactor!: remove implicit audit logging from ObjectStore#33
ArthurTonial merged 6 commits intomainfrom
remove-implicit-auditlog

Conversation

@ArthurTonial
Copy link
Copy Markdown
Member

@ArthurTonial ArthurTonial commented Mar 31, 2026

Description

This PR removes implicit audit logging from the ObjectStore module. Previously, all object store operations (upload, download, delete, list, etc.) automatically logged audit events.

Key Changes:

  • Removed all implicit audit log calls from ObjectStore operations
  • Removed audit log client initialization and helper methods
  • Updated tests to remove audit client mocking

Related Issue

Closes #<issue_number>

(Link to the GitHub issue this PR addresses)

Type of Change

  • 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. Run the objectstore unit tests: uv run pytest tests/objectstore/unit/ -v
  2. Verify all 44 tests pass successfully
  3. Confirm no audit log references remain in the objectstore module code
  4. Expected result: Clean test output with no audit-related errors

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

What breaks

  • Implicit audit logging is removed: ObjectStore operations no longer automatically log audit events
  • Applications that relied on implicit audit logging will no longer have audit logs for object store operations

Migration path for users

Users who need audit logging must now implement it explicitly:

from sap_cloud_sdk.objectstore import create_client
from sap_cloud_sdk.core.auditlog import create_client as create_audit_client, DataModificationEvent

# Create clients
store_client = create_client("my-instance")
audit_client = create_audit_client()

# Upload with explicit audit logging
store_client.put_object_from_bytes("file.txt", b"data", "text/plain")
audit_client.log(DataModificationEvent(
    object_type="s3-object",
    object_id={"bucket": "my-bucket", "key": "file.txt"},
    # ... other audit event details
))

Additional Notes

Files changed:

  • src/sap_cloud_sdk/objectstore/_s3.py - Removed audit log imports, client, helper methods, and all audit log calls
  • tests/objectstore/unit/test_s3_client.py - Removed audit client mocking from all tests

@ArthurTonial ArthurTonial requested a review from a team as a code owner March 31, 2026 14:19
Copy link
Copy Markdown
Contributor

@LucasAlvesSoares LucasAlvesSoares left a comment

Choose a reason for hiding this comment

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

img

@ArthurTonial ArthurTonial merged commit 7b66f64 into main Mar 31, 2026
10 checks passed
@ArthurTonial ArthurTonial deleted the remove-implicit-auditlog branch March 31, 2026 16:09
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