feat(auth): Add support for Auth Emulator - #1044
Conversation
|
BTW awesome work, will take a detailed pass later once we settle the bigger picture questions |
yuchenshi
left a comment
There was a problem hiding this comment.
LGTM (pending verifyIdToken change)
hiranya911
left a comment
There was a problem hiding this comment.
Looks mostly good. I've made some suggestions on cleaning up the implementation and improving the test coverage.
| private readonly shortNameArticle: string; | ||
|
|
||
| constructor(private clientCertUrl: string, private algorithm: string, | ||
| constructor(private clientCertUrl: string, private algorithm: jwt.Algorithm, |
There was a problem hiding this comment.
This really ought to accept an options object. But it's ok to do that later.
| * @inheritDoc | ||
| */ | ||
| public getAccountId(): Promise<string> { | ||
| return Promise.resolve('firebase-auth-emulator@example.com'); |
There was a problem hiding this comment.
I'm not so sure about this ... could we do something better here?
There was a problem hiding this comment.
This is probably the best thing we can do
|
@yuchenshi and @hiranya911 thank you both for your comments, I got the code into a much cleaner state where |
hiranya911
left a comment
There was a problem hiding this comment.
Thanks. This looks pretty good. Just a bunch of nits and cleanup suggestions. Lets use single quotes around string literals everywhere.
hiranya911
left a comment
There was a problem hiding this comment.
LGTM with a suggestion.
|
❤️❤️❤️❤️❤️❤️ |
|
Thank you for implementing the emulator! Good work! |
* Basic URL replacement and custom tokens * Fix test * Tests actually pass * Mock verifyIdToken * Add another test * Small style change * Small simplification * Significant cleanup of all the useEmulator stuff * Make sure we don't use env var to short-circuit ID Token verification * Make lint pass * Add unit tests that go through the Auth interface * Hiranya nits * Make private method even more private and scary, require env * Make the private method throw * Fix test
Discussion
For Googlers: this design doc explains the behavior changes and security implications.
verifyIdTokenTesting
API Changes
N/A
RELEASE NOTE: Added support for Firebase Auth Emulator.