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

Implement ReCaptchaEnterprise for App Check #5595

Merged
merged 16 commits into from
Nov 2, 2021
Merged

Conversation

hsubox76
Copy link
Contributor

@hsubox76 hsubox76 commented Oct 8, 2021

Add ReCaptchaEnterpriseProvider and associated methods to app-check and app-check-compat.

E2E tests were successful.

We want to coordinate the release with iOS/Android, do not merge until the coordinated date (TBD).

@changeset-bot
Copy link

changeset-bot bot commented Oct 8, 2021

🦋 Changeset detected

Latest commit: 54b258c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@firebase/app-check Minor
@firebase/app-check-compat Minor
firebase Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@google-cla google-cla bot added the cla: yes label Oct 8, 2021
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 8, 2021

Binary Size Report

Affected SDKs

  • @firebase/app-check

    Type Base (65dce18) Head (951b7ba) Diff
    browser 20.4 kB 22.3 kB +1.95 kB (+9.6%)
    esm5 24.3 kB 26.6 kB +2.36 kB (+9.7%)
    main 25.3 kB 27.8 kB +2.53 kB (+10.0%)
    module 20.4 kB 22.3 kB +1.95 kB (+9.6%)
  • @firebase/app-check-compat

    Type Base (65dce18) Head (951b7ba) Diff
    browser 2.13 kB 2.27 kB +142 B (+6.7%)
    esm5 2.33 kB 2.48 kB +142 B (+6.1%)
    main 2.81 kB 2.94 kB +132 B (+4.7%)
    module 2.13 kB 2.27 kB +142 B (+6.7%)
  • @firebase/auth-compat

    Type Base (65dce18) Head (951b7ba) Diff
    browser 19.7 kB 19.8 kB +38 B (+0.2%)
    esm5 26.6 kB 26.6 kB +38 B (+0.1%)
    main 29.1 kB 29.1 kB +49 B (+0.2%)
    module 19.7 kB 19.8 kB +38 B (+0.2%)
  • @firebase/auth/cordova

    Type Base (65dce18) Head (951b7ba) Diff
    browser 179 kB 179 kB +88 B (+0.0%)
    module 179 kB 179 kB +88 B (+0.0%)
  • @firebase/auth/internal

    Type Base (65dce18) Head (951b7ba) Diff
    browser 163 kB 163 kB +88 B (+0.1%)
    esm5 211 kB 211 kB +88 B (+0.0%)
    main 179 kB 179 kB +88 B (+0.0%)
    module 163 kB 163 kB +88 B (+0.1%)
  • @firebase/auth/react-native

    Type Base (65dce18) Head (951b7ba) Diff
    browser 143 kB 162 kB +19.2 kB (+13.5%)
    module 143 kB 162 kB +19.2 kB (+13.5%)
  • @firebase/firestore

    Type Base (65dce18) Head (951b7ba) Diff
    browser 225 kB 225 kB +9 B (+0.0%)
    esm5 282 kB 282 kB +9 B (+0.0%)
    main 423 kB 423 kB +36 B (+0.0%)
    module 225 kB 225 kB +9 B (+0.0%)
    react-native 226 kB 226 kB +9 B (+0.0%)
  • @firebase/storage

    Type Base (65dce18) Head (951b7ba) Diff
    browser 52.2 kB 52.1 kB -3 B (-0.0%)
    esm5 58.4 kB 57.5 kB -844 B (-1.4%)
    main 53.6 kB 53.6 kB -3 B (-0.0%)
    module 52.2 kB 52.1 kB -3 B (-0.0%)
  • firebase

    Click to show 19 binary size changes.
    Type Base (65dce18) Head (951b7ba) Diff
    firebase-analytics-compat.js 26.0 kB 26.1 kB +91 B (+0.3%)
    firebase-app-check-compat.js 19.9 kB 20.9 kB +984 B (+4.9%)
    firebase-app-check.js 77.6 kB 80.6 kB +2.95 kB (+3.8%)
    firebase-app-compat.js 21.3 kB 21.3 kB +12 B (+0.1%)
    firebase-auth-compat.js 122 kB 123 kB +939 B (+0.8%)
    firebase-auth-cordova.js 460 kB 460 kB +131 B (+0.0%)
    firebase-auth-react-native.js 430 kB 479 kB +48.9 kB (+11.4%)
    firebase-auth.js 410 kB 410 kB +322 B (+0.1%)
    firebase-compat.js 749 kB 752 kB +3.19 kB (+0.4%)
    firebase-database-compat.js 168 kB 169 kB +482 B (+0.3%)
    firebase-firestore-compat.js 277 kB 278 kB +638 B (+0.2%)
    firebase-firestore.js 763 kB 763 kB +12 B (+0.0%)
    firebase-functions-compat.js 7.94 kB 7.95 kB +10 B (+0.1%)
    firebase-messaging-compat.js 37.9 kB 38.0 kB +105 B (+0.3%)
    firebase-performance-compat.js 30.8 kB 30.9 kB +72 B (+0.2%)
    firebase-performance-standalone-compat.js 54.0 kB 54.0 kB +68 B (+0.1%)
    firebase-remote-config-compat.js 27.5 kB 27.6 kB +52 B (+0.2%)
    firebase-storage-compat.js 38.2 kB 38.1 kB -79 B (-0.2%)
    firebase-storage.js 141 kB 139 kB -1.36 kB (-1.0%)

