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

Add Installations Auth Id token to FirebaseServerApp #8623

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

DellaBitta
Copy link
Contributor

@DellaBitta DellaBitta commented Oct 31, 2024

Discussion

Add installationsAuthToken as a potential parameter when initializing FirebaseServerApp instances. The token will be used by Installations in lieu of hitting local storage when getID and getToken are invoked.

Note, this PR includes a change that throws an error if Remote Config's fetch is invoked outside of a browser. Without this error, the PR would unlock Remote Config's fetch invocations in server environments, which previously failed due to Installations requiring IndexedDB at initalization. Use of Remote Config's fetch in server enviornments is against the intent of use -- Remote Config is designed to cache and reuse fetch results by storing the results locally in IndexedDB. Unlocking server-side use of Remote Config's fetch would cause a significant increase of traffic on the service.

Do not merge this change. It will unlock product SDKs to use Installations in server environments, but we should wait for any forward facing product SDK features to be scheduled before releasing this change to the public API surface.

Testing

Added a node test target to the Installations SDK, and wrote tests to invoke getToken and getId with FirebaseServerApp instances.

API Changes

This conforms with the existing API proposal for FirebaseServerApp which included an Installations Auth token.

Copy link

changeset-bot bot commented Oct 31, 2024

🦋 Changeset detected

Latest commit: da58c9a

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

This PR includes changesets to release 13 packages
Name Type
@firebase/installations Minor
@firebase/app Minor
firebase Minor
@firebase/remote-config Patch
@firebase/analytics Patch
@firebase/installations-compat Patch
@firebase/messaging Patch
@firebase/performance Patch
@firebase/app-compat Patch
@firebase/remote-config-compat Patch
@firebase/analytics-compat Patch
@firebase/messaging-compat Patch
@firebase/performance-compat Patch

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-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 31, 2024

Size Report 1

