feat(auth): Add auth emulator support#523
Merged
Conversation
* Adds Firebase Auth emulator support for FirebaseUserManager and FirebaseTenantClient classes. * Adds tests and minor fixes
hiranya911
suggested changes
Apr 13, 2021
Contributor
hiranya911
left a comment
There was a problem hiding this comment.
Thanks @ssbushi. Looks mostly good. My main observations are:
- We should avoid duplication by adding emulator support to the existing
FirebaseTokenVerfierImplclass, as opposed to implementing a whole new class. - Avoid duplication by putting env variable lookups in a shared util.
- We need a better way to test the functionality of all APIs in emulator mode. In other languages we used techniques like test parameterization and fixtures to achieve this. We should try to find an equivalent strategy for junit4 (although it's ok to do so in a separate PR).
src/main/java/com/google/firebase/auth/FirebaseEmulatorTokenVerifier.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/firebase/auth/FirebaseUserManager.java
Outdated
Show resolved
Hide resolved
src/main/java/com/google/firebase/auth/FirebaseUserManager.java
Outdated
Show resolved
Hide resolved
src/test/java/com/google/firebase/auth/multitenancy/FirebaseTenantClientTest.java
Show resolved
Hide resolved
src/test/java/com/google/firebase/auth/FirebaseTokenVerifierImplTest.java
Outdated
Show resolved
Hide resolved
src/test/java/com/google/firebase/auth/FirebaseEmulatorTokenVerifierTest.java
Outdated
Show resolved
Hide resolved
ssbushi
commented
Apr 14, 2021
src/test/java/com/google/firebase/auth/FirebaseTokenVerifierImplTest.java
Show resolved
Hide resolved
hiranya911
suggested changes
Apr 14, 2021
Contributor
hiranya911
left a comment
There was a problem hiding this comment.
Thanks for making the changes. Looks pretty good. Just a few more minor updates needed.
src/main/java/com/google/firebase/auth/FirebaseTokenVerifierImpl.java
Outdated
Show resolved
Hide resolved
src/test/java/com/google/firebase/auth/FirebaseTokenVerifierImplTest.java
Outdated
Show resolved
Hide resolved
yuchenshi
approved these changes
Apr 15, 2021
src/test/java/com/google/firebase/auth/EmulatorFirebaseTokenVerifierImplTest.java
Outdated
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Discussion
Add support to communicate with the Auth Emulator #493.
Testing
API Changes