0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-29 01:32:12 +01:00

feat(lambda-edge): Add Type to request for Lambda@Edge adapter to support S3 origin (#1991)

This commit is contained in:
mosle 2024-01-16 17:39:34 +09:00 committed by GitHub
parent 1ad251c1ba
commit a00fc566e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,6 +27,17 @@ interface CloudFrontCustomOrigin {
readTimeout: number
sslProtocols: string[]
}
// https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/lambda-event-structure.html
interface CloudFrontS3Origin {
authMethod: 'origin-access-identity' | 'none'
customHeaders: CloudFrontHeaders
domainName: string
path: string
region: string
}
type CloudFrontOrigin =
| { s3: CloudFrontS3Origin; custom?: never }
| { custom: CloudFrontCustomOrigin; s3?: never }
export interface CloudFrontRequest {
clientIp: string
@ -40,9 +51,7 @@ export interface CloudFrontRequest {
encoding: string
data: string
}
origin?: {
custom: CloudFrontCustomOrigin
}
origin?: CloudFrontOrigin
}
export interface CloudFrontResponse {