@@ -117,12 +117,12 @@ describe('oidcAuthenticator', () => {
|
||||
return res(
|
||||
req.headers.get('Authorization')
|
||||
? ctx.json({
|
||||
access_token: 'accessToken',
|
||||
id_token: idToken,
|
||||
refresh_token: 'refreshToken',
|
||||
scope: 'testScope',
|
||||
expires_in: 3600,
|
||||
})
|
||||
access_token: 'accessToken',
|
||||
id_token: idToken,
|
||||
refresh_token: 'refreshToken',
|
||||
scope: 'testScope',
|
||||
expires_in: 3600,
|
||||
})
|
||||
: ctx.status(401),
|
||||
);
|
||||
}),
|
||||
@@ -220,12 +220,10 @@ describe('oidcAuthenticator', () => {
|
||||
metadataUrl: 'https://oidc.test/.well-known/openid-configuration',
|
||||
clientId: 'clientId',
|
||||
clientSecret: 'clientSecret',
|
||||
timeout: '30s',
|
||||
timeout: 123, // Invalid: should be a duration object
|
||||
}),
|
||||
});
|
||||
}).toThrow(
|
||||
"Failed to read duration from config, TypeError: Invalid type in config for key 'timeout' in 'mock-config', got string, wanted object",
|
||||
);
|
||||
}).toThrow();
|
||||
|
||||
expect(() => {
|
||||
oidcAuthenticator.initialize({
|
||||
@@ -235,13 +233,11 @@ describe('oidcAuthenticator', () => {
|
||||
clientId: 'clientId',
|
||||
clientSecret: 'clientSecret',
|
||||
timeout: {
|
||||
seconds: '30s',
|
||||
invalid: 'value',
|
||||
},
|
||||
}),
|
||||
});
|
||||
}).toThrow(
|
||||
"Failed to read duration from config, Error: Unable to convert config value for key 'timeout.seconds' in 'mock-config' to a number",
|
||||
);
|
||||
}).toThrow();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user