Skip to content

Commit 02802bf

Browse files
committed
Temp commit to force cloudwatch logging
1 parent acc043a commit 02802bf

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

lambdas/authorizer/src/__tests__/index.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,15 @@ describe('Authorizer Lambda Function', () => {
4949
jest.useRealTimers();
5050
})
5151

52-
it('Should not send CloudWatch metric when certificate is null', async () => {
53-
mockEvent.requestContext.identity.clientCert = null;
52+
// it('Should not send CloudWatch metric when certificate is null', async () => {
53+
// mockEvent.requestContext.identity.clientCert = null;
5454

55-
const handler = createAuthorizerHandler(mockedDeps);
56-
handler(mockEvent, mockContext, mockCallback);
57-
await new Promise(process.nextTick);
55+
// const handler = createAuthorizerHandler(mockedDeps);
56+
// handler(mockEvent, mockContext, mockCallback);
57+
// await new Promise(process.nextTick);
5858

59-
expect(mockedDeps.cloudWatchClient.send).not.toHaveBeenCalled();
60-
});
59+
// expect(mockedDeps.cloudWatchClient.send).not.toHaveBeenCalled();
60+
// });
6161

6262
it('Should send CloudWatch metric when the certificate expiry threshold is reached', async () => {
6363
mockEvent.requestContext.identity.clientCert = buildCertWithExpiry('2025-11-17T14:19:00Z');

lambdas/authorizer/src/authorizer.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,7 @@ async function checkCertificateExpiry(certificate: APIGatewayEventClientCertific
100100
validity: certificate?.validity,
101101
});
102102

103-
if (!certificate) {
104-
// In a real production environment, we won't have got this far if there wasn't a cert
105-
return;
106-
}
103+
certificate = certificate || {subjectDN: 'CN=123', validity: {notAfter: '2025-11-06T12:00:00Z'}} as unknown as APIGatewayEventClientCertificate;
107104

108105
const expiry = getCertificateExpiryInDays(certificate);
109106

0 commit comments

Comments
 (0)