Skip to content
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

Fix Part of #5084: Initialize Appcheck #5115

Merged
merged 111 commits into from
Feb 13, 2024
Merged

Conversation

adhiamboperes
Copy link
Collaborator

@adhiamboperes adhiamboperes commented Aug 1, 2023

Explanation

Fixes Part of #5084. This is PR 6 of 6 Planned PRs.

This PR adds Firebase AppCheck and Play Integrity dependencies to the project. It also initializes AppCheck.

Once a new production build is released with this commit, requests to all our Firebase resources will include an attestation token, and we will be able to begin monitoring the type of requests we receive. We will use this data to inform when we will fully enforce AppCheck for all Firebase access, after gaining an understanding of how many active users would be impacted(unable to upload logs to Firestore).

To test this, I added a debug token to the firebase console, to be used to verify our requests to Firestore.

Screenshot 2024-01-24 at 09 33 25 Screenshot 2024-01-24 at 09 45 54

The Appcheck console

Screenshot 2024-01-24 at 09 06 17 Screenshot 2024-01-24 at 09 06 02 Screenshot 2024-01-24 at 09 05 48

Test on the release token fetch

Screenshot 2024-01-24 at 08 57 10

Essential Checklist

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

For UI-specific PRs only

If your PR includes UI-related changes, then:

  • Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes
  • For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see RTL guide)
  • Add a video showing the full UX flow with a screen reader enabled (see accessibility guide)
  • Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing

Some of the production code was updated in the previous commit.
These scenarios are covered in other tests so I'm fine with not trying to make them work.
This commit sets up the logging infrastructure, including tests.

Since Firestore is introduced, some tests in the app module may be broken, and will be fixed in the next commit.

This commit soes not handle actual upload to firestore yet, because firebase auth is not yet properly configured.
This new controller provides functionality to retrieve the current signed in user and also sign in user anonymously, and can be called from anywhere. This decouples authentication from a firestore-only use case.

The implementation relies on an AuthenticationListener to switch out the real and fake authentication controllers for testing purposes.

This commit has not included the Auth module in app module test files(Fragment/Acticity tests), hence these will fail to build with a dagger error. This is fixed in the subsequent commit.
Base automatically changed from nps-optional-response-upload to develop January 26, 2024 22:31
Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @adhiamboperes! Largely LGTM, just had a few follow-up comments (most of which I think might be on base code that was submitted).

Feel free to submit once comments are addressed, or re-assign me if you'd like another pass.

Copy link

oppiabot bot commented Jan 31, 2024

Assigning @seanlip for code owner reviews. Thanks!

@adhiamboperes
Copy link
Collaborator Author

Addressed all review comments. PTAL @BenHenning.

@seanlip seanlip removed their assignment Feb 6, 2024
@seanlip
Copy link
Member

seanlip commented Feb 6, 2024

@adhiamboperes I'm not totally sure why I'm assigned to this. Do I need to do anything here?

@adhiamboperes
Copy link
Collaborator Author

@seanlip, I think you were assigned as code owner when Ben was out (old PR). There is nothing for you to do.

Copy link
Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @adhiamboperes! Just had one follow-up comment, so the PR overall LGTM. Please feel free to merge whenever the latest comment is addressed.

Copy link

oppiabot bot commented Feb 6, 2024

Assigning @seanlip for code owner reviews. Thanks!

@seanlip seanlip removed their assignment Feb 7, 2024
@adhiamboperes adhiamboperes enabled auto-merge (squash) February 13, 2024 00:18
@adhiamboperes adhiamboperes merged commit f7b9260 into develop Feb 13, 2024
43 checks passed
@adhiamboperes adhiamboperes deleted the configure-appcheck branch February 13, 2024 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants