-
Notifications
You must be signed in to change notification settings - Fork 204
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
Add support for an authPolicy that returns Permission Denied when failed #1650
Conversation
package-lock.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was checking in package-lock intentional? I don't see a change in package.json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I couldn't successfully compile until I ran npm install
and that changed package-lock.json
src/common/providers/https.ts
Outdated
@@ -841,6 +842,14 @@ function wrapOnCallHandler<Req = any, Res = any>( | |||
} | |||
|
|||
const data: Req = decode(req.body.data); | |||
if (options.authPolicy) { | |||
// Don't ask me why, but Google decided not to disambiguate between unauthenticated and unauthorized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this true? we have permission-denied and unauthenticated:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wrote this comment before I realized better. Will delete the comment.
…led (#1650) * Add support for an authPolicy that returns Permission Denied when failed * Formatter * Changelog * remove ignorant comment
…n top-level awaits (#1651) * Use await import instead of require for functions modules that contain top-level awaits * tests ensuring that es modules with top level awaits can be loaded * adds node 22 to the CI matrix on github * Add support for an authPolicy that returns Permission Denied when failed (#1650) * Add support for an authPolicy that returns Permission Denied when failed * Formatter * Changelog * remove ignorant comment * Update streaming callable API (#1652) * Update streaming callable API * Fix linter error * Stream type defaults to unknown * Changelog * Format fix * update changelog.md --------- Co-authored-by: Thomas Bouldin <inlined@users.noreply.github.com>
Per upcoming design (and to support
onCallGenkit
callable functions' options can now support anauthPolicy
callback. Adds support for this callback, as well as two helpers:isSignedIn
andhasClaim
.