backend-app-api: fix typings

Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
This commit is contained in:
Vincenzo Scamporlino
2024-03-26 20:02:55 +01:00
parent 6e611a7977
commit 8c861be144
4 changed files with 6 additions and 8 deletions
@@ -25,7 +25,6 @@ import {
coreServices,
createServiceFactory,
DatabaseService,
AnyJWK,
} from '@backstage/backend-plugin-api';
import { AuthenticationError } from '@backstage/errors';
import { decodeJwt } from 'jose';
@@ -230,10 +229,6 @@ class DefaultAuthService implements AuthService {
}
return new Date(exp * 1000);
}
listPublicKeys(): Promise<AnyJWK[]> {
return this.pluginTokenHandler.listPublicKeys();
}
}
/** @public */
@@ -39,7 +39,7 @@ export class DatabaseKeyStore implements PublicKeyStoreService {
id: string;
key: JsonObject & { kid: string };
expiresAt: Date;
}): Promise<void> {
}) {
await this.client<Row>(TABLE).insert({
id: options.key.kid,
key: JSON.stringify(options.key),
@@ -48,7 +48,7 @@ export class DatabaseKeyStore implements PublicKeyStoreService {
});
}
async listKeys(): Promise<{ keys: { key: JsonObject; expiresAt: Date }[] }> {
async listKeys() {
const rows = await this.client<Row>(TABLE).select();
// TODO: move over filter/delete the logic from listPublicKeys() in plugins/auth-backend/src/identity/TokenFactory.ts
@@ -20,7 +20,7 @@ import { JsonObject } from '@backstage/types';
* @public
*/
export interface PublicKeyStoreService {
listKeys(): Promise<{ keys: JsonObject[] }>;
listKeys(): Promise<{ keys: { key: JsonObject; expiresAt: Date }[] }>;
addKey(options: {
id: string;
key: JsonObject;
+3
View File
@@ -3300,8 +3300,10 @@ __metadata:
helmet: ^6.0.0
http-errors: ^2.0.0
jose: ^5.0.0
knex: ^3.0.0
lodash: ^4.17.21
logform: ^2.3.2
luxon: ^3.0.0
minimatch: ^9.0.0
minimist: ^1.2.5
morgan: ^1.10.0
@@ -3311,6 +3313,7 @@ __metadata:
selfsigned: ^2.0.0
stoppable: ^1.1.0
supertest: ^6.1.3
uuid: ^9.0.0
winston: ^3.2.1
winston-transport: ^4.5.0
languageName: unknown