@sap-ux/axios-extension 1.20.3 → 1.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.adoc +5 -6
- package/dist/factory.js +1 -3
- package/package.json +6 -6
package/README.adoc
CHANGED
|
@@ -120,21 +120,20 @@ See more examples in link:./test/factory.test.ts[/test/factory.test.ts]
|
|
|
120
120
|
|
|
121
121
|
## Proxy Support
|
|
122
122
|
|
|
123
|
-
To enable support for TLS (Transport Layer Security)
|
|
123
|
+
To enable support for TLS (Transport Layer Security), enable the `HTTPS_PROXY` environment variable, as shown;
|
|
124
124
|
|
|
125
125
|
```bash
|
|
126
|
-
export TOOLSUITE_FEATURES=sap.ux.enablePatchProxy
|
|
127
126
|
export HTTPS_PROXY=<YOUR-PROXY:PORT>
|
|
127
|
+
# With Credentials
|
|
128
|
+
export HTTPS_PROXY=<USERNAME>:<PASSWORD>@<YOUR-PROXY:PORT>
|
|
128
129
|
```
|
|
129
130
|
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
Sample Configuration
|
|
132
132
|
```bash
|
|
133
|
-
export TOOLSUITE_FEATURES=sap.ux.enablePatchProxy
|
|
134
133
|
export HTTPS_PROXY=http://user:password@proxy.domain.com:3128
|
|
135
134
|
```
|
|
136
135
|
|
|
137
|
-
Ensure you restart any running processes to apply the changes.
|
|
136
|
+
Ensure you restart any running processes or applications to apply the changes.
|
|
138
137
|
|
|
139
138
|
Example Scenario
|
|
140
139
|
|
package/dist/factory.js
CHANGED
|
@@ -20,7 +20,6 @@ const patchTls_1 = require("./base/patchTls");
|
|
|
20
20
|
const proxy_from_env_1 = require("proxy-from-env");
|
|
21
21
|
const https_proxy_agent_1 = require("https-proxy-agent");
|
|
22
22
|
const http_proxy_agent_1 = require("http-proxy-agent");
|
|
23
|
-
const feature_toggle_1 = require("@sap-ux/feature-toggle");
|
|
24
23
|
/**
|
|
25
24
|
* PatchedHttpsProxyAgent is a custom implementation of HttpsProxyAgent that allows to pass additional options, currently not supported by the original implementation when calling tls.connect
|
|
26
25
|
*/
|
|
@@ -62,8 +61,7 @@ function createInstance(ProviderType, config) {
|
|
|
62
61
|
rejectUnauthorized: !providerConfig.ignoreCertErrors
|
|
63
62
|
};
|
|
64
63
|
const localProxy = (0, proxy_from_env_1.getProxyForUrl)(config.baseURL);
|
|
65
|
-
|
|
66
|
-
if (isPatchProxyEnabled && localProxy) {
|
|
64
|
+
if (localProxy) {
|
|
67
65
|
// axios doesn't handle proxies correctly, instead use a custom agent with axios proxy disabled
|
|
68
66
|
providerConfig.httpsAgent = new PatchedHttpsProxyAgent(localProxy, agentOptions);
|
|
69
67
|
providerConfig.httpAgent = new http_proxy_agent_1.HttpProxyAgent(localProxy);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sap-ux/axios-extension",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.1",
|
|
4
4
|
"description": "Extension of the Axios module adding convenience methods to interact with SAP systems especially with OData services.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,16 +25,16 @@
|
|
|
25
25
|
"https-proxy-agent": "7.0.5",
|
|
26
26
|
"http-proxy-agent": "7.0.2",
|
|
27
27
|
"proxy-from-env": "1.1.0",
|
|
28
|
-
"@sap-ux/btp-utils": "1.0
|
|
29
|
-
"@sap-ux/logger": "0.
|
|
30
|
-
"@sap-ux/feature-toggle": "0.
|
|
28
|
+
"@sap-ux/btp-utils": "1.1.0",
|
|
29
|
+
"@sap-ux/logger": "0.7.0",
|
|
30
|
+
"@sap-ux/feature-toggle": "0.3.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/lodash": "4.14.202",
|
|
34
34
|
"nock": "13.4.0",
|
|
35
35
|
"supertest": "6.3.3",
|
|
36
36
|
"@types/proxy-from-env": "1.0.1",
|
|
37
|
-
"@sap-ux/project-access": "1.
|
|
37
|
+
"@sap-ux/project-access": "1.30.1"
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
40
40
|
"dist",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"!dist/**/*.map"
|
|
44
44
|
],
|
|
45
45
|
"engines": {
|
|
46
|
-
"node": ">=
|
|
46
|
+
"node": ">=20.x"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"build": "tsc --build",
|