You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs-js/features/connectivity/destination-cache-isolation.mdx
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,20 +22,20 @@ To reduce the number of calls to fetch destinations, the SAP Cloud SDK provides
22
22
This guide explains how destinations are cached and shows options for destination cache configuration.
23
23
The general destination lookup is described in [this guide](./destination.mdx).
24
24
25
-
All options discussed in the following are part of the [`DestinationFetchOptions`](pathname:///api/v4/interfaces/sap_cloud_sdk_connectivity.DestinationFetchOptions.html).
25
+
All options discussed in the following are part of the [`DestinationFetchOptions`](pathname:///api/v4/interfaces/sap-cloud-sdk_connectivity.DestinationFetchOptions.html).
26
26
You use those options when:
27
27
28
28
- executing requests through a generated client using `execute()`
29
-
- executing generic HTTP requests using [`executeHttpRequest()`](pathname:///api/v4/functions/sap_cloud_sdk_http_client.executeHttpRequest.html)
30
-
- retrieving destinations using [`getDestination()`](pathname:///api/v4/functions/sap_cloud_sdk_connectivity.getDestination.html)
31
-
- retrieving all destinations using[`getAllDestinationsFromDestinationService()`](pathname:///api/v4/functions/sap_cloud_sdk_connectivity.getAllDestinationsFromDestinationService.html)
29
+
- executing generic HTTP requests using [`executeHttpRequest()`](pathname:///api/v4/functions/sap-cloud-sdk_http_client.executeHttpRequest.html)
30
+
- retrieving destinations using [`getDestination()`](pathname:///api/v4/functions/sap-cloud-sdk_connectivity.getDestination.html)
31
+
- retrieving all destinations using[`getAllDestinationsFromDestinationService()`](pathname:///api/v4/functions/sap-cloud-sdk_connectivity.getAllDestinationsFromDestinationService.html)
32
32
33
33
The following examples will use `execute()` for brevity, but could be replaced by all of the above.
34
34
35
35
## Destination Cache
36
36
37
37
By default, destination caching is enabled.
38
-
You can disable it by setting the [`useCache`](pathname:///api/v4/interfaces/sap_cloud_sdk_connectivity.DestinationFetchOptions.html#useCache) option to `false`:
38
+
You can disable it by setting the [`useCache`](pathname:///api/v4/interfaces/sap-cloud-sdk_connectivity.DestinationFetchOptions.html#useCache) option to `false`:
@@ -87,7 +87,7 @@ Assume you have a multi-tenant scenario, where you pass a JWT to obtain the dest
87
87
The JWT contains a `user_id` but the authentication type of the destination is user-independent.
88
88
The default isolation strategy for this case is `tenant-user`, although `tenant` would suffice.
89
89
90
-
For such cases, you can manually enforce weaker isolation by passing the [`isolationStrategy`](pathname:///api/v4/interfaces/sap_cloud_sdk_connectivity.DestinationFetchOptions.html#isolationStrategy) option:
90
+
For such cases, you can manually enforce weaker isolation by passing the [`isolationStrategy`](pathname:///api/v4/interfaces/sap-cloud-sdk_connectivity.DestinationFetchOptions.html#isolationStrategy) option:
91
91
92
92
```ts
93
93
.execute({
@@ -107,7 +107,7 @@ An erroneous configuration can have severe consequences like privilege escalatio
107
107
108
108
By default, destinations are cached in-memory.
109
109
If you need more control over the destination cache, e.g. to use a persistent or distributed cache, you can create a custom destination cache.
110
-
For this, implement the [`DestinationCacheInterface`](pathname:///api/v4/interfaces/sap_cloud_sdk_connectivity.DestinationCacheInterface.html):
110
+
For this, implement the [`DestinationCacheInterface`](pathname:///api/v4/interfaces/sap-cloud-sdk_connectivity.DestinationCacheInterface.html):
Note that each item in the cache is represented using the [`CacheEntry<T>`](pathname:///api/v4/interfaces/sap_cloud_sdk_connectivity.CacheEntry.html) type, which defines two properties:
137
+
Note that each item in the cache is represented using the [`CacheEntry<T>`](pathname:///api/v4/interfaces/sap-cloud-sdk_connectivity.CacheEntry.html) type, which defines two properties:
138
138
139
139
-`entry` - The item, i.e. destination, you want to cache.
140
140
-`expires` - The expiration time of the entry in milliseconds.
@@ -167,7 +167,7 @@ const customCache = {
167
167
};
168
168
```
169
169
170
-
To use your custom cache, pass your implementation to the global [`setDestinationCache()`](pathname:///api/v4/functions/sap_cloud_sdk_connectivity.setDestinationCache.html) function before fetching destinations for the first time.
170
+
To use your custom cache, pass your implementation to the global [`setDestinationCache()`](pathname:///api/v4/functions/sap-cloud-sdk_connectivity.setDestinationCache.html) function before fetching destinations for the first time.
171
171
All subsequent calls to fetch destinations will use the custom cache.
When [registering destinations](./destination.mdx#register-destination) using the [`registerDestination()`](pathname:///api/v4/functions/sap_cloud_sdk_connectivity.registerDestination.html) function, destinations are stored in a separate cache.
183
+
When [registering destinations](./destination.mdx#register-destination) using the [`registerDestination()`](pathname:///api/v4/functions/sap-cloud-sdk_connectivity.registerDestination.html) function, destinations are stored in a separate cache.
184
184
This cache is always enabled and behaves similarly to the destination cache discussed above.
185
185
It uses the same JWT-dependent defaults for the [isolation strategy](#isolation-strategy) as the destination cache.
186
186
To change the isolation strategy pass the `isolationStrategy` option to the function.
Copy file name to clipboardExpand all lines: docs-js/features/connectivity/destination.mdx
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ Some reasons to separate destinations and the application are:
33
33
- Different customers may want to configure different systems.
34
34
- Multiple applications might want to access the same systems.
35
35
36
-
Use [destinations](pathname:///api/v3/interfaces/sap_cloud_sdk_connectivity.Destination.html) to execute [arbitrary requests](./generic-http-client.mdx), [OData requests](../odata/overview.mdx), and [OpenAPI requests](../openapi/overview.mdx).
36
+
Use [destinations](pathname:///api/v4/interfaces/sap-cloud-sdk_connectivity.Destination.html) to execute [arbitrary requests](./generic-http-client.mdx), [OData requests](../odata/overview.mdx), and [OpenAPI requests](../openapi/overview.mdx).
37
37
The following examples use `req.execute()`, assuming req is an OData or OpenAPI request, to demonstrate options for the destination lookup.
38
38
The same options apply to `executeHttpRequest()`.
39
39
@@ -64,7 +64,7 @@ If you want to cache destinations in production, use [`registerDestination()`](#
64
64
:::
65
65
66
66
You can provide destinations in the `destinations` environment variable.
67
-
The value of the environment variable is expected to be a stringified JSON array, where the items adhere to the [Destination interface](pathname:///api/v3/interfaces/sap_cloud_sdk_connectivity.Destination.html).
67
+
The value of the environment variable is expected to be a stringified JSON array, where the items adhere to the [Destination interface](pathname:///api/v4/interfaces/sap-cloud-sdk_connectivity.Destination.html).
68
68
69
69
Example:
70
70
@@ -84,7 +84,7 @@ Note that this approach is **not suitable for multi-tenant scenarios**.
84
84
#### Testing with Local Environment Variables
85
85
86
86
The SAP Cloud SDK provides a `setTestDestination()` function to add a destination to the environment variable for the current process programmatically.
87
-
It takes a [destination object](pathname:///api/v3/interfaces/sap_cloud_sdk_connectivity.Destination.html), transforms it to a JSON object, and adds it to `process.env.destinations`.
87
+
It takes a [destination object](pathname:///api/v4/interfaces/sap-cloud-sdk_connectivity.Destination.html), transforms it to a JSON object, and adds it to `process.env.destinations`.
@@ -280,7 +280,7 @@ Note, that if your `serviceBindingTransformFn()` function does not provide a nam
280
280
281
281
More advanced examples with service token fetching can be found in [service-binding-to-destination.ts](https://github.com/SAP/cloud-sdk-js/blob/main/packages/connectivity/src/scp-cf/destination/service-binding-to-destination.ts).
282
282
283
-
If you want to skip the destination lookup and consider only the service bindings, call the [getDestinationFromServiceBinding()](pathname:///api/v3/functions/sap_cloud_sdk_connectivity.getDestinationFromServiceBinding.html) function with the service name and options.
283
+
If you want to skip the destination lookup and consider only the service bindings, call the [getDestinationFromServiceBinding()](pathname:///api/v4/functions/sap-cloud-sdk_connectivity.getDestinationFromServiceBinding.html) function with the service name and options.
Copy file name to clipboardExpand all lines: docs-js/features/odata/execute-odata-request.mdx
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -167,10 +167,10 @@ The following table describes how types are mapped by default:
167
167
|`Edm.DateTimeOffset`|`moment.Moment`||
168
168
|`Edm.Binary`|`string`||
169
169
|`Edm.DateTime`|`moment.Moment`| OData v2 only, precision limited to milliseconds |
170
-
|`Edm.Time`|[`Time`](pathname:///api/v3/interfaces/sap_cloud_sdk_odata_common.Time.html)| OData v2 only, does not consider time zones |
170
+
|`Edm.Time`|[`Time`](pathname:///api/v4/interfaces/sap-cloud-sdk_odata_common.Time.html)| OData v2 only, does not consider time zones |
171
171
|`Edm.Date`|`moment.Moment`| OData v4 only |
172
172
|`Edm.Duration`|`moment.Duration`| OData v4 only |
173
-
|`Edm.TimeOfDay`|[`Time`](pathname:///api/v3/interfaces/sap_cloud_sdk_odata_common.Time.html)| OData v4 only, does not consider time-zones |
173
+
|`Edm.TimeOfDay`|[`Time`](pathname:///api/v4/interfaces/sap-cloud-sdk_odata_common.Time.html)| OData v4 only, does not consider time-zones |
174
174
| Any other type |`any`||
175
175
176
176
If you require the raw OData response, you can look into [getting the raw response and the original request](#getting-the-raw-response-and-the-original-request).
Copy file name to clipboardExpand all lines: docs-js_versioned_docs/version-v3/features/connectivity/destination-cache-isolation.mdx
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,19 +22,19 @@ To reduce the number of calls to fetch destinations, the SAP Cloud SDK provides
22
22
This guide explains how destinations are cached and shows options for destination cache configuration.
23
23
The general destination lookup is described in [this guide](./destination.mdx).
24
24
25
-
All options discussed in the following are part of the [`DestinationFetchOptions`](pathname:///api/v3/interfaces/sap_cloud_sdk_connectivity.DestinationFetchOptions.html).
25
+
All options discussed in the following are part of the [`DestinationFetchOptions`](pathname:///api/v3/interfaces/sap-cloud-sdk_connectivity.DestinationFetchOptions.html).
26
26
You use those options when:
27
27
28
28
- executing requests through a generated client using `execute()`
29
-
- executing generic HTTP requests using [`executeHttpRequest()`](pathname:///api/v3/functions/sap_cloud_sdk_http_client.executeHttpRequest.html)
30
-
- retrieving destinations using [`getDestination()`](pathname:///api/v3/functions/sap_cloud_sdk_connectivity.getDestination.html)
29
+
- executing generic HTTP requests using [`executeHttpRequest()`](pathname:///api/v3/functions/sap-cloud-sdk_http_client.executeHttpRequest.html)
30
+
- retrieving destinations using [`getDestination()`](pathname:///api/v3/functions/sap-cloud-sdk_connectivity.getDestination.html)
31
31
32
32
The following examples will use `execute()` for brevity, but could be replaced by all of the above.
33
33
34
34
## Destination Cache
35
35
36
36
By default, destination caching is disabled.
37
-
Enable it by setting the [`useCache`](pathname:///api/v3/interfaces/sap_cloud_sdk_connectivity.DestinationFetchOptions.html#useCache) option to `true`:
37
+
Enable it by setting the [`useCache`](pathname:///api/v3/interfaces/sap-cloud-sdk_connectivity.DestinationFetchOptions.html#useCache) option to `true`:
@@ -86,7 +86,7 @@ Assume you have a multi-tenant scenario, where you pass a JWT to obtain the dest
86
86
The JWT contains a `user_id` but the authentication type of the destination is user-independent.
87
87
The default isolation strategy for this case is `tenant-user`, although `tenant` would suffice.
88
88
89
-
For such cases, you can manually enforce weaker isolation by passing the [`isolationStrategy`](pathname:///api/v3/interfaces/sap_cloud_sdk_connectivity.DestinationFetchOptions.html#isolationStrategy) option:
89
+
For such cases, you can manually enforce weaker isolation by passing the [`isolationStrategy`](pathname:///api/v3/interfaces/sap-cloud-sdk_connectivity.DestinationFetchOptions.html#isolationStrategy) option:
90
90
91
91
```ts
92
92
.execute({
@@ -106,7 +106,7 @@ An erroneous configuration can have severe consequences like privilege escalatio
106
106
107
107
When caching is enabled, destinations are cached in-memory.
108
108
If you need more control over the destination cache, e.g. to use a persistent or distributed cache, you can create a custom destination cache.
109
-
For this, implement the [`DestinationCacheInterface`](pathname:///api/v3/interfaces/sap_cloud_sdk_connectivity.DestinationCacheInterface.html):
109
+
For this, implement the [`DestinationCacheInterface`](pathname:///api/v3/interfaces/sap-cloud-sdk_connectivity.DestinationCacheInterface.html):
Note that each item in the cache is represented using the [`CacheEntry<T>`](pathname:///api/v3/interfaces/sap_cloud_sdk_connectivity.CacheEntry.html) type, which defines two properties:
136
+
Note that each item in the cache is represented using the [`CacheEntry<T>`](pathname:///api/v3/interfaces/sap-cloud-sdk_connectivity.CacheEntry.html) type, which defines two properties:
137
137
138
138
-`entry` - The item, i.e. destination, you want to cache.
139
139
-`expires` - The expiration time of the entry in milliseconds.
@@ -166,7 +166,7 @@ const customCache = {
166
166
};
167
167
```
168
168
169
-
To use your custom cache, pass your implementation to the global [`setDestinationCache()`](pathname:///api/v3/functions/sap_cloud_sdk_connectivity.setDestinationCache.html) function before fetching destinations for the first time.
169
+
To use your custom cache, pass your implementation to the global [`setDestinationCache()`](pathname:///api/v3/functions/sap-cloud-sdk_connectivity.setDestinationCache.html) function before fetching destinations for the first time.
170
170
All subsequent calls to fetch destinations will use the custom cache.
When [registering destinations](./destination.mdx#register-destination) using the [`registerDestination()`](pathname:///api/v3/functions/sap_cloud_sdk_connectivity.registerDestination.html) function, destinations are stored in a separate cache.
182
+
When [registering destinations](./destination.mdx#register-destination) using the [`registerDestination()`](pathname:///api/v3/functions/sap-cloud-sdk_connectivity.registerDestination.html) function, destinations are stored in a separate cache.
183
183
This cache is always enabled and behaves similarly to the destination cache discussed above.
184
184
It uses the same JWT-dependent defaults for the [isolation strategy](#isolation-strategy) as the destination cache.
185
185
To change the isolation strategy pass the `isolationStrategy` option to the function.
0 commit comments