fix undefined httpAuth service

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2024-03-25 16:20:50 +01:00
parent dc89312cf7
commit 836247c239
4 changed files with 12 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-jenkins-backend': patch
---
Fixed an issue where the `httpAuth` service turned out to be undefined
+1
View File
@@ -27,6 +27,7 @@ export class DefaultJenkinsInfoProvider implements JenkinsInfoProvider {
catalog: CatalogApi;
discovery: DiscoveryService;
auth?: AuthService;
httpAuth?: HttpAuthService;
}): DefaultJenkinsInfoProvider;
// (undocumented)
getInstance(opt: {
+4
View File
@@ -40,6 +40,7 @@ export const jenkinsPlugin = createBackendPlugin({
catalogClient: catalogServiceRef,
discovery: coreServices.discovery,
auth: coreServices.auth,
httpAuth: coreServices.httpAuth,
},
async init({
logger,
@@ -49,10 +50,12 @@ export const jenkinsPlugin = createBackendPlugin({
catalogClient,
discovery,
auth,
httpAuth,
}) {
const winstonLogger = loggerToWinstonLogger(logger);
const jenkinsInfoProvider = DefaultJenkinsInfoProvider.fromConfig({
auth,
httpAuth,
config,
catalog: catalogClient,
discovery,
@@ -70,6 +73,7 @@ export const jenkinsPlugin = createBackendPlugin({
jenkinsInfoProvider,
discovery,
auth,
httpAuth,
}),
);
},
@@ -19,6 +19,7 @@ import {
AuthService,
BackstageCredentials,
DiscoveryService,
HttpAuthService,
} from '@backstage/backend-plugin-api';
import { CatalogApi } from '@backstage/catalog-client';
import {
@@ -197,6 +198,7 @@ export class DefaultJenkinsInfoProvider implements JenkinsInfoProvider {
catalog: CatalogApi;
discovery: DiscoveryService;
auth?: AuthService;
httpAuth?: HttpAuthService;
}): DefaultJenkinsInfoProvider {
const { auth } = createLegacyAuthAdapters(options);
return new DefaultJenkinsInfoProvider(