Skip to content

Implement platform logging for App Check #2619

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 2 commits into from
Apr 27, 2021
Merged

Implement platform logging for App Check #2619

merged 2 commits into from
Apr 27, 2021

Conversation

rosalyntan
Copy link
Member

No description provided.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 23, 2021

Coverage Report

Affected SDKs

  • firebase-appcheck

    SDK overall coverage changed from 83.17% (1cbfea5) to 83.37% (ed65901d) by +0.20%.

    Filename Base (1cbfea5) Head (ed65901d) Diff
    DefaultFirebaseAppCheck.java 83.58% 83.33% -0.25%
    NetworkClient.java 97.44% 95.45% -1.98%
  • firebase-appcheck-debug

    SDK overall coverage changed from 81.43% (1cbfea5) to 83.08% (ed65901d) by +1.65%.

    Filename Base (1cbfea5) Head (ed65901d) Diff
    DebugAppCheckProvider.java 80.43% 82.93% +2.49%
  • firebase-appcheck-safetynet

    SDK overall coverage changed from 82.19% (1cbfea5) to 82.61% (ed65901d) by +0.42%.

    Filename Base (1cbfea5) Head (ed65901d) Diff
    SafetyNetAppCheckProvider.java 81.25% 81.67% +0.42%

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 (ed65901d) is created by Prow via merging commits: 1cbfea5 2fbeb17.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 23, 2021

Binary Size Report

Affected SDKs

  • firebase-appcheck

    Type Base (1cbfea5) Head (ed65901d) Diff
    aar 32.2 kB 33.2 kB +1.02 kB (+3.2%)
    apk (aggressive) 284 kB 284 kB +160 B (+0.1%)
    apk (release) 935 kB 935 kB +492 B (+0.1%)
  • firebase-appcheck-debug

    Type Base (1cbfea5) Head (ed65901d) Diff
    aar 11.0 kB 10.8 kB -195 B (-1.8%)
    apk (aggressive) 284 kB 284 kB +160 B (+0.1%)
    apk (release) 938 kB 938 kB +52 B (+0.0%)
  • firebase-appcheck-safetynet

    Type Base (1cbfea5) Head (ed65901d) Diff
    aar 11.5 kB 11.4 kB -173 B (-1.5%)
    apk (aggressive) 284 kB 285 kB +160 B (+0.1%)
    apk (release) 947 kB 947 kB +480 B (+0.1%)

Test Logs

Notes

Head commit (ed65901d) is created by Prow via merging commits: 1cbfea5 2fbeb17.

@rosalyntan rosalyntan marked this pull request as ready for review April 26, 2021 23:22
Comment on lines +66 to +71
public NetworkClient(@NonNull FirebaseApp firebaseApp) {
checkNotNull(firebaseApp);
this.firebaseAppCheck = (DefaultFirebaseAppCheck) FirebaseAppCheck.getInstance(firebaseApp);
this.apiKey = firebaseApp.getOptions().getApiKey();
this.appId = firebaseApp.getOptions().getApplicationId();
this.projectId = firebaseApp.getOptions().getProjectId();
Copy link
Member

Choose a reason for hiding this comment

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

Consider go/di-practices/inject-direct-dependencies

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the link! I passed FirebaseApp directly into NetworkClient to avoid adding the :appcheck:firebase-appcheck-interop dependency to firebase-appcheck-safetynet.gradle and firebase-appcheck-debug.gradle (for accessing FirebaseAppCheck#getInstance).

I think it's fine to add the interop dependency, but it seems cleaner to only have that dependency in the core App Check SDK.

Copy link
Member

Choose a reason for hiding this comment

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

I see, one thing I would suggest is to consider injecting the NetworkClient via firebase components instead of having both safetynet and debug sdks creating instantiating it on their own. This would also allow you to register both of these sdks with the platform logging user-agent.

(Optional)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ack, that makes sense! I've filed b/186549222 to follow up on this in a future PR.

Copy link
Member

@vkryachko vkryachko left a comment

Choose a reason for hiding this comment

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

Overall LGTM,

Please get a review by @VinayGuthal before merging

Comment on lines +66 to +71
public NetworkClient(@NonNull FirebaseApp firebaseApp) {
checkNotNull(firebaseApp);
this.firebaseAppCheck = (DefaultFirebaseAppCheck) FirebaseAppCheck.getInstance(firebaseApp);
this.apiKey = firebaseApp.getOptions().getApiKey();
this.appId = firebaseApp.getOptions().getApplicationId();
this.projectId = firebaseApp.getOptions().getProjectId();
Copy link
Member

Choose a reason for hiding this comment

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

I see, one thing I would suggest is to consider injecting the NetworkClient via firebase components instead of having both safetynet and debug sdks creating instantiating it on their own. This would also allow you to register both of these sdks with the platform logging user-agent.

(Optional)

@rosalyntan rosalyntan merged commit bb1177c into master Apr 27, 2021
@rosalyntan rosalyntan deleted the rosalyntan.logs branch April 27, 2021 18:54
@firebase firebase locked and limited conversation to collaborators May 28, 2021
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.

5 participants