Skip to content

refactor: remove site key from options; require explicit pass to recaptcha provider - #16409

Merged
ncooke3 merged 7 commits into
mainfrom
nc.fac.recaptcha
Jul 17, 2026
Merged

refactor: remove site key from options; require explicit pass to recaptcha provider#16409
ncooke3 merged 7 commits into
mainfrom
nc.fac.recaptcha

Conversation

@ncooke3

@ncooke3 ncooke3 commented Jul 17, 2026

Copy link
Copy Markdown
Member

Remove recaptchaSiteKey from FirebaseOptions and explicitly pass it into FIRRecaptchaProvider instead.

cc: @rlazo

#no-changelog

Remove recaptchaSiteKey from FirebaseOptions and explicitly pass it into FIRRecaptchaProvider instead. This aligns with API design principles since it's a specific requirement for AppCheck.
@gemini-code-assist

Copy link
Copy Markdown
Contributor
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the 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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. 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.

@ncooke3

ncooke3 commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 removes the recaptchaSiteKey property from FirebaseOptions and updates RecaptchaProvider and RecaptchaProviderFactory to explicitly require a siteKey parameter during initialization. Feedback suggests validating the siteKey immediately in FIRRecaptchaProviderFactory to fail fast, and changing the initializer's return type to non-nullable instancetype to simplify the Swift API.

Comment thread FirebaseAppCheck/Sources/RecaptchaProvider/FIRRecaptchaProviderFactory.m Outdated
Comment thread FirebaseAppCheck/Sources/Public/FirebaseAppCheck/FIRRecaptchaProviderFactory.h Outdated

@ncooke3 ncooke3 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Self

Comment thread FirebaseAppCheck/CHANGELOG.md Outdated
Comment thread FirebaseCore/CHANGELOG.md Outdated
…initialization

Update RecaptchaProviderFactory to explicitly require a non-empty siteKey parameter during initialization and raise an exception if invalid. This replaces the previous behavior of reading it from FirebaseOptions. Also updates the changelog entries for FirebaseAppCheck and FirebaseCore to reflect the changes to the public preview reCAPTCHA provider.
@ncooke3

ncooke3 commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 removes the recaptchaSiteKey property from FirebaseOptions and updates RecaptchaProvider and RecaptchaProviderFactory to explicitly require a siteKey parameter during initialization. Feedback includes declaring the siteKey property as readonly in FIRRecaptchaProviderFactory, overriding the unavailable init method in the implementation to prevent runtime invocation, and adding a unit test to verify that initializing the factory with an empty site key throws an exception.

Comment thread FirebaseAppCheck/Sources/RecaptchaProvider/FIRRecaptchaProviderFactory.m Outdated
Comment thread FirebaseAppCheck/Tests/Unit/Swift/RecaptchaProviderTests.swift
- Make siteKey property readonly
- Override init to return nil and flag as NS_UNAVAILABLE
- Add unit test to verify empty siteKey throws an exception
@ncooke3

ncooke3 commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 removes the recaptchaSiteKey property from FirebaseOptions in FirebaseCore and updates RecaptchaProvider and RecaptchaProviderFactory in FirebaseAppCheck to explicitly require a siteKey parameter during initialization. The corresponding tests and changelogs have been updated to reflect these changes. There are no review comments, so I have no feedback to provide.

@ncooke3
ncooke3 requested a review from paulb777 July 17, 2026 20:41
@ncooke3

ncooke3 commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

@paulb777, I made some changes that warrant a re-review.

This will be staged for the next release, M184.

@ncooke3
ncooke3 marked this pull request as ready for review July 17, 2026 20:42
@ncooke3
ncooke3 requested a review from a team as a code owner July 17, 2026 20:42
@ncooke3
ncooke3 requested a review from daymxn July 17, 2026 20:42
Comment thread FirebaseCore/CHANGELOG.md Outdated
Comment thread FirebaseCore/CHANGELOG.md Outdated
ncooke3 and others added 2 commits July 17, 2026 17:22
Co-authored-by: Paul Beusterien <paulbeusterien@google.com>
Co-authored-by: Paul Beusterien <paulbeusterien@google.com>
@ncooke3
ncooke3 enabled auto-merge (squash) July 17, 2026 21:23
@ncooke3
ncooke3 merged commit 0fbaa00 into main Jul 17, 2026
75 checks passed
@ncooke3
ncooke3 deleted the nc.fac.recaptcha branch July 17, 2026 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants