Skip to content

Commit cbc4ffd

Browse files
Transparent Proxy: Update 008-transparent-proxy.mdx to provide more c… (#2243)
* Transparent Proxy: Update 008-transparent-proxy.mdx to provide more comprehensive information * lint fix * lint fix gh action error --------- Co-authored-by: Roshin Rajan Panackal <[email protected]>
1 parent 57a1c05 commit cbc4ffd

File tree

1 file changed

+67
-36
lines changed

1 file changed

+67
-36
lines changed

docs-java/features/connectivity/008-transparent-proxy.mdx

Lines changed: 67 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
22
id: transparent-proxy
3-
title: Transparent Proxy Destinations
3+
title: Transparent Proxy
44
hide_title: false
55
hide_table_of_contents: false
66
sidebar_label: Transparent Proxy
7-
description: This article explains how to use Transparent Proxy Destinations to connect to systems through the SAP BTP Transparent Proxy.
7+
description: This article explains how to use Transparent Proxy to connect to systems through defined as SAP Destinations.
88
keywords:
99
- sap
1010
- cloud
@@ -22,103 +22,131 @@ keywords:
2222
import Tabs from '@theme/Tabs';
2323
import TabItem from '@theme/TabItem';
2424

25-
The SAP Cloud SDK supports connecting to systems through the [**Transparent Proxy**](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/transparent-proxy-for-kubernetes), which provides enhanced connectivity features and simplified on-premise access in Kubernetes-based environments like Kyma.
25+
The SAP Cloud SDK supports connecting to systems through the [**Transparent Proxy**](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/transparent-proxy-for-kubernetes), which provides enhanced connectivity features and simplified on-premise access in Kubernetes-based environments.
2626
The `TransparentProxyDestination` class enables applications to leverage these capabilities seamlessly.
2727

2828
## Prerequisites
2929

3030
:::info Kubernetes Only
3131

32-
The Transparent Proxy is currently **only available for Kubernetes-based environments** such as Kyma and Gardener.
32+
The Transparent Proxy is currently **only available for Kubernetes-based environments**.
3333

3434
:::
3535

3636
:::caution Installation Required
3737

3838
Before using `TransparentProxyDestination`, ensure that the **Transparent Proxy is installed and configured** in your Kubernetes cluster.
3939
Refer to the [official installation guide](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/installation-47b8844e90be440881838a5d5d9f8a68) for setup instructions.
40+
The Transparent Proxy is available in Kyma environment as a dedicated module.
41+
Refer to [Transparent Proxy in Kyma environment](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/transparent-proxy-in-kyma-environment) for instructions how to add the module.
4042

4143
:::
4244

4345
## Background Information
4446

45-
The **Transparent Proxy** is a connectivity component provided by SAP BTP that acts as an intermediary between your application and target systems.
46-
When using the Transparent Proxy your app performs requests against the Transparent Proxy without explicit authentication.
47-
This relies on the secure network communication provided by Kyma via Istio.
48-
The Transparent Proxy will obtain the relevant destination from the destination service.
49-
It will then use this destination to forward the request to the target system or to the Connectivity Proxy for On-Premise destinations.
50-
Consequently, your app itself does not interact with destination or connectivity service at all.
51-
This means your application pods do not require bindings to these two services.
47+
The **Transparent Proxy** is a SAP BTP Connectivity component that acts as an intermediary between your application and target systems.
48+
The Transparent Proxy simplifies and unifies how your Kubernetes workloads connect to remote systems using SAP BTP destinations.
49+
It provides authentication, principal propagation, SOCKS5 handshake, and easy access to the destination target systems by exposing them as [Kubernetes Services](https://kubernetes.io/docs/concepts/services-networking/service).
50+
51+
The Transparent Proxy obtains relevant destination configuration from the SAP Destination service.
52+
It uses this destination to forward the request to the target system or to the Connectivity Proxy for On-Premise destinations.
53+
Consequently, your app does not interact with SAP Destination service or Connectivity service.
54+
This means your application do not require bindings to these two services, everything is handled by the Transparent Proxy.
5255

5356
## Creating Transparent Proxy Destinations
5457

5558
The `TransparentProxyDestination` class provides two types of builders for different use cases:
5659

57-
### 1. Static Destinations
60+
### 1. Destination
5861

59-
Static destinations connect directly to a specified URL.
60-
They allow setting generic headers but do not support dynamic properties like destination name or fragments.
62+
Allows you to connect to a concrete SAP destination.
63+
Setting generic headers is allowed but dynamic properties like destination name or fragments is not.
64+
As a prerequisite, you have to create a Destination Custom Resource inside the Kubernetes cluster.
65+
For more information how to use the Transparent Proxy, refer to [Using the Transparent Proxy](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/using-transparent-proxy).
6166

6267
```java
6368
TransparentProxyDestination destination = TransparentProxyDestination
64-
.staticDestination("https://my-service.com")
69+
.destination(<destination-custom-resource-name>.<destination-custom-resource-namespace>)
6570
.header("X-Custom-Header", "custom-value")
6671
.property("some-property-key", "some-value")
6772
.build();
6873
```
6974

70-
### 2. Dynamic Destinations
75+
:::info Destination Custom Resource access
76+
`<destination-custom-resource-namespace>` can be omitted if the destination custom resource is created in the same namespace as the application workload.
77+
:::
78+
79+
### 2. Gateway
7180

72-
Dynamic destinations require both URL and destination name.
73-
They support dynamic properties like fragments.
81+
Allows you to connect to arbitrary SAP destinations you have access to.
82+
As a prerequisite, you have to create a Gateway Destination Custom Resource inside the Kubernetes cluster.
83+
For more information how to use the Transparent Proxy for this concrete scenario, refer to [Destination Gateway](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/dynamic-lookup-of-destinations).
7484

7585
```java
7686
TransparentProxyDestination destination = TransparentProxyDestination
77-
.dynamicDestination("my-destination", "https://proxy-gateway.com")
87+
.gateway("my-destination", <destination-custom-resource-name>.<destination-custom-resource-namespace>)
7888
.fragmentName("my-fragment")
7989
.build();
8090
```
8191

8292
## Tenant Configuration
8393

84-
The SAP Cloud SDK will automatically set the current tenant as tenant ID on a **per-request** basis.
94+
The SAP Cloud SDK automatically sets the current tenant as tenant ID on a **per-request** basis.
8595

8696
In case a fixed tenant should be used, you can manually set it as follows:
8797

98+
### Destination
99+
100+
// Using a fixed tenant ID (automatically set by SAP Cloud SDK if not specified)
101+
// alternatively, .tenantSubdomain("..") can be used, but only one of the two options may be set
102+
103+
```java
104+
TransparentProxyDestination destination = TransparentProxyDestination
105+
.destination(<destination-custom-resource-name>.<destination-custom-resource-namespace>)
106+
.tenantId("my-tenant-id")
107+
.build();
108+
```
109+
110+
### Gateway
111+
88112
```java
89-
// Using a fixed tenant ID (automatically set by SDK if not specified)
113+
// Using a fixed tenant ID (automatically set by SAP Cloud SDK if not specified)
90114
// alternatively, .tenantSubdomain("..") can be used, but only one of the two options may be set
91115
TransparentProxyDestination destination = TransparentProxyDestination
92-
.dynamicDestination("my-destination", "https://proxy-gateway.com")
116+
.gateway("my-destination", <destination-custom-resource-name>.<destination-custom-resource-namespace>)
93117
.tenantId("my-tenant-id")
94118
.build();
95119
```
96120

97121
## Authorization Header Configuration
98122

99-
The SAP Cloud SDK will automatically set the current user's authorization token in the `Authorization` header on a **per-request** basis.
123+
The SAP Cloud SDK automatically sets the current user's authorization token in the `Authorization` header on a **per-request** basis.
100124

101125
In case a fixed authorization token should be used, you can manually set it as follows:
102126

127+
### Destination
128+
103129
```java
104-
// Dynamic destination with authorization method
105130
TransparentProxyDestination destination = TransparentProxyDestination
106-
.dynamicDestination("my-destination", "https://proxy-gateway.com")
107-
.authorization("Bearer my-fixed-token")
131+
.destination(<destination-custom-resource-name>.<destination-custom-resource-namespace>)
132+
.authorization("Bearer my-token")
108133
.build();
134+
```
135+
136+
### Gateway
109137

110-
// Static destination with authorization method
138+
```java
111139
TransparentProxyDestination destination = TransparentProxyDestination
112-
.staticDestination("https://my-service.com")
113-
.authorization("Bearer my-fixed-token")
140+
.gateway("my-destination", <destination-custom-resource-name>.<destination-custom-resource-namespace>)
141+
.authorization("Bearer my-token")
114142
.build();
115143
```
116144

117145
**Note**: When you manually set authorization, it will override the SAP Cloud SDK automatic token handling.
118146

119147
## Migration from Traditional Destinations
120148

121-
When migrating from traditional destination configurations:
149+
Migrating from traditional destination configurations:
122150

123151
### Before (Traditional Destination)
124152

@@ -127,20 +155,20 @@ Destination destination = DestinationAccessor.getDestination("my-destination");
127155
HttpClient client = ApacheHttpClient5Accessor.getHttpClient(destination);
128156
```
129157

130-
### After (Transparent Proxy - Dynamic)
158+
### After (Transparent Proxy - Gateway)
131159

132160
```java
133161
TransparentProxyDestination destination = TransparentProxyDestination
134-
.dynamicDestination("my-destination", "https://proxy-gateway.com")
162+
.gateway("my-destination", <destination-custom-resource-name>.<destination-custom-resource-namespace>)
135163
.build();
136164
HttpClient client = ApacheHttpClient5Accessor.getHttpClient(destination);
137165
```
138166

139-
### After (Transparent Proxy - Static)
167+
### After (Transparent Proxy - Destination)
140168

141169
```java
142170
TransparentProxyDestination destination = TransparentProxyDestination
143-
.staticDestination("https://my-service.com")
171+
.destination(<destination-custom-resource-name>.<destination-custom-resource-namespace>)
144172
.build();
145173
HttpClient client = ApacheHttpClient5Accessor.getHttpClient(destination);
146174
```
@@ -149,7 +177,7 @@ HttpClient client = ApacheHttpClient5Accessor.getHttpClient(destination);
149177

150178
### Common Issues
151179

152-
1. **Missing destination name for dynamic destinations**: Ensure the destination name is provided as the first parameter to `.dynamicDestination("destination-name", "gateway-url")`
180+
1. **Missing destination name for gateway**: Ensure the destination name is provided as the first parameter to `.gateway(<destination-name>, <destination-custom-resource-name>.<destination-custom-resource-namespace>)`
153181
2. **Tenant context not available**: Verify tenant information is properly set in the request context
154182
3. **Authentication failures**: Check that authentication headers and parameters are correctly configured
155183
4. **Network connectivity**: Verify that the Transparent Proxy is accessible from your environment
@@ -177,9 +205,12 @@ try {
177205
- `X-Error-Origin` - the source of the error
178206
- `X-Proxy-Server` - the proxy server (Transparent Proxy)
179207
- `X-Error-Message` - thorough error message
180-
- `X-Error-Internal-Code` - set only when the source of the error is the XSUAA or Destination service. The value is the HTTP code returned from one of these services.
208+
- `X-Error-Internal-Code` - set only when the source of the error is the XSUAA or Destination service.
209+
The value is the HTTP code returned from one of these services.
181210
- `X-Request-Id` is sent with the response in all requests, both successful and failed
182211

212+
For more information, see [Troubleshooting](https://help.sap.com/docs/connectivity/sap-btp-connectivity-cf/transparent-proxy-troubleshooting)
213+
183214
## Related Documentation
184215

185216
- [HTTP Client](http-client) - For using destinations with HTTP clients

0 commit comments

Comments
 (0)