-
Notifications
You must be signed in to change notification settings - Fork 891
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
use fake "owner" credential when rtdb emulator env var is set #2029
Conversation
Hrm... I guess I have several interrelated questions...
|
The use case we want to support here is to enable the emulators in environments where we can't get a production access token (e.g., CI). The issue I'm trying to work around in this PR is that we're using a single global application credential for all emulators. I just talked offline with @ryanpbrewster and @yuchenshi and I think one path forward is to enforce the following policy in the admin sdk: if either Apologies for the back-and-forth on this. |
Per chat discussion, if we move forward with this approach, I think the special handling for RTDB should probably live in a new EmulatorAuthTokenProvider class akin to
|
Co-Authored-By: Yuchen Shi <yuchenshi@google.com>
When this is ready for another review, can you please assign it to me? |
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 this mostly LGTM but a couple minor suggestions. Let me know what you think.
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 with one final nit. Thanks!
* omit access token exchange if talking to an emulator * [AUTOMATED]: Prettier Code Styling * create TokenProvider interface and add EmulatorAuthTokenProvider * [AUTOMATED]: Prettier Code Styling * Update packages/database/src/core/EmulatorAuthTokenProvider.ts Co-Authored-By: Yuchen Shi <yuchenshi@google.com> * break circular dependency by extracting env var constant * [AUTOMATED]: Prettier Code Styling * rename AuthTokenProvider -> FirebaseAuthTokenProvider etc. * [AUTOMATED]: Prettier Code Styling * fix ReadOnlyRestClient constructor comment * poke travis CI * remove unnecessary js docs
Today, the RTDB emulator accepts any production access token. We would like to support fully-offline emulator interaction that doesn't require an external auth provider. Some questions to follow up on:
RepoInfo
class?ns
query parameter is needed (RepoInfo#needsQueryParam
)?