@backstage/integration 1.6.1 → 1.6.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 +9 -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 +2 -2
package/CHANGELOG.md
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -1037,13 +1037,23 @@ function getAuthenticationPrefix(config) {
|
|
|
1037
1037
|
return config.password ? "/a/" : "/";
|
|
1038
1038
|
}
|
|
1039
1039
|
function getGitilesAuthenticationUrl(config) {
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
)
|
|
1046
|
-
|
|
1040
|
+
if (!config.baseUrl || !config.gitilesBaseUrl) {
|
|
1041
|
+
throw new Error(
|
|
1042
|
+
"Unexpected Gerrit config values. baseUrl or gitilesBaseUrl not set."
|
|
1043
|
+
);
|
|
1044
|
+
}
|
|
1045
|
+
if (config.gitilesBaseUrl.startsWith(config.baseUrl)) {
|
|
1046
|
+
return config.gitilesBaseUrl.replace(
|
|
1047
|
+
config.baseUrl.concat("/"),
|
|
1048
|
+
config.baseUrl.concat(getAuthenticationPrefix(config))
|
|
1049
|
+
);
|
|
1050
|
+
}
|
|
1051
|
+
if (config.password) {
|
|
1052
|
+
throw new Error(
|
|
1053
|
+
"Since the baseUrl (Gerrit) is not part of the gitilesBaseUrl, an authentication URL could not be constructed."
|
|
1054
|
+
);
|
|
1055
|
+
}
|
|
1056
|
+
return config.gitilesBaseUrl;
|
|
1047
1057
|
}
|
|
1048
1058
|
function getGerritBranchApiUrl(config, url) {
|
|
1049
1059
|
const { branch, project } = parseGerritGitilesUrl(config, url);
|