@backstage/integration 1.7.0-next.0 → 1.7.0-next.2
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 +17 -0
- package/dist/index.cjs.js +17 -7
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +17 -7
- package/dist/index.esm.js.map +1 -1
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -1273,13 +1273,23 @@ function getAuthenticationPrefix(config) {
|
|
|
1273
1273
|
return config.password ? "/a/" : "/";
|
|
1274
1274
|
}
|
|
1275
1275
|
function getGitilesAuthenticationUrl(config) {
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
)
|
|
1282
|
-
|
|
1276
|
+
if (!config.baseUrl || !config.gitilesBaseUrl) {
|
|
1277
|
+
throw new Error(
|
|
1278
|
+
"Unexpected Gerrit config values. baseUrl or gitilesBaseUrl not set."
|
|
1279
|
+
);
|
|
1280
|
+
}
|
|
1281
|
+
if (config.gitilesBaseUrl.startsWith(config.baseUrl)) {
|
|
1282
|
+
return config.gitilesBaseUrl.replace(
|
|
1283
|
+
config.baseUrl.concat("/"),
|
|
1284
|
+
config.baseUrl.concat(getAuthenticationPrefix(config))
|
|
1285
|
+
);
|
|
1286
|
+
}
|
|
1287
|
+
if (config.password) {
|
|
1288
|
+
throw new Error(
|
|
1289
|
+
"Since the baseUrl (Gerrit) is not part of the gitilesBaseUrl, an authentication URL could not be constructed."
|
|
1290
|
+
);
|
|
1291
|
+
}
|
|
1292
|
+
return config.gitilesBaseUrl;
|
|
1283
1293
|
}
|
|
1284
1294
|
function getGerritBranchApiUrl(config, url) {
|
|
1285
1295
|
const { branch, project } = parseGerritGitilesUrl(config, url);
|