-
Notifications
You must be signed in to change notification settings - Fork 626
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
Conversation
Coverage ReportAffected SDKs
Test Logs
NotesHTML coverage reports can be produced locally with Head commit (ed65901d) is created by Prow via merging commits: 1cbfea5 2fbeb17. |
Binary Size ReportAffected SDKs
Test Logs
NotesHead commit (ed65901d) is created by Prow via merging commits: 1cbfea5 2fbeb17. |
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(); |
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.
Consider go/di-practices/inject-direct-dependencies
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.
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.
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.
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)
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.
Ack, that makes sense! I've filed b/186549222 to follow up on this in a future PR.
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.
Overall LGTM,
Please get a review by @VinayGuthal before merging
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(); |
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.
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)
No description provided.