Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: google-cloud-function, can not verify payload #935

Closed
1 task done
Uzlopak opened this issue Nov 29, 2023 · 4 comments · Fixed by #937
Closed
1 task done

[BUG]: google-cloud-function, can not verify payload #935

Uzlopak opened this issue Nov 29, 2023 · 4 comments · Fixed by #937
Labels
released Type: Bug Something isn't working as documented, or is being fixed

Comments

@Uzlopak
Copy link
Contributor

Uzlopak commented Nov 29, 2023

What happened?

The request.body is already provided by gcf as an object. We expect that Lambda can provide request.body as a string but as it is an object in gcf it can not verify the request.body, because to verify the request.body is just using toString() of the object but not JSON.stringify.

Versions

v. 12.0.8

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Uzlopak Uzlopak added Status: Triage This is being looked at and prioritized Type: Bug Something isn't working as documented, or is being fixed labels Nov 29, 2023
Copy link
Contributor

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@wolfy1339 wolfy1339 removed the Status: Triage This is being looked at and prioritized label Nov 29, 2023
@wolfy1339 wolfy1339 moved this from 🆕 Triage to 🏗 In progress in 🧰 Octokit Active Nov 29, 2023
@wolfy1339
Copy link
Member

You don't have to use the middleware included, you can use your own and call the functions directly.

Maybe making the middleware more generic would work better and the exported node middleware would use the generic functions and extended for node usage.

Also, can you share en example of how you are running this on GCF?

@Uzlopak
Copy link
Contributor Author

Uzlopak commented Nov 30, 2023

Unfortunately the bot is propriatary software of my employer.

But I can prove the validity of the issue via the gcf documentation:

Cloud Functions automatically parses the request body for you based on the request's Content-Type header using body-parser, so you can access the req.body and req.rawBody objects in your HTTP handler.

Github sends the payload with content-type application/json, so gcf puts deserializes already the body and puts the javascript object into the req.body and the buffer into req.rawBody.

Copy link
Contributor

github-actions bot commented Dec 4, 2023

🎉 This issue has been resolved in version 12.0.10 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released Type: Bug Something isn't working as documented, or is being fixed
Projects
Archived in project
2 participants