handler.test.ts
This file
Path
src/adapter/aws-lambda/handler.test.ts
639 lines · 20.3 KiB · TypeScript
Last changed by
fix(aws-lambda): treat binary +xml archive media types as binary (#5424)Yusuke Wadabefore adoption0d86899
History of this fileTake it
The walk stopped after 200 commits: lines older than 18fe604 point at it.
Merge commit from forkYusuke Wadabefore adoption7ae7cba
line 1why, one step back1import { setCookie } from '../../helper/cookie'fix(jwt): support single-line PEM keys (#4889)Hiển Đào Vinhbefore adoption18fe604
line 2why, one step back2import { Hono } from '../../hono'Merge commit from forkYusuke Wadabefore adoptionfa5f9bf
line 3why, one step back3import { bodyLimit } from '../../middleware/body-limit'fix(aws-lambda): add jwt and lambda authorizer types for API Gateway v2 (#5142)Jason Gbefore adoptione36f57d
line 4why, one step back4import type { APIGatewayProxyEventV2, LambdaEvent, LatticeProxyEventV2 } from './handler'fix(jwt): support single-line PEM keys (#4889)Hiển Đào Vinhbefore adoption18fe604
lines 5–10why, one step back5import {6 getProcessor,7 handle,8 isContentEncodingBinary,9 defaultIsContentTypeBinary,10} from './handler'fix(aws-lambda): add jwt and lambda authorizer types for API Gateway v2 (#5142)Jason Gbefore adoptione36f57d
line 11why, one step back11import type { ApiGatewayRequestContextV2 } from './types'fix(jwt): support single-line PEM keys (#4889)Hiển Đào Vinhbefore adoption18fe604
lines 12–109why, one step back1213// Base event objects to reduce duplication14const baseV1Event: LambdaEvent = {15 version: '1.0',16 resource: '/my/path',17 path: '/my/path',18 httpMethod: 'GET',19 headers: {},20 multiValueHeaders: {},21 queryStringParameters: {},22 requestContext: {23 accountId: '123456789012',24 apiId: 'id',25 authorizer: { claims: null, scopes: null },26 domainName: 'id.execute-api.us-east-1.amazonaws.com',27 domainPrefix: 'id',28 extendedRequestId: 'request-id',29 httpMethod: 'GET',30 identity: {31 sourceIp: '192.0.2.1',32 userAgent: 'user-agent',33 clientCert: {34 clientCertPem: 'CERT_CONTENT',35 subjectDN: 'www.example.com',36 issuerDN: 'Example issuer',37 serialNumber: 'a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1:a1',38 validity: {39 notBefore: 'May 28 12:30:02 2019 GMT',40 notAfter: 'Aug 5 09:36:04 2021 GMT',41 },42 },43 },44 path: '/my/path',45 protocol: 'HTTP/1.1',46 requestId: 'id=',47 requestTime: '04/Mar/2020:19:15:17 +0000',48 requestTimeEpoch: 1583349317135,49 resourcePath: '/my/path',50 stage: '$default',51 },52 pathParameters: {},53 stageVariables: {},54 body: null,55 isBase64Encoded: false,56}5758const baseV2Event: LambdaEvent = {59 version: '2.0',60 routeKey: '$default',61 rawPath: '/my/path',62 rawQueryString: '',63 cookies: [],64 headers: {},65 queryStringParameters: {},66 requestContext: {67 accountId: '123456789012',68 apiId: 'api-id',69 authentication: null,70 authorizer: {},71 domainName: 'id.execute-api.us-east-1.amazonaws.com',72 domainPrefix: 'id',73 http: {74 method: 'POST',75 path: '/my/path',76 protocol: 'HTTP/1.1',77 sourceIp: '192.0.2.1',78 userAgent: 'agent',79 },80 requestId: 'id',81 routeKey: '$default',82 stage: '$default',83 time: '12/Mar/2020:19:03:58 +0000',84 timeEpoch: 1583348638390,85 },86 body: null,87 pathParameters: {},88 isBase64Encoded: false,89 stageVariables: {},90}9192describe('isContentTypeBinary', () => {93 it.each([94 ['image/png', true],95 ['font/woff2', true],96 ['image/svg+xml', false],97 ['image/svg+xml; charset=UTF-8', false],98 ['text/plain', false],99 ['text/plain; charset=UTF-8', false],100 ['text/css', false],101 ['text/javascript', false],102 ['application/json', false],103 ['application/ld+json', false],104 ['application/json', false],105 ['application/vnd.openxmlformats-officedocument.wordprocessingml.document', true],106 ['application/msword', true],107 ['application/epub+zip', true],108 ['application/ld+json', false],109 ['application/vnd.oasis.opendocument.text', true],fix(aws-lambda): treat binary +xml archive media types as binary (#5424)Yusuke Wadabefore adoption0d86899
lines 110–115why, one step back110 ['application/vnd.apple.installer+xml', true],111 ['application/vnd.apple.installer+xml; charset=UTF-8', true],112 ['application/vnd.mozilla.xul+xml', true],113 ['APPLICATION/VND.APPLE.INSTALLER+XML', true],114 ['APPLICATION/JSON', false],115 ['TEXT/PLAIN', false],fix(jwt): support single-line PEM keys (#4889)Hiển Đào Vinhbefore adoption18fe604
lines 116–127why, one step back116 ])('Should determine whether %s it is binary', (mimeType: string, expected: boolean) => {117 expect(defaultIsContentTypeBinary(mimeType)).toBe(expected)118 })119})120121describe('isContentEncodingBinary', () => {122 it('Should determine whether it is compressed', () => {123 expect(isContentEncodingBinary('gzip')).toBe(true)124 expect(isContentEncodingBinary('compress')).toBe(true)125 expect(isContentEncodingBinary('deflate')).toBe(true)126 expect(isContentEncodingBinary('br')).toBe(true)127 expect(isContentEncodingBinary('deflate, gzip')).toBe(true)fix(aws-lambda): treat any non-identity content-encoding as binary (#5101)Yusuke Wadabefore adoptionb93a254
line 128why, one step back128 expect(isContentEncodingBinary('zstd')).toBe(true)fix(jwt): support single-line PEM keys (#4889)Hiển Đào Vinhbefore adoption18fe604
line 129why, one step back129 expect(isContentEncodingBinary('')).toBe(false)fix(aws-lambda): treat any non-identity content-encoding as binary (#5101)Yusuke Wadabefore adoptionb93a254
lines 130–131why, one step back130 expect(isContentEncodingBinary('identity')).toBe(false)131 expect(isContentEncodingBinary(null)).toBe(false)fix(jwt): support single-line PEM keys (#4889)Hiển Đào Vinhbefore adoption18fe604
lines 132–277why, one step back132 })133})134135describe('EventProcessor.createResult with contentTypesAsBinary', () => {136 const event = baseV1Event137138 it('Should encode as base64 when content-type is in contentTypesAsBinary array', async () => {139 const processor = getProcessor(event)140 const response = new Response('test content', {141 headers: { 'content-type': 'application/custom' },142 })143144 const result = await processor.createResult(event, response, {145 isContentTypeBinary: (contentType: string) => contentType === 'application/custom',146 })147148 expect(result.isBase64Encoded).toBe(true)149 expect(result.body).toBe('dGVzdCBjb250ZW50')150 })151152 it('Should not encode as base64 when content-type is not in isContentTypeBinary array', async () => {153 const processor = getProcessor(event)154 const response = new Response('test content', {155 headers: { 'content-type': 'application/json' },156 })157158 const result = await processor.createResult(event, response, {159 isContentTypeBinary: (contentType: string) => contentType === 'application/custom',160 })161162 expect(result.isBase64Encoded).toBe(false)163 expect(result.body).toBe('test content')164 })165166 it('Should use defaultIsContentTypeBinary when isContentTypeBinary is undefined with binary content', async () => {167 const processor = getProcessor(event)168 const response = new Response('test image content', {169 headers: { 'content-type': 'image/png' },170 })171172 // Pass undefined for isContentTypeBinary to test default behavior173 const result = await processor.createResult(event, response, {174 isContentTypeBinary: undefined,175 })176177 expect(result.isBase64Encoded).toBe(true)178 expect(result.body).toBe('dGVzdCBpbWFnZSBjb250ZW50')179 })180181 it('Should use defaultIsContentTypeBinary when isContentTypeBinary is undefined with non-binary content', async () => {182 const processor = getProcessor(event)183 const response = new Response('test text content', {184 headers: { 'content-type': 'text/plain' },185 })186187 // Pass undefined for isContentTypeBinary to test default behavior188 const result = await processor.createResult(event, response, {189 isContentTypeBinary: undefined,190 })191192 expect(result.isBase64Encoded).toBe(false)193 expect(result.body).toBe('test text content')194 })195})196197describe('EventProcessor.createRequest', () => {198 it('Should preserve percent-encoded values in query string for version 1.0', () => {199 const event: LambdaEvent = {200 ...baseV1Event,201 // API Gateway provides decoded values202 multiValueQueryStringParameters: {203 path: ['/book/{bookId}/'], // Originally %7BbookId%7D204 name: ['John Doe'], // Originally John%20Doe205 tag: ['日本語'], // Originally %E6%97%A5%E6%9C%AC%E8%AA%9E206 },207 }208209 const processor = getProcessor(event)210 const request = processor.createRequest(event)211212 // URL should contain properly encoded values213 expect(request.url).toEqual(214 'https://id.execute-api.us-east-1.amazonaws.com/my/path?path=%2Fbook%2F%7BbookId%7D%2F&name=John%20Doe&tag=%E6%97%A5%E6%9C%AC%E8%AA%9E'215 )216 })217218 it('Should handle special characters correctly in queryStringParameters for version 1.0', () => {219 const event: LambdaEvent = {220 ...baseV1Event,221 queryStringParameters: {222 'key with spaces': 'value with spaces',223 'special!@#$%^&*()': 'chars!@#$%^&*()',224 equals: 'a=b=c',225 ampersand: 'a&b&c',226 },227 }228229 const processor = getProcessor(event)230 const request = processor.createRequest(event)231232 // Verify the URL is properly encoded233 const url = new URL(request.url)234 expect(url.searchParams.get('key with spaces')).toBe('value with spaces')235 expect(url.searchParams.get('special!@#$%^&*()')).toBe('chars!@#$%^&*()')236 expect(url.searchParams.get('equals')).toBe('a=b=c')237 expect(url.searchParams.get('ampersand')).toBe('a&b&c')238 })239240 it('Should return valid Request object from version 1.0 API Gateway event', () => {241 const event: LambdaEvent = {242 ...baseV1Event,243 headers: {244 'content-type': 'application/json',245 header1: 'value1',246 header2: 'value1',247 },248 multiValueHeaders: {249 header1: ['value1'],250 header2: ['value1', 'value2', 'value3'],251 },252 // This value doesn't match multi value's content.253 // We want to assert handler is using the multi value's content when both are available.254 queryStringParameters: {255 parameter2: 'value',256 },257 multiValueQueryStringParameters: {258 parameter1: ['value1', 'value2'],259 parameter2: ['value'],260 },261 }262263 const processor = getProcessor(event)264 const request = processor.createRequest(event)265266 expect(request.method).toEqual('GET')267 // Note: Values are now properly encoded268 expect(request.url).toEqual(269 'https://id.execute-api.us-east-1.amazonaws.com/my/path?parameter1=value1¶meter1=value2¶meter2=value'270 )271 expect(Object.fromEntries(request.headers)).toEqual({272 'content-type': 'application/json',273 header1: 'value1',274 header2: 'value1, value2, value3',275 })276 })277Merge commit from forkYusuke Wadabefore adoptionaa92177
lines 278–294why, one step back278 it('Should preserve every repeated header value for version 1.0 API Gateway event', () => {279 const event: LambdaEvent = {280 ...baseV1Event,281 headers: {282 'x-forwarded-for': '203.0.113.10',283 },284 multiValueHeaders: {285 'x-forwarded-for': ['203.0.113.1', '203.0.113.10'],286 },287 }288289 const processor = getProcessor(event)290 const request = processor.createRequest(event)291292 expect(request.headers.get('x-forwarded-for')).toEqual('203.0.113.1, 203.0.113.10')293 })294fix(jwt): support single-line PEM keys (#4889)Hiển Đào Vinhbefore adoption18fe604
lines 295–326why, one step back295 it('Should return valid Request object from version 2.0 API Gateway event', () => {296 const event: LambdaEvent = {297 ...baseV2Event,298 rawQueryString: 'parameter1=value1¶meter1=value2¶meter2=value',299 cookies: ['cookie1', 'cookie2'],300 headers: {301 'content-type': 'application/json',302 header1: 'value1',303 header2: 'value1,value2',304 },305 queryStringParameters: {306 parameter1: 'value1,value2',307 parameter2: 'value',308 },309 body: 'Hello from Lambda',310 pathParameters: {311 parameter1: 'value1',312 },313 stageVariables: {314 stageVariable1: 'value1',315 stageVariable2: 'value2',316 },317 }318319 const processor = getProcessor(event)320 const request = processor.createRequest(event)321322 expect(request.method).toEqual('POST')323 expect(request.url).toEqual(324 'https://id.execute-api.us-east-1.amazonaws.com/my/path?parameter1=value1¶meter1=value2¶meter2=value'325 )326 expect(Object.fromEntries(request.headers)).toEqual({Merge commit from forkYusuke Wadabefore adoptionfa5f9bf
line 327why, one step back327 'content-length': '17',fix(jwt): support single-line PEM keys (#4889)Hiển Đào Vinhbefore adoption18fe604
lines 328–372why, one step back328 'content-type': 'application/json',329 cookie: 'cookie1; cookie2',330 header1: 'value1',331 header2: 'value1,value2',332 })333 })334335 it('Should return valid Request object from version 2.0 Lattice event', async () => {336 const event: LatticeProxyEventV2 = {337 version: '2.0',338 // query string parameters from the path take precedence over the explicit notation below339 path: '/my/path?parameter1=value1¶meter1=value2¶meter2=value',340 method: 'POST',341 headers: {342 cookie: ['cookie1=value1; cookie2=value2'],343 'content-type': ['application/x-www-form-urlencoded'],344 header1: ['value1'],345 header2: ['value1', 'value2'],346 host: ['my-service-a1b2c3.x1y2z3.vpc-lattice-svcs.us-east-1.on.aws'],347 },348 queryStringParameters: {349 parameter1: ['value1', 'value2'],350 parameter2: ['value'],351 },352 body: 'SGVsbG8gZnJvbSBMYW1iZGE=',353 isBase64Encoded: true,354 requestContext: {355 serviceNetworkArn: '',356 serviceArn: '',357 targetGroupArn: '',358 identity: {},359 region: 'us-east-1',360 timeEpoch: '1583348638390123',361 },362 }363364 const processor = getProcessor(event)365 const request = processor.createRequest(event)366367 expect(await request.text()).toEqual('Hello from Lambda')368 expect(request.method).toEqual('POST')369 expect(request.url).toEqual(370 'https://my-service-a1b2c3.x1y2z3.vpc-lattice-svcs.us-east-1.on.aws/my/path?parameter1=value1¶meter1=value2¶meter2=value'371 )372 expect(Object.fromEntries(request.headers)).toEqual({Merge commit from forkYusuke Wadabefore adoptionfa5f9bf
line 373why, one step back373 'content-length': '17',fix(jwt): support single-line PEM keys (#4889)Hiển Đào Vinhbefore adoption18fe604
lines 374–379why, one step back374 'content-type': 'application/x-www-form-urlencoded',375 cookie: 'cookie1=value1; cookie2=value2',376 header1: 'value1',377 header2: 'value1, value2',378 host: 'my-service-a1b2c3.x1y2z3.vpc-lattice-svcs.us-east-1.on.aws',379 })Merge commit from forkYusuke Wadabefore adoptionaa92177
lines 380–407why, one step back380 })381382 it('Should preserve every repeated header value for Lattice event', async () => {383 const event: LatticeProxyEventV2 = {384 version: '2.0',385 path: '/my/path',386 method: 'GET',387 headers: {388 host: ['example.test'],389 'x-forwarded-for': ['203.0.113.1', '203.0.113.10'],390 },391 queryStringParameters: {},392 body: null,393 isBase64Encoded: false,394 requestContext: {395 serviceNetworkArn: '',396 serviceArn: '',397 targetGroupArn: '',398 identity: {},399 region: 'us-east-1',400 timeEpoch: '1583348638390123',401 },402 }403404 const processor = getProcessor(event)405 const request = processor.createRequest(event)406407 expect(request.headers.get('x-forwarded-for')).toEqual('203.0.113.1, 203.0.113.10')fix(jwt): support single-line PEM keys (#4889)Hiển Đào Vinhbefore adoption18fe604
lines 408–428why, one step back408 })409410 describe('non-ASCII header value processing', () => {411 it('Should encode non-ASCII header values with encodeURIComponent', async () => {412 const event: LambdaEvent = {413 ...baseV1Event,414 headers: {415 'x-city': '炎', // Non-ASCII character416 },417 }418419 const processor = getProcessor(event)420 const request = processor.createRequest(event)421422 const xCity = request.headers.get('x-city') ?? ''423 expect(decodeURIComponent(xCity)).toBe('炎')424 })425 })426})427428describe('handle', () => {fix(aws-lambda): detect V2 events by request context, not rawPath alone (#5033)VIhaanbefore adoption45b081b
lines 429–446why, one step back429 it('Should route a V1 REST event by its path even when a base path mapping adds rawPath', async () => {430 const app = new Hono()431 app.get('/my/path', (c) => c.text('Hello'))432 const handler = handle(app)433434 // A custom domain base path mapping makes API Gateway add a `rawPath` to the435 // V1 (REST API) event, holding the path before the mapping was stripped. The436 // event is still V1: it carries `path` and a V1 request context with no `http`.437 const event: LambdaEvent = {438 ...baseV1Event,439 rawPath: '/base/my/path',440 }441442 const result = await handler(event)443 expect(result.statusCode).toBe(200)444 expect(result.body).toBe('Hello')445 })446fix(jwt): support single-line PEM keys (#4889)Hiển Đào Vinhbefore adoption18fe604
lines 447–472why, one step back447 it('Should return 400 when request contains invalid header names (v2)', async () => {448 const app = new Hono()449 app.get('/my/path', (c) => c.text('Hello'))450 const handler = handle(app)451452 const event: LambdaEvent = {453 ...baseV2Event,454 headers: {455 'valid-header': 'value',456 'a"a': 'invalid header name',457 },458 requestContext: {459 ...baseV2Event.requestContext,460 http: {461 method: 'GET',462 path: '/my/path',463 protocol: 'HTTP/1.1',464 sourceIp: '192.0.2.1',465 userAgent: 'agent',466 },467 },468 }469470 const result = await handler(event)471 expect(result.statusCode).toBe(400)472 expect(result.body).toBe('Invalid request')Merge commit from forkYusuke Wadabefore adoption7ae7cba
lines 473–529why, one step back473 })474475 it('ALB single-header: emits the first Set-Cookie intact, never comma-joined', async () => {476 const app = new Hono()477 app.get('/multi-cookie', (c) => {478 setCookie(c, 'session', 'abc123', { expires: new Date('2026-06-09T00:00:00Z') })479 setCookie(c, 'csrf', 'xyz789', { expires: new Date('2026-06-10T00:00:00Z') })480 return c.text('ok')481 })482 const handler = handle(app)483484 const event = {485 httpMethod: 'GET',486 path: '/multi-cookie',487 headers: { host: 'app.example.com' },488 body: null,489 isBase64Encoded: false,490 requestContext: { elb: { targetGroupArn: 'arn:aws:elasticloadbalancing:...' } },491 } as unknown as LambdaEvent492493 const result = await handler(event)494495 expect(result.headers!['set-cookie']).toBe(496 'session=abc123; Path=/; Expires=Tue, 09 Jun 2026 00:00:00 GMT'497 )498 })499500 it('Lattice v2: emits multiple Set-Cookie as an array', async () => {501 const app = new Hono()502 app.get('/multi-cookie', (c) => {503 setCookie(c, 'session', 'abc123')504 setCookie(c, 'csrf', 'xyz789')505 return c.text('ok')506 })507 const handler = handle(app)508509 const event: LatticeProxyEventV2 = {510 version: '2.0',511 path: '/multi-cookie',512 method: 'GET',513 headers: { host: ['app.example.com'] },514 queryStringParameters: {},515 body: null,516 isBase64Encoded: false,517 requestContext: {518 serviceNetworkArn: '',519 serviceArn: 'arn:aws:vpc-lattice:us-east-1:123456789012:service/svc-0a40',520 targetGroupArn: '',521 identity: {},522 region: 'us-east-1',523 timeEpoch: '1583348638390123',524 },525 }526527 const result = await handler(event)528529 expect(result.headers!['set-cookie']).toEqual(['session=abc123; Path=/', 'csrf=xyz789; Path=/'])fix(jwt): support single-line PEM keys (#4889)Hiển Đào Vinhbefore adoption18fe604
lines 530–549why, one step back530 })531532 it('Should return 400 when request contains invalid header names (v1)', async () => {533 const app = new Hono()534 app.get('/my/path', (c) => c.text('Hello'))535 const handler = handle(app)536537 const event: LambdaEvent = {538 ...baseV1Event,539 headers: {540 'a"a': 'invalid header name',541 },542 multiValueHeaders: {543 'a"a': ['invalid header name'],544 },545 }546547 const result = await handler(event)548 expect(result.statusCode).toBe(400)549 expect(result.body).toBe('Invalid request')Merge commit from forkYusuke Wadabefore adoptionfa5f9bf
lines 550–579why, one step back550 })551552 it('Should enforce bodyLimit when the client understates Content-Length', async () => {553 const app = new Hono()554 app.post(555 '/upload',556 bodyLimit({ maxSize: 1024, onError: (c) => c.text('too large', 413) }),557 async (c) => c.json({ received: (await c.req.text()).length })558 )559 const handler = handle(app)560561 const event: LambdaEvent = {562 ...baseV2Event,563 rawPath: '/upload',564 headers: { 'content-type': 'text/plain', 'content-length': '1' },565 body: 'A'.repeat(10000),566 requestContext: {567 ...baseV2Event.requestContext,568 http: {569 method: 'POST',570 path: '/upload',571 protocol: 'HTTP/1.1',572 sourceIp: '192.0.2.1',573 userAgent: 'agent',574 },575 },576 }577578 const result = await handler(event)579 expect(result.statusCode).toBe(413)fix(aws-lambda): add jwt and lambda authorizer types for API Gateway v2 (#5142)Jason Gbefore adoptione36f57d
lines 580–637why, one step back580 })581})582583describe('V2 request context authorizer', () => {584 const baseV2RequestContext = baseV2Event.requestContext as ApiGatewayRequestContextV2585586 it('Should expose the context of a Lambda (REQUEST) authorizer', async () => {587 const app = new Hono<{ Bindings: { event: APIGatewayProxyEventV2 } }>()588 app.get('/my/path', (c) => c.json(c.env.event.requestContext.authorizer.lambda))589 const handler = handle(app)590591 const event: LambdaEvent = {592 ...baseV2Event,593 requestContext: {594 ...baseV2RequestContext,595 http: { ...baseV2RequestContext.http, method: 'GET' },596 authorizer: { lambda: { userId: 'user-123', isAdmin: true } },597 },598 }599600 const result = await handler(event)601 expect(result.statusCode).toBe(200)602 expect(JSON.parse(result.body)).toEqual({ userId: 'user-123', isAdmin: true })603 })604605 it('Should expose the claims and scopes of a JWT authorizer', async () => {606 const app = new Hono<{ Bindings: { event: APIGatewayProxyEventV2 } }>()607 app.get('/my/path', (c) => c.json(c.env.event.requestContext.authorizer.jwt))608 const handler = handle(app)609610 const event: LambdaEvent = {611 ...baseV2Event,612 requestContext: {613 ...baseV2RequestContext,614 http: { ...baseV2RequestContext.http, method: 'GET' },615 authorizer: {616 jwt: { claims: { sub: 'user-123', email_verified: true }, scopes: ['read'] },617 },618 },619 }620621 const result = await handler(event)622 expect(result.statusCode).toBe(200)623 expect(JSON.parse(result.body)).toEqual({624 claims: { sub: 'user-123', email_verified: true },625 scopes: ['read'],626 })627 })628629 it('Should type each authorizer variant as optional', () => {630 const authorizer: ApiGatewayRequestContextV2['authorizer'] = {}631 expectTypeOf(authorizer.lambda).toEqualTypeOf<Record<string, unknown> | null | undefined>()632 expectTypeOf(authorizer.jwt).toEqualTypeOf<633 | { claims: Record<string, string | number | boolean | string[]>; scopes: string[] | null }634 | undefined635 >()636 // A JWT authorizer reports no scopes as `null`.637 expectTypeOf<null>().toMatchTypeOf<NonNullable<typeof authorizer.jwt>['scopes']>()fix(jwt): support single-line PEM keys (#4889)Hiển Đào Vinhbefore adoption18fe604
lines 638–639why, one step back638 })639})