Replace PluginDatabaseClientFactory with PluginDatabaseManager
This commit is contained in:
@@ -24,12 +24,12 @@ import { DatabaseKeyStore, TokenFactory, createOidcRouter } from '../identity';
|
||||
import {
|
||||
NotFoundError,
|
||||
PluginEndpointDiscovery,
|
||||
PluginDatabaseClientFactory,
|
||||
PluginDatabaseManager,
|
||||
} from '@backstage/backend-common';
|
||||
|
||||
export interface RouterOptions {
|
||||
logger: Logger;
|
||||
database: PluginDatabaseClientFactory;
|
||||
database: PluginDatabaseManager;
|
||||
config: Config;
|
||||
discovery: PluginEndpointDiscovery;
|
||||
}
|
||||
@@ -48,7 +48,7 @@ export async function createRouter({
|
||||
const keyDurationSeconds = 3600;
|
||||
|
||||
const keyStore = await DatabaseKeyStore.create({
|
||||
database: await database(),
|
||||
database: await database.getClient(),
|
||||
});
|
||||
const tokenIssuer = new TokenFactory({
|
||||
issuer: authUrl,
|
||||
|
||||
@@ -53,8 +53,10 @@ export async function startStandaloneServer(
|
||||
const router = await createRouter({
|
||||
logger,
|
||||
config,
|
||||
database: async () => {
|
||||
return database;
|
||||
database: {
|
||||
async getClient() {
|
||||
return database;
|
||||
},
|
||||
},
|
||||
discovery,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user