Test Logs

@google-oss-bot google-oss-bot added the doc-changes PRs that affect docs label Oct 8, 2021
@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 8, 2021

Size Analysis Report

Affected Products

Diffs between base commit (65dce18) and head commit (951b7ba) are too large (110,878 characters) to display.

Please check below links to see details from the original test log.

@hsubox76 hsubox76 changed the title WIP: Implement ReCaptchaEnterprise for App Check Implement ReCaptchaEnterprise for App Check Oct 21, 2021
@hsubox76 hsubox76 changed the title Implement ReCaptchaEnterprise for App Check DO NOT MERGE: Implement ReCaptchaEnterprise for App Check Oct 25, 2021
@hsubox76 hsubox76 changed the title DO NOT MERGE: Implement ReCaptchaEnterprise for App Check Implement ReCaptchaEnterprise for App Check Oct 26, 2021
.changeset/ten-impalas-wink.md Show resolved Hide resolved
packages/app-check-compat/src/index.ts Show resolved Hide resolved
packages/app-check/src/client.ts Outdated Show resolved Hide resolved
packages/app-check/src/providers.ts Outdated Show resolved Hide resolved
packages/app-check/src/recaptcha.ts Outdated Show resolved Hide resolved
export function getFakeGreCAPTCHA(): GreCAPTCHA {
return {
export function getFakeGreCAPTCHA(
isTopLevel: boolean = true
Copy link
Member

Choose a reason for hiding this comment

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

what does it mean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The grecaptcha enterprise object is a nested copy of grecaptcha (see the types in recaptcha.ts lines 185 and 189) in a property with the key enterprise. To create a fake grecaptcha object, it recursively calls itself once to put a copy of itself inside the enterprise property with all the same keys except enterprise. Should I put a comment here or where the types are defined in recaptcha.ts?

Copy link
Member

@Feiyang1 Feiyang1 Oct 29, 2021

Choose a reason for hiding this comment

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

A comment to explain what this flag does would be helpful

@Feiyang1 Feiyang1 assigned hsubox76 and unassigned Feiyang1 Oct 27, 2021
hsubox76 and others added 2 commits October 28, 2021 13:42
Co-authored-by: Feiyang <feiyangc@google.com>
@@ -1551,6 +1551,15 @@ declare namespace firebase.appCheck {
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kevinthecheung This file is a documentation source.

@@ -88,6 +83,61 @@ export class ReCaptchaV3Provider implements AppCheckProvider {
}
}

/**
* App Check provider that can obtain a reCAPTCHA Enterprise token and exchange it
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kevinthecheung This comment will go into documentation.

packages/app-check/src/public-types.ts Outdated Show resolved Hide resolved
packages/firebase/compat/index.d.ts Outdated Show resolved Hide resolved
@Feiyang1 Feiyang1 assigned hsubox76 and unassigned Feiyang1 Oct 29, 2021
@Feiyang1 Feiyang1 merged commit 6160497 into master Nov 2, 2021
@Feiyang1 Feiyang1 deleted the ch-recaptcha-enterprise branch November 2, 2021 20:55
@google-oss-bot google-oss-bot mentioned this pull request Nov 2, 2021
@firebase firebase locked and limited conversation to collaborators Dec 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes doc-changes PRs that affect docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants