review comments

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-02-10 10:36:45 +01:00
parent bf5222bfa1
commit 3c9aed1b16
9 changed files with 69 additions and 26 deletions
+1 -1
View File
@@ -98,7 +98,7 @@ describe('IdentityClient', () => {
afterEach(() => server.resetHandlers());
beforeEach(() => {
client = new IdentityClient({ discovery, issuer: mockBaseUrl });
client = IdentityClient.create({ discovery, issuer: mockBaseUrl });
factory = new FakeTokenFactory({
issuer: mockBaseUrl,
keyDurationSeconds,
+14 -1
View File
@@ -35,7 +35,20 @@ export class IdentityClient {
private keyStore: JWKS.KeyStore;
private keyStoreUpdated: number;
constructor(options: { discovery: PluginEndpointDiscovery; issuer: string }) {
/**
* Create a new {@link IdentityClient} instance.
*/
static create(options: {
discovery: PluginEndpointDiscovery;
issuer: string;
}): IdentityClient {
return new IdentityClient(options);
}
private constructor(options: {
discovery: PluginEndpointDiscovery;
issuer: string;
}) {
this.discovery = options.discovery;
this.issuer = options.issuer;
this.keyStore = new JWKS.KeyStore();