From 58763e875fc9d73220f8e45d318d58cc37cbf57d Mon Sep 17 00:00:00 2001 From: secustor Date: Thu, 28 Mar 2024 15:35:40 +0100 Subject: [PATCH] fix(plugins/catalog-backend-module-backstage-openapi): do not route request through external url but rather the internal one Signed-off-by: secustor --- .changeset/hungry-suns-hope.md | 5 +++++ .../src/InternalOpenApiDocumentationProvider.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/hungry-suns-hope.md diff --git a/.changeset/hungry-suns-hope.md b/.changeset/hungry-suns-hope.md new file mode 100644 index 0000000000..4d88a5f48a --- /dev/null +++ b/.changeset/hungry-suns-hope.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-catalog-backend-module-backstage-openapi': patch +--- + +Use direct access of openapi.json files and not external route diff --git a/plugins/catalog-backend-module-backstage-openapi/src/InternalOpenApiDocumentationProvider.ts b/plugins/catalog-backend-module-backstage-openapi/src/InternalOpenApiDocumentationProvider.ts index 17e5a331f0..dd94000ad7 100644 --- a/plugins/catalog-backend-module-backstage-openapi/src/InternalOpenApiDocumentationProvider.ts +++ b/plugins/catalog-backend-module-backstage-openapi/src/InternalOpenApiDocumentationProvider.ts @@ -122,7 +122,7 @@ const loadSpecs = async ({ }) => { const specs: OpenAPIObject[] = []; for (const pluginId of plugins) { - const url = await discovery.getExternalBaseUrl(pluginId); + const url = await discovery.getBaseUrl(pluginId); const openApiUrl = getOpenApiSpecRoute(url); const { token } = await auth.getPluginRequestToken({ onBehalfOf: await auth.getOwnServiceCredentials(),