Fix review comments
- Combine the various exported types; the only API surface is now the `PluginDatabaseClientFactory` which is a free function. - Rename to the SingleConnectionManager class. - Refactor the PluginEnvironment type to use databaseClientFactory for clarity. - Fix mergeDatabaseConfig to not override the input dictionary.
This commit is contained in:
@@ -24,12 +24,12 @@ import { DatabaseKeyStore, TokenFactory, createOidcRouter } from '../identity';
|
||||
import {
|
||||
NotFoundError,
|
||||
PluginEndpointDiscovery,
|
||||
PluginDatabaseFactory,
|
||||
PluginDatabaseClientFactory,
|
||||
} from '@backstage/backend-common';
|
||||
|
||||
export interface RouterOptions {
|
||||
logger: Logger;
|
||||
database: PluginDatabaseFactory;
|
||||
database: PluginDatabaseClientFactory;
|
||||
config: Config;
|
||||
discovery: PluginEndpointDiscovery;
|
||||
}
|
||||
@@ -48,7 +48,7 @@ export async function createRouter({
|
||||
const keyDurationSeconds = 3600;
|
||||
|
||||
const keyStore = await DatabaseKeyStore.create({
|
||||
database: await database.getDatabase(),
|
||||
database: await database(),
|
||||
});
|
||||
const tokenIssuer = new TokenFactory({
|
||||
issuer: authUrl,
|
||||
|
||||
@@ -53,10 +53,8 @@ export async function startStandaloneServer(
|
||||
const router = await createRouter({
|
||||
logger,
|
||||
config,
|
||||
database: {
|
||||
async getDatabase(_database?: string) {
|
||||
return database;
|
||||
},
|
||||
database: async () => {
|
||||
return database;
|
||||
},
|
||||
discovery,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user