-
Notifications
You must be signed in to change notification settings - Fork 616
Pass the iid token to authenticate Instance-ID migration to FIS. #1099
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
Merged
Changes from all commits
Commits
Show all changes
134 commits
Select commit
Hold shift + click to select a range
0d05282
Add Firebase Segmentation SDK and some skeleton code in Firebase Andr…
diwu-arete 8881325
Implement Firebase segmentation SDK device local cache
diwu-arete 864748f
[Firebase Segmentation] Add custom installation id cache layer and te…
diwu-arete 0a3ebf6
Add test for updating cache
diwu-arete 2d158ed
Switch to use SQLiteOpenHelper
diwu-arete f118d39
Switch to use SharedPreferences from SQLite.
diwu-arete 4da5d31
Change the cache class to be singleton
diwu-arete d1ff0ec
Wrap shared pref commit in a async task.
diwu-arete 2c5102c
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete 41fbfee
Address comments
diwu-arete 5fd2fa0
Google format fix
diwu-arete e950003
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete dc46eee
[Firebase Segmentation] Add custom installation id cache layer and te…
diwu-arete a73ebf9
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete dba0c0e
Replace some deprecated code.
diwu-arete dc37bf8
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete ebdd626
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete 8b7380d
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete f26741e
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete 1274b42
Fix some deprecations (#533)
diwu-arete 38c403f
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete a9a43a4
Package refactor
diwu-arete ca6dacf
nit
diwu-arete e7fff81
nit
diwu-arete d952003
package refactor (#534)
diwu-arete bb8bf45
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete b381889
Add the state machine of updating custom installation id in the local
diwu-arete a7b5684
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete a72cf60
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete 1adcfbd
minor format fix
diwu-arete 6091f82
Address comments #1
diwu-arete ada5577
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete fdbbdee
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete af5bcd1
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete e7fb811
Add the state machine of updating custom installation id in the local…
diwu-arete de6fb6d
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete 75e523b
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete dd16319
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete 0a794dc
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete 134f06e
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete 6a0f502
Http client in Firebase Segmentation SDK to call backend service.
diwu-arete a79cae2
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete 4ac7db5
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete 7f40978
Revert unintentional change
diwu-arete b2fc302
Fix connected device test
diwu-arete 1f2ab34
Fix connected device test
diwu-arete 402d8b6
Merge branch 'arete-floc' of github.com:firebase/firebase-android-sdk…
diwu-arete b4e11e9
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete ce698cf
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete 0e0278e
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete 9880624
1. Add a few annotations to make java code Kotlin friendly
diwu-arete 8ffb5bb
Fix java format
diwu-arete daf4698
Fix API version
diwu-arete 7985e14
Change the segmentation API implementation to synchronous and put the
diwu-arete 9f36d35
Fix a async getResult race issue.
diwu-arete 047c0af
OkHttpClient -> HttpsUrlConnection
diwu-arete 8b39c31
Use gzip for compressing content and fix ourput stream memory leak risk.
diwu-arete dc1a63c
Addressed a few comments
diwu-arete d07ec25
Http client in Firebase Segmentation SDK to call backend service. (#573)
diwu-arete 8ea4861
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete b401d31
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete 8ba1c9b
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete 64af341
Initial Code structure for FIS Android SDK (#648)
ankitaj224 b0a625c
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
ankitaj224 beccce4
Initial Code structure for FIS Android SDK (#648)
ankitaj224 915d532
Merge branch 'fis_sdk' of github.com:firebase/firebase-android-sdk in…
ankitaj224 d74f799
Initial Code structure for FIS Android SDK (#648)
ankitaj224 c38f503
Merge branch 'fis_sdk' of github.com:firebase/firebase-android-sdk in…
ankitaj224 8665301
Adding http client to call fis backend service (#659)
ankitaj224 9ac96db
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
ankitaj224 46c6614
Merge branch 'fis_sdk' of github.com:firebase/firebase-android-sdk in…
ankitaj224 143ed74
FirebaseSegmentation SDK
diwu-arete 0990fee
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete e5f0cd3
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete a5250c1
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete 16521a1
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
ankitaj224 7f30aea
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete 6daae2a
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete 4d5b2de
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete 52d259d
FirebaseSegmentation SDK changes (#673)
diwu-arete 78ce7cd
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete d467379
Restrict Firebase API key to Android app package name.
diwu-arete 33665b2
Restrict Firebase API key to Android app package name. (#690)
diwu-arete 818e471
Explicitly add internet permission
diwu-arete e2fbc88
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete f4ba63c
Arete floc (#691)
diwu-arete a7ef2db
Merge branch 'floc-master' of github.com:firebase/firebase-android-sd…
diwu-arete 47f33ec
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
ankitaj224 f86ba48
Implementing cache for FIS SDK (#694)
ankitaj224 9794e1f
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
ankitaj224 c1f7dbe
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
ankitaj224 77b6d97
Adding Util class for FIrebaseInstallations APIs. (#676)
ankitaj224 1980321
Initial Code structure for FIS Android SDK (#648)
ankitaj224 af1e510
Adding http client to call fis backend service (#659)
ankitaj224 30b48c3
Implementing cache for FIS SDK (#694)
ankitaj224 05da0b0
Adding Util class for FIrebaseInstallations APIs. (#676)
ankitaj224 8520ca8
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
ankitaj224 18a180f
Merge branch 'fis_sdk' of github.com:firebase/firebase-android-sdk in…
ankitaj224 e405108
Updating api.txt to resolve api-information presubmit check.
ankitaj224 8059184
Adding api.txt for fisbase-installations-interop
ankitaj224 b9437d6
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
ankitaj224 7ed78a4
Updating subprojects.cfg
ankitaj224 6a013fa
FIS getAuthToken implementation. (#769)
ankitaj224 5b0acbf
FID delete() implementation. (#813)
ankitaj224 aa73d95
Adding headers for Chemist to check API key restriction. (#821)
ankitaj224 ac24fae
Enabling FIS network call timeout. (#827)
ankitaj224 12ae11d
Simplifying FirebaseInstallations class by adding listeners. (#847)
ankitaj224 8e65eae
Merging changes into fis_sdk (#910)
ankitaj224 42e442f
FIS error handling (#911)
ankitaj224 98b2aac
Reuse existing Iid as Fid (#924)
ankitaj224 0c1ef2c
touch file (#993)
ChaoqunCHEN 101ee18
getAuthToken error handling for 401 & 404 response code (#961)
ankitaj224 3adccda
Renaming getAuthToken to getToken. (#1026)
ankitaj224 fdbc752
Add heartbeat to fis sdk (#1037)
VinayGuthal 56d72ee
Fixes for multi-process access (#1042)
fredquintana f866315
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete 77b0dc7
Merge branch 'fis_sdk' of github.com:firebase/firebase-android-sdk in…
diwu-arete 7d91146
Remove FirebaseSegmentation from fis_sdk branch. (was added by mistake)
diwu-arete e54a54e
Add separator line back
diwu-arete d941202
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
diwu-arete 2840a51
Update api info for FIS SDK
diwu-arete 7e59264
changed the instrumentation tests into unit tests (#1053)
fredquintana b83e5d8
Merge branch 'master' of https://github.com/firebase/firebase-android…
fredquintana f801a7e
Merge branch 'fis_sdk' of https://github.com/firebase/firebase-androi…
fredquintana e3375f2
fixed a leak when cross process locking didn't close a file
fredquintana 7f360d3
Merge branch 'master' of https://github.com/firebase/firebase-android…
fredquintana 0bae43b
Merge branch 'master' of https://github.com/firebase/firebase-android…
fredquintana ef08161
Reading the iid token from iid shared prefs.
ankitaj224 e22c3ca
Merge branch 'fis_sdk' of github.com:firebase/firebase-android-sdk in…
ankitaj224 e69bd4d
Adding iidMigrationToken in the create installation request header. …
ankitaj224 84e1716
Addressing Rayo's comments
ankitaj224 9aeb69d
Merge branch 'fis_sdk' of github.com:firebase/firebase-android-sdk in…
ankitaj224 b1b8f2f
Pass the iid token to authenticate Instance-ID migration to FIS.
ankitaj224 7c6985c
Merge branch 'master' of github.com:firebase/firebase-android-sdk int…
ankitaj224 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,6 +90,8 @@ public class FirebaseInstallationsTest { | |
|
||
public static final String TEST_INSTANCE_ID_1 = "ccccccccccc"; | ||
|
||
public static final String TEST_INSTANCE_ID_TOKEN_1 = "iid.token"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. iid:token (with a colon) |
||
|
||
public static final InstallationResponse TEST_INSTALLATION_RESPONSE = | ||
InstallationResponse.builder() | ||
.setUri("/projects/" + TEST_PROJECT_ID + "/installations/" + TEST_FID_1) | ||
|
@@ -185,6 +187,7 @@ public void testGetId_noNetwork_noIid() throws Exception { | |
when(mockBackend.generateAuthToken(anyString(), anyString(), anyString(), anyString())) | ||
.thenThrow(new IOException()); | ||
when(mockIidStore.readIid()).thenReturn(null); | ||
when(mockIidStore.readToken()).thenReturn(null); | ||
|
||
// Do the actual getId() call under test. Confirm that it returns a generated FID and | ||
// and that the FID was written to storage. | ||
|
@@ -210,11 +213,16 @@ public void testGetId_noNetwork_noIid() throws Exception { | |
@Test | ||
public void testGetId_noNetwork_iidPresent() throws Exception { | ||
when(mockBackend.createFirebaseInstallation( | ||
anyString(), anyString(), anyString(), anyString(), any())) | ||
TEST_API_KEY, | ||
TEST_INSTANCE_ID_1, | ||
TEST_PROJECT_ID, | ||
TEST_APP_ID_1, | ||
TEST_INSTANCE_ID_TOKEN_1)) | ||
.thenThrow(new IOException()); | ||
when(mockBackend.generateAuthToken(anyString(), anyString(), anyString(), anyString())) | ||
.thenThrow(new IOException()); | ||
when(mockIidStore.readIid()).thenReturn(TEST_INSTANCE_ID_1); | ||
when(mockIidStore.readToken()).thenReturn(TEST_INSTANCE_ID_TOKEN_1); | ||
|
||
// Do the actual getId() call under test. Confirm that it returns a generated FID and | ||
// and that the FID was written to storage. | ||
|
@@ -340,8 +348,9 @@ public void testGetId_UnRegisteredId_IssueCreateIdCall() throws Exception { | |
@Test | ||
public void testGetId_migrateIid_successful() throws Exception { | ||
when(mockIidStore.readIid()).thenReturn(TEST_INSTANCE_ID_1); | ||
when(mockIidStore.readToken()).thenReturn(TEST_INSTANCE_ID_TOKEN_1); | ||
when(mockBackend.createFirebaseInstallation( | ||
anyString(), anyString(), anyString(), anyString(), any())) | ||
anyString(), anyString(), anyString(), anyString(), anyString())) | ||
.thenReturn(TEST_INSTALLATION_RESPONSE_WITH_IID); | ||
|
||
// Do the actual getId() call under test. | ||
|
@@ -367,6 +376,7 @@ public void testGetId_migrateIid_successful() throws Exception { | |
@Test | ||
public void testGetId_multipleCalls_sameFIDReturned() throws Exception { | ||
when(mockIidStore.readIid()).thenReturn(null); | ||
when(mockIidStore.readToken()).thenReturn(null); | ||
when(mockBackend.createFirebaseInstallation( | ||
anyString(), anyString(), anyString(), anyString(), any())) | ||
.thenReturn(TEST_INSTALLATION_RESPONSE); | ||
|
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.
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.
Isn't reading from iidStore a complicated action?
Maybe checking the length of the identifier (e.g. == 11) is enough?
But in the end I don't care, just sharing my thoughts.