Skip to content

feat: add DestinationHttpClient to simplify calls to target systems#119

Open
jplbrun wants to merge 3 commits into
mainfrom
feat/special-header-providers
Open

feat: add DestinationHttpClient to simplify calls to target systems#119
jplbrun wants to merge 3 commits into
mainfrom
feat/special-header-providers

Conversation

@jplbrun
Copy link
Copy Markdown
Contributor

@jplbrun jplbrun commented May 13, 2026

Description

Adds DestinationHttpClient, a requests wrapper that makes calling a target system from a destination straightforward. Previously, users had to manually fetch an auth token from destination properties and build the Authorization header themselves, and also manually set the sap-client header for OnPremise destinations. With this change:

dest = client.get_destination("my-destination")
http = DestinationHttpClient(dest)
response = http.get("/api/resource")

The client pre-bakes auth headers from dest.auth_tokens (populated by the v2 API) and SAP ERP headers (sap-client, sap-language) into the session at construction time.

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. Get a destination using the v2 API: dest = client.get_destination("my-destination")
  2. Instantiate the client: http = DestinationHttpClient(dest)
  3. Call the target system: response = http.get("/api/resource")
  4. Verify that headers are sent automatically without manual setup
  5. Run unit tests: uv run pytest tests/destination/unit/test_destination_http_client.py -v

Related Issue

Closes #35

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 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

@jplbrun jplbrun marked this pull request as ready for review May 13, 2026 16:49
@jplbrun jplbrun requested a review from a team as a code owner May 13, 2026 16:49
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.

Provide Special Header Providers from Java SDK for OnPremise Destinations

1 participant