CodeGenieApp / CodeGenieApp/serverless-express

Support for Cloudfront as event source

オープン
#583 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
5.3k
フォーク
676
PR マージ指標
30日以内にマージされた PR はありません

説明

I've got requests passing through a Cloudfront distribution directly to a lambda, no cache, passing all request headers with it. I'm using this approach because API Gateway and ALB are both overkill for my use-case, simply need a public endpoint with custom domain compatibility, hence Cloudfront.

Issue is that this library produces a `Unable to determine event source based on event` error in this setup. Having a look at the code it seems [here](https://github.com/vendia/serverless-express/blob/75cfbffeb3fd030695b9587a75300c7b8012ac6a/src/event-sources/utils.js#L70) that there is no conditional to detect this circumstance.

Since I'm passing all headers directly through Cloudfront, I assume that the event in this case looks a lot like it came directly from the client, rather than something triggered through another cloud service. This seems to me perhaps as a valid default case to design for in this library, in the absence of any other forwarders?

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

src/event-sources/utils.js の 70 行目付近から着手してください。ここでは、説明されている CloudFront-to-Lambda リクエストに対する event-source の検出が現在失敗しています。CloudFront がすべての headers を転送する event を再現または調査し、この直接 endpoint のケースに必要な検出動作を定義してください。"Unable to determine event source" エラーなしで event が受け入れられ、repository に tests が用意されている場合は、関連する動作が tests でカバーされれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
aws, express, javascript, node.js
領域
api, backend, cloud
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。