@speedkit/cli 2.41.4 → 2.42.0
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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [2.42.0](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.41.4...v2.42.0) (2024-07-17)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **onboarding:** authenticate virtual orestesApp against origin ([dc13ad5](https://gitlab.orestes.info/baqend/speed-kit-cli/commit/dc13ad50442157e5a34f60fa46d468eba34b8ba6))
|
|
7
|
+
|
|
1
8
|
## [2.41.4](https://gitlab.orestes.info/baqend/speed-kit-cli/compare/v2.41.3...v2.41.4) (2024-07-12)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ class Crawler {
|
|
|
22
22
|
const userAgent = this.setDefaultUserAgent(variation);
|
|
23
23
|
const headers = { "User-Agent": userAgent };
|
|
24
24
|
const requestInit = {
|
|
25
|
-
...this.prepareOriginRequest(variation, {
|
|
25
|
+
...this.prepareOriginRequest(originUrl, variation, {
|
|
26
26
|
headers,
|
|
27
27
|
}),
|
|
28
28
|
agent,
|
|
@@ -41,7 +41,7 @@ class Crawler {
|
|
|
41
41
|
}
|
|
42
42
|
return onboarding_model_1.USER_AGENT.DESKTOP;
|
|
43
43
|
}
|
|
44
|
-
prepareOriginRequest(variationParameter, init) {
|
|
44
|
+
prepareOriginRequest(originUrl, variationParameter, init) {
|
|
45
45
|
if (!this.speedKitServerConfig || !variationParameter) {
|
|
46
46
|
return init;
|
|
47
47
|
}
|
|
@@ -52,7 +52,27 @@ class Crawler {
|
|
|
52
52
|
return init;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
const authentication = this.prepareAuthRequest(originUrl);
|
|
56
|
+
if (authentication) {
|
|
57
|
+
init.headers["Authorization"] = authentication;
|
|
58
|
+
}
|
|
55
59
|
return init;
|
|
56
60
|
}
|
|
61
|
+
prepareAuthRequest(originUrl) {
|
|
62
|
+
if (!this.speedKitServerConfig ||
|
|
63
|
+
this.speedKitServerConfig.speedKit?.authentications?.length < 1) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const origin = new URL(originUrl).origin;
|
|
67
|
+
for (const auth of this.speedKitServerConfig.speedKit.authentications) {
|
|
68
|
+
if (!auth.uri.includes(origin)) {
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
if (auth.type === "basic") {
|
|
72
|
+
return `Basic ${Buffer.from(`${auth.user}:${auth.password}`).toString("base64")}`;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
57
77
|
}
|
|
58
78
|
exports.Crawler = Crawler;
|
package/oclif.manifest.json
CHANGED