-
Notifications
You must be signed in to change notification settings - Fork 281
Bluecost store #422
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
base: main
Are you sure you want to change the base?
Bluecost store #422
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello @bluecost17, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request establishes the foundational setup for a Flutter application by integrating Firebase Core and, more importantly, configuring Firebase App Check. This crucial security measure ensures that all interactions with Firebase backend services are authenticated and originate from a legitimate instance of the application, thereby protecting against abuse and unauthorized access. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a new file for initializing a Flutter application with Firebase. My review has identified several issues, including a critical security vulnerability due to a hardcoded reCAPTCHA key, a high-severity issue with using a debug provider for App Check which is not suitable for production, and a critical compilation error because of a missing import for the App widget. I have also included a medium-severity comment regarding the unconventional filename.
| await FirebaseAppCheck.instance.activate( | ||
| // You can also use a `ReCaptchaEnterpriseProvider` provider instance as an | ||
| // argument for `webProvider` | ||
| webProvider: ReCaptchaV3Provider('recaptcha-v3-site-key'), |
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.
A hardcoded reCAPTCHA v3 site key is present. Secrets like API keys should not be hardcoded in the source code as this poses a significant security risk. It is recommended to load these from a secure location, such as environment variables, at compile time.
webProvider: ReCaptchaV3Provider(const String.fromEnvironment('RECAPTCHA_V3_SITE_KEY')),
| // 4. App Attest provider with fallback to Device Check provider (App Attest provider is only available on iOS 14.0+, macOS 14.0+) | ||
| appleProvider: AppleProvider.appAttest, | ||
| ); | ||
| runApp(App()); |
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.
| // 1. Debug provider | ||
| // 2. Safety Net provider | ||
| // 3. Play Integrity provider | ||
| androidProvider: AndroidProvider.debug, |
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.
The Android App Check provider is set to AndroidProvider.debug. This is insecure for production builds as it bypasses actual device attestation. It's recommended to use a conditional provider based on the build environment, for example, using PlayIntegrity for release builds and debug only for debug builds.
androidProvider: kDebugMode ? AndroidProvider.debug : AndroidProvider.playIntegrity,
| @@ -0,0 +1,29 @@ | |||
| import 'package:flutter/material.dart'; | |||
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.
import { initializeApp } from 'firebase/app';
import { getFirestore, collection, getDocs } from 'firebase/firestore/lite';
// Follow this pattern to import other Firebase services
// import { } from 'firebase/';
// TODO: Replace the following with your app's Firebase configuration
const firebaseConfig = {
//...
};
const app = initializeApp(firebaseConfig);
const db = getFirestore(app);
// Get a list of cities from your database
async function getCities(db) {
const citiesCol = collection(db, 'cities');
const citySnapshot = await getDocs(citiesCol);
const cityList = citySnapshot.docs.map(doc => doc.data());
return cityList;
}