Skip to content

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
merged 134 commits into from
Jan 8, 2020

Conversation

ankitaj224
Copy link
Contributor

No description provided.

diwu-arete and others added 30 commits June 12, 2019 17:49
…oid SDK (#514)

* Add Firebase Segmentation SDK and some skeleton code in Firebase Android SDK

* Add Firebase Segmentation SDK and some skeleton code in Firebase Android SDK

* Address comments #1

* Address comments #1

* Address comments #2
…sts for it. (#524)

* Add type arguments in StorageTaskManager (#517)

* Output artifact list during local publishing. (#515)

This effort replaces #494.

* Implement Firebase segmentation SDK device local cache

* fix functions (#523)

* fix functions

* update minsdk version

* remove idea

* Set test type to release only in CI. (#522)

* Set test type to release only in CI.

This fixes Android Studio issue, where it is impossible to run
integration tests in debug mode.

Additionally move build type configuration to FirebaseLibraryPlugin to
avoid projects.all configuration in gradle.

* Add comment back.

* [Firebase Segmentation] Add custom installation id cache layer and tests for it.

* Add test for updating cache

* Switch to use SQLiteOpenHelper

* Minor fix to error message to match the admin sdk. (#525)

* Minor fix to error message to match the admin sdk.

In particular, it *is* allowed to have slashes, etc in field paths.

* Added clean task to smoke tests. (#527)

This change allows the smoke tests to clean all build variants created
by the infrastructure.

* Update deps to post-androidx gms versions. (#526)

* Update deps to post-androidx gms versions.

Additionally configure sources.jar for SDKs.

* Update functions-ktx deps

* Fix versions.

* unbump fiam version in fiamui-app

* Switch to use SharedPreferences from SQLite.

* Change the cache class to be singleton

* Copy firebase-firestore-ktx dependencies on firestore into its own subfolder (#528)

* Wrap shared pref commit in a async task.

* Address comments

* Bump firestore version for release (#530)

Additionally fix pom filter to exclude multidex from deps.

* Google format fix
* Implement Firebase segmentation SDK device local cache

* [Firebase Segmentation] Add custom installation id cache layer and tests for it.

* Add test for updating cache

* Switch to use SQLiteOpenHelper

* Switch to use SharedPreferences from SQLite.

* Change the cache class to be singleton

* Wrap shared pref commit in a async task.

* Address comments

* Google format fix

* Replace some deprecated code.
* Implement Firebase segmentation SDK device local cache

* [Firebase Segmentation] Add custom installation id cache layer and tests for it.

* Add test for updating cache

* Switch to use SQLiteOpenHelper

* Switch to use SharedPreferences from SQLite.

* Change the cache class to be singleton

* Wrap shared pref commit in a async task.

* Address comments

* Google format fix

* Replace some deprecated code.

* Package refactor

* nit

* nit
cache and update to Firebase Segmentation backend. CL also contains unit
tests.
(The http client is not implemented yet.)
fredquintana and others added 20 commits December 9, 2019 17:25
* Switch from using SharedPreferences to a flat file

* Fixes for multi-process access

 - switch from shared prefs to a flat file
 - protect generate Fid for cross-process and cross-thread accesses
 - make doRegistration only read the prefs once at the beginning and
   clean up the flow
 - pass the forceRefresh flag into doRegistration rather than
   storing it in a global

* revert the name of the FID prefs write call

* fix formatting issues

* Fix the cross process locking

The check if a new FID was needed was not in the critical region.

* some small changes from the review

* fix the java format and update the api file
* changed the instrumentation tests into unit tests

unit tests are easier and faster to run and debug
the unit tests are also included in the code coverage tests

* remove the FirebaseInstallations instrumentation tests

These have been moved into unit tests and so are no longer needed.
Also removed constants that are no longer referenced.

* fix a format error
An intermediate RandomAccessFile created while acquiring the lock
was not closed.

Also pulled the cross process locking logic out into a separate class.
@ankitaj224 ankitaj224 requested a review from andirayo January 7, 2020 23:49
@googlebot googlebot added the cla: yes Override cla label Jan 7, 2020
@codecov
Copy link

codecov bot commented Jan 8, 2020

Codecov Report

Merging #1099 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1099      +/-   ##
============================================
+ Coverage     58.39%   58.42%   +0.02%     
- Complexity     6325     6327       +2     
============================================
  Files           640      640              
  Lines         31401    31404       +3     
  Branches       4330     4331       +1     
============================================
+ Hits          18338    18349      +11     
+ Misses        11609    11602       -7     
+ Partials       1454     1453       -1
Impacted Files Coverage Δ Complexity Δ
.../firebase/installations/FirebaseInstallations.java 93.37% <100%> (+0.13%) 38 <3> (+1) ⬆️
...om/google/firebase/database/snapshot/LongNode.java 87.5% <0%> (-6.25%) 9% <0%> (-1%)
...va/com/google/firebase/database/core/SyncTree.java 62.25% <0%> (+0.25%) 40% <0%> (ø) ⬇️
.../java/com/google/firebase/storage/StorageTask.java 80.06% <0%> (+0.3%) 92% <0%> (+1%) ⬆️
...n/java/com/google/firebase/storage/UploadTask.java 73.26% <0%> (+1.09%) 48% <0%> (+1%) ⬆️
...abase/core/view/filter/ChildChangeAccumulator.java 74.19% <0%> (+12.9%) 12% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a727f6c...7c6985c. Read the comment docs.

Copy link
Contributor

@andirayo andirayo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! Go go go!

@@ -90,6 +90,8 @@

public static final String TEST_INSTANCE_ID_1 = "ccccccccccc";

public static final String TEST_INSTANCE_ID_TOKEN_1 = "iid.token";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iid:token (with a colon)

// Note: Default value of instanceIdMigrationAuth: null
String iidToken = null;

if (prefs.getFirebaseInstallationId().equals(iidStore.readIid())) {
Copy link
Contributor

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.

@andirayo andirayo merged commit 4ca1806 into master Jan 8, 2020
@firebase firebase locked and limited conversation to collaborators Feb 7, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Override cla size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants