Skip to content

Send the FIS auth token in the RC fetch headers. #1646

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 11 commits into from
Jun 23, 2020
Merged

Conversation

danasilver
Copy link
Contributor

No description provided.

@googlebot googlebot added the cla: yes Override cla label Jun 12, 2020
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 12, 2020

Coverage Report

Affected SDKs

  • firebase-config

    SDK overall coverage changed from ? (cbc422e) to 88.72% (8fa5a1df) by ?.

    Click to show coverage changes in 24 files.
    Filename Base (cbc422e) Head (8fa5a1df) Diff
    Code.java ? 0.00% ?
    ConfigCacheClient.java ? 93.55% ?
    ConfigContainer.java ? 92.16% ?
    ConfigFetchHandler.java ? 97.20% ?
    ConfigFetchHttpClient.java ? 87.30% ?
    ConfigGetParameterHandler.java ? 97.50% ?
    ConfigMetadataClient.java ? 89.47% ?
    ConfigStorageClient.java ? 100.00% ?
    DefaultsXmlParser.java ? 0.00% ?
    FirebaseRemoteConfig.java ? 88.28% ?
    FirebaseRemoteConfigClientException.java ? 100.00% ?
    FirebaseRemoteConfigException.java ? 100.00% ?
    FirebaseRemoteConfigFetchException.java ? 50.00% ?
    FirebaseRemoteConfigFetchThrottledException.java ? 100.00% ?
    FirebaseRemoteConfigInfo.java ? 0.00% ?
    FirebaseRemoteConfigInfoImpl.java ? 100.00% ?
    FirebaseRemoteConfigServerException.java ? 100.00% ?
    FirebaseRemoteConfigSettings.java ? 65.63% ?
    FirebaseRemoteConfigValue.java ? 0.00% ?
    FirebaseRemoteConfigValueImpl.java ? 84.62% ?
    LegacyConfigsHandler.java ? 90.51% ?
    RemoteConfigComponent.java ? 96.36% ?
    RemoteConfigConstants.java ? 0.00% ?
    RemoteConfigRegistrar.java ? 100.00% ?
  • firebase-config-ktx

    SDK overall coverage changed from ? (cbc422e) to 100.00% (8fa5a1df) by ?.

    Filename Base (cbc422e) Head (8fa5a1df) Diff
    RemoteConfig.kt ? 100.00% ?

Test Logs

Notes

HTML coverage reports can be produced locally with ./gradlew <product>:checkCoverage.
Report files are located at <product-build-dir>/reports/jacoco/.

Head commit (8fa5a1df) is created by Prow via merging commits: cbc422e dafda53.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Jun 12, 2020

Binary Size Report

Affected SDKs

  • firebase-abt

    Type Base (cbc422e) Head (8fa5a1df) Diff
    apk (aggressive) 85.5 kB 85.5 kB +6 B (+0.0%)
    apk (debug) 895 kB 895 kB +3 B (+0.0%)
  • firebase-common

    Type Base (cbc422e) Head (8fa5a1df) Diff
    apk (aggressive) 82.7 kB 82.7 kB -1 B (-0.0%)
    apk (debug) 772 kB 771 kB -88 B (-0.0%)
  • firebase-common-ktx

    Type Base (cbc422e) Head (8fa5a1df) Diff
    apk (debug) 1.56 MB 1.56 MB -100 B (-0.0%)
  • firebase-components

    Type Base (cbc422e) Head (8fa5a1df) Diff
    apk (aggressive) 11.0 kB 11.0 kB +6 B (+0.1%)
    apk (debug) 35.8 kB 35.9 kB +33 B (+0.1%)
  • firebase-config

    Type Base (cbc422e) Head (8fa5a1df) Diff
    aar 215 kB 215 kB +72 B (+0.0%)
    apk (aggressive) 130 kB 130 kB +18 B (+0.0%)
    apk (debug) 1.05 MB 1.05 MB +254 B (+0.0%)
    apk (release) 871 kB 871 kB +142 B (+0.0%)
  • firebase-config-ktx

    Type Base (cbc422e) Head (8fa5a1df) Diff
    apk (aggressive) 320 kB 320 kB +28 B (+0.0%)
    apk (debug) 1.84 MB 1.84 MB +42 B (+0.0%)
    apk (release) 1.50 MB 1.50 MB +160 B (+0.0%)
  • firebase-installations

    Type Base (cbc422e) Head (8fa5a1df) Diff
    apk (aggressive) 84.7 kB 84.7 kB -17 B (-0.0%)
    apk (debug) 796 kB 795 kB -39 B (-0.0%)
  • firebase-installations-interop

    Type Base (cbc422e) Head (8fa5a1df) Diff
    apk (aggressive) 61.7 kB 61.7 kB -6 B (-0.0%)
    apk (debug) 744 kB 744 kB -46 B (-0.0%)

Test Logs

Notes

Head commit (8fa5a1df) is created by Prow via merging commits: cbc422e dafda53.

@danasilver danasilver force-pushed the rc-fis-token-header branch from 7cacea5 to a3735b8 Compare June 12, 2020 02:00
Base automatically changed from rc-fis-dep to master June 17, 2020 23:07
@danasilver danasilver force-pushed the rc-fis-token-header branch from a3735b8 to 4ce3c6a Compare June 18, 2020 00:00
@danasilver danasilver force-pushed the rc-fis-token-header branch from 4ce3c6a to a470ea5 Compare June 18, 2020 21:45
@danasilver
Copy link
Contributor Author

/test device-check-changed

1 similar comment
@danasilver
Copy link
Contributor Author

/test device-check-changed

Copy link

@erikeldridge erikeldridge left a comment

Choose a reason for hiding this comment

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

Nice work! 🚀

@@ -78,6 +78,8 @@
private static final String X_ANDROID_PACKAGE_HEADER = "X-Android-Package";
private static final String X_ANDROID_CERT_HEADER = "X-Android-Cert";
private static final String X_GOOGLE_GFE_CAN_RETRY = "X-Google-GFE-Can-Retry";
private static final String INSTALLATIONS_AUTH_TOKEN_HEADER =
"X-Goog-Firebase-Installations-Auth";

Choose a reason for hiding this comment

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

Thinking (no action required): this is comparable to usage of the same header in RC's iOS SDK: https://github.com/firebase/firebase-ios-sdk/blob/c07c89ee7582e84da1c5aafaa94b38a53bcfbdc2/FirebaseRemoteConfig/Sources/RCNFetch.m#L49

Choose a reason for hiding this comment

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


assertWithMessage("Fetch() failed with null instance id token!")
assertWithMessage("Fetch() failed with null installation auth token!")
Copy link

@erikeldridge erikeldridge Jun 19, 2020

Choose a reason for hiding this comment

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

Thinking (no action required): this is a public error message, so the phrasing should match the public docs. The FirebaseInstallations.getToken docs describe "authentication token for the Firebase installation", which matches the phrasing here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great callout, thank you!
We had a meeting recently with DevRel and Tech Writers and decided to name the authentication tokens for Firebase installations: "installation auth tokens".
So, the action item is probably on us in the FIS team.

@danasilver danasilver requested a review from ankitaj224 June 19, 2020 17:44
@@ -31,6 +31,10 @@
/**
* Keys of fields in the Fetch request body that the client sends to the Firebase Remote Config
* server.
*
* <p>{@code INSTANCE_ID} and {@code INSTANCE_ID_TOKEN} are legacy names for the fields that used
Copy link
Contributor

Choose a reason for hiding this comment

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

We might need some clarity here. The javadoc gives the impression that INSTANCE_ID_TOKEN can be fetched from FIS SDK, which is incorrect. We can explicitly call out INSTANCE_ID_TOKEN is replaced by installation auth token fetched from FIS SDK.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call. Updated.

@danasilver danasilver merged commit 71a4740 into master Jun 23, 2020
@danasilver danasilver deleted the rc-fis-token-header branch June 23, 2020 23:14
@firebase firebase locked and limited conversation to collaborators Jul 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes Override cla size/L
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants