-
Notifications
You must be signed in to change notification settings - Fork 212
Allow callable functions to skip token verification in debug mode #983
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
Conversation
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.
lgtm, but I'd hold off merging until you get another set of eyes on it
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.
Excited!
1a51023
to
a30b2ab
Compare
8cb5e1e
to
2cc7eb9
Compare
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.
Minor questions; still LGTM. Feedback I should have given last time though: I'm not sure if the debug flag should be about "callable" functions or just a flag to disable token checks. I feel like we'd want to disable token verification everywhere if we do it anywhere (not that I have another case in mind yet)
* | ||
* Do not use in production. Token should always be verified using the Admin SDK. | ||
* | ||
* This is exposed only for testing. |
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.
And for debug mode/emulator, right?
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 think the comment is correct - this function will only be called internally. It will be executed in debug mode but will never be invoked directly.
Functions SDK now includes a debug mode that can be enabled via environment variables to operate in ways that's useful during development. See firebase/firebase-functions#983 for an example. We will turn on Debug Mode and enable `skipTokenVerification` feature on the Functions Emulator. This means that callable functions will decode but not verify the signature of Auth and App Check tokens which is more or less what the monkey-patching of Firebase Functions SDK achieves. For some function triggers, we will now rely on the debug mode instead of the monkey patching to bypass the token verification.
Functions SDK now includes a debug mode that can be enabled via environment variables to operate in ways that's useful during development. See firebase/firebase-functions#983 for an example. We will turn on Debug Mode and enable `skipTokenVerification` feature on the Functions Emulator. This means that callable functions will decode but not verify the signature of Auth and App Check tokens which is more or less what the monkey-patching of Firebase Functions SDK achieves. For some function triggers, we will now rely on the debug mode instead of the monkey patching to bypass the token verification.
Functions SDK now includes a debug mode that can be enabled via environment variables to operate in ways that's useful during development. See firebase/firebase-functions#983 for an example. We will turn on Debug Mode and enable `skipTokenVerification` feature on the Functions Emulator. This means that callable functions will decode but not verify the signature of Auth and App Check tokens which is more or less what the monkey-patching of Firebase Functions SDK achieves. For some function triggers, we will now rely on the debug mode instead of the monkey patching to bypass the token verification.
To replace monkey-patching of the Firebase Functions SDK in the Functions Emulator (code), we provide native support for bypassing token verification for
onCall
handlers.Using the new debug mode introduced in #992, Auth/App Check token included in the request will be decoded but no verified.