Affected Products

  • @firebase/analytics

    TypeBase (e3e2078)Merge (ed6ed8b)Diff
    browser21.8 kB21.8 kB+1 B (+0.0%)
    main23.1 kB23.1 kB+1 B (+0.0%)
    module21.8 kB21.8 kB+1 B (+0.0%)
  • @firebase/app

    TypeBase (e3e2078)Merge (ed6ed8b)Diff
    browser18.4 kB19.0 kB+614 B (+3.3%)
    main19.3 kB19.9 kB+606 B (+3.1%)
    module18.4 kB19.0 kB+614 B (+3.3%)
  • @firebase/app-check

    TypeBase (e3e2078)Merge (ed6ed8b)Diff
    browser26.3 kB26.3 kB+1 B (+0.0%)
    main27.3 kB27.3 kB+1 B (+0.0%)
    module26.3 kB26.3 kB+1 B (+0.0%)
  • @firebase/database

    TypeBase (e3e2078)Merge (ed6ed8b)Diff
    browser249 kB249 kB+1 B (+0.0%)
    main254 kB254 kB+1 B (+0.0%)
    module249 kB249 kB+1 B (+0.0%)
  • @firebase/functions

    TypeBase (e3e2078)Merge (ed6ed8b)Diff
    browser9.72 kB9.72 kB+1 B (+0.0%)
    main10.3 kB10.3 kB+1 B (+0.0%)
    module9.72 kB9.72 kB+1 B (+0.0%)
  • @firebase/installations

    TypeBase (e3e2078)Merge (ed6ed8b)Diff
    browser17.8 kB18.4 kB+589 B (+3.3%)
    main18.3 kB18.9 kB+576 B (+3.1%)
    module17.8 kB18.4 kB+589 B (+3.3%)
  • @firebase/remote-config

    TypeBase (e3e2078)Merge (ed6ed8b)Diff
    browser19.2 kB19.4 kB+187 B (+1.0%)
    main20.2 kB20.4 kB+182 B (+0.9%)
    module19.2 kB19.4 kB+187 B (+1.0%)
  • bundle

    46 size changes

    TypeBase (e3e2078)Merge (ed6ed8b)Diff
    analytics (logEvent)44.6 kB45.2 kB+612 B (+1.4%)
    app-check (CustomProvider)37.5 kB37.6 kB+129 B (+0.3%)
    app-check (ReCaptchaEnterpriseProvider)40.0 kB40.1 kB+129 B (+0.3%)
    app-check (ReCaptchaV3Provider)39.9 kB40.1 kB+129 B (+0.3%)
    auth (Anonymous)76.2 kB76.4 kB+128 B (+0.2%)
    auth (EmailAndPassword)86.4 kB86.5 kB+128 B (+0.1%)
    auth (GoogleFBTwitterGitHubPopup)103 kB103 kB+128 B (+0.1%)
    auth (GooglePopup)100 kB100 kB+128 B (+0.1%)
    auth (GoogleRedirect)100 kB101 kB+128 B (+0.1%)
    auth (Phone)93.8 kB93.9 kB+128 B (+0.1%)
    database (Append to a list of data)149 kB149 kB+129 B (+0.1%)
    database (Filtering data)148 kB148 kB+129 B (+0.1%)
    database (Listen for child events)164 kB165 kB+129 B (+0.1%)
    database (Listen for value events + Detach listeners)164 kB165 kB+129 B (+0.1%)
    database (Listen for value events)164 kB164 kB+129 B (+0.1%)
    database (Read data once)164 kB164 kB+129 B (+0.1%)
    database (Save data as transactions)166 kB166 kB+129 B (+0.1%)
    database (Sort data)150 kB150 kB+129 B (+0.1%)
    database (Write data)148 kB148 kB+129 B (+0.1%)
    firestore (CSI Auto Indexing Disable and Delete)272 kB272 kB+128 B (+0.0%)
    firestore (CSI Auto Indexing Enable)272 kB272 kB+128 B (+0.0%)
    firestore (Persistence)303 kB304 kB+128 B (+0.0%)
    firestore (Query Cursors)249 kB249 kB+128 B (+0.1%)
    firestore (Query)247 kB247 kB+128 B (+0.1%)
    firestore (Read data once)234 kB234 kB+128 B (+0.1%)
    firestore (Read Write w Persistence)328 kB328 kB+128 B (+0.0%)
    firestore (Realtime updates)237 kB237 kB+128 B (+0.1%)
    firestore (Transaction)214 kB214 kB+128 B (+0.1%)
    firestore (Write data)213 kB213 kB+128 B (+0.1%)
    firestore-lite (Query Cursors)91.4 kB91.6 kB+128 B (+0.1%)
    firestore-lite (Query)87.6 kB87.7 kB+128 B (+0.1%)
    firestore-lite (Read data once)63.0 kB63.2 kB+128 B (+0.2%)
    firestore-lite (Transaction)88.3 kB88.4 kB+128 B (+0.1%)
    firestore-lite (Write data)72.6 kB72.8 kB+128 B (+0.2%)
    functions (call)32.0 kB32.1 kB+129 B (+0.4%)
    messaging (send + receive)46.9 kB47.5 kB+611 B (+1.3%)
    performance (trace)51.8 kB52.4 kB+611 B (+1.2%)
    remote-config (getAndFetch)46.3 kB47.3 kB+949 B (+2.0%)
    storage (getBytes)42.1 kB42.3 kB+128 B (+0.3%)
    storage (getDownloadURL)44.2 kB44.3 kB+128 B (+0.3%)
    storage (getMetadata)43.6 kB43.8 kB+128 B (+0.3%)
    storage (list + listAll)43.1 kB43.2 kB+128 B (+0.3%)
    storage (updateMetadata)43.9 kB44.0 kB+128 B (+0.3%)
    storage (uploadBytes)48.8 kB48.9 kB+128 B (+0.3%)
    storage (uploadBytesResumable)58.7 kB58.8 kB+128 B (+0.2%)
    storage (uploadString)49.0 kB49.1 kB+128 B (+0.3%)

  • firebase

    21 size changes

    TypeBase (e3e2078)Merge (ed6ed8b)Diff
    firebase-analytics-compat.js26.5 kB26.9 kB+475 B (+1.8%)
    firebase-analytics.js29.7 kB30.2 kB+458 B (+1.5%)
    firebase-app-check-compat.js23.4 kB23.4 kB+1 B (+0.0%)
    firebase-app-check.js25.0 kB25.0 kB+1 B (+0.0%)
    firebase-app-compat.js31.8 kB32.3 kB+515 B (+1.6%)
    firebase-app.js101 kB102 kB+1.09 kB (+1.1%)
    firebase-compat.js794 kB796 kB+1.14 kB (+0.1%)
    firebase-database-compat.js166 kB166 kB+2 B (+0.0%)
    firebase-database.js186 kB186 kB+2 B (+0.0%)
    firebase-functions-compat.js8.21 kB8.21 kB+1 B (+0.0%)
    firebase-functions.js12.0 kB12.0 kB+2 B (+0.0%)
    firebase-installations-compat.js13.3 kB13.7 kB+474 B (+3.6%)
    firebase-installations.js15.2 kB15.6 kB+456 B (+3.0%)
    firebase-messaging-compat.js38.3 kB38.7 kB+474 B (+1.2%)
    firebase-messaging-sw.js30.1 kB30.6 kB+456 B (+1.5%)
    firebase-messaging.js28.7 kB29.1 kB+456 B (+1.6%)
    firebase-performance-compat.js30.8 kB31.3 kB+474 B (+1.5%)
    firebase-performance-standalone-compat.js93.7 kB94.6 kB+957 B (+1.0%)
    firebase-performance.js35.1 kB35.5 kB+456 B (+1.3%)
    firebase-remote-config-compat.js27.3 kB28.1 kB+780 B (+2.9%)
    firebase-remote-config.js29.6 kB30.4 kB+804 B (+2.7%)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/0fVqY7MOM8.html

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Oct 31, 2024

Size Analysis Report 1

This report is too large (186,037 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/2kZUQ8zlPQ.html

Copy link
Contributor

@hsubox76 hsubox76 left a comment

Choose a reason for hiding this comment

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

LG so far but looks like it's still in draft status so I won't do a final review.

Copy link
Contributor

github-actions bot commented Nov 19, 2024

Changeset File Check ✅

  • No modified packages are missing from the changeset file.
  • No changeset formatting errors detected.

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.

4 participants