Replace PluginDatabaseClientFactory with PluginDatabaseManager

This commit is contained in:
Joel Low
2020-10-05 10:03:10 +08:00
parent 8c78b4e9dd
commit b083c97f84
13 changed files with 71 additions and 68 deletions
+3 -3
View File
@@ -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,
});