make IdentityClient.listPublicKeys private

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-02-08 11:25:13 +01:00
parent 143ada0056
commit 6bc86fcf2d
4 changed files with 8 additions and 7 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-auth-backend': minor
---
Made `IdentityClient.listPublicKeys` private. It was only used in tests, and should not be part of the API surface of that class. The interface is marked as experimental, and therefore this is a breaking change without a deprecation period.
-4
View File
@@ -10,7 +10,6 @@ import { Config } from '@backstage/config';
import { Entity } from '@backstage/catalog-model';
import express from 'express';
import { JsonValue } from '@backstage/types';
import { JSONWebKey } from 'jose';
import { Logger as Logger_2 } from 'winston';
import { PluginDatabaseManager } from '@backstage/backend-common';
import { PluginEndpointDiscovery } from '@backstage/backend-common';
@@ -432,9 +431,6 @@ export class IdentityClient {
static getBearerToken(
authorizationHeader: string | undefined,
): string | undefined;
listPublicKeys(): Promise<{
keys: JSONWebKey[];
}>;
}
// Warning: (ae-missing-release-tag) "microsoftEmailSignInResolver" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
@@ -83,7 +83,7 @@ describe('IdentityClient', () => {
it('should use the correct endpoint', async () => {
await factory.issueToken({ claims: { sub: 'foo' } });
const keys = await factory.listPublicKeys();
const response = await client.listPublicKeys();
const response = await (client as any).listPublicKeys();
expect(response).toEqual(keys);
});
@@ -257,7 +257,7 @@ describe('IdentityClient', () => {
});
it('should use the correct endpoint', async () => {
const response = await client.listPublicKeys();
const response = await (client as any).listPublicKeys();
expect(response).toEqual(defaultServiceResponse);
});
});
@@ -125,7 +125,7 @@ export class IdentityClient {
/**
* Lists public part of keys used to sign Backstage Identity tokens
*/
async listPublicKeys(): Promise<{
private async listPublicKeys(): Promise<{
keys: JSONWebKey[];
}> {
const url = `${await this.discovery.getBaseUrl(