Skip to content

Commit 562d619

Browse files
authored
[ServerApp] Remove appCheck and installations tokens. Will ad them back later (#7989)
Removed the appCheck and installations token parameters in FirebaseServerAppSettings as they won't be part of our initial launch. Additionally, update the the doxgen comments to no longer refer to these parameters, and to inform users that the User refreshToken will not work for User objects signed in with the authIdToken.
1 parent fc44b08 commit 562d619

File tree

6 files changed

+54
-180
lines changed

6 files changed

+54
-180
lines changed

common/api-review/app.api.md

-4
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,14 @@ export interface FirebaseOptions {
7373

7474
// @public
7575
export interface FirebaseServerApp extends FirebaseApp {
76-
appCheckTokenVerified: () => Promise<void>;
7776
authIdTokenVerified: () => Promise<void>;
78-
installationTokenVerified: () => Promise<void>;
7977
name: string;
8078
readonly settings: FirebaseServerAppSettings;
8179
}
8280

8381
// @public
8482
export interface FirebaseServerAppSettings extends FirebaseAppSettings {
85-
appCheckToken?: string;
8683
authIdToken?: string;
87-
installationsAuthToken?: string;
8884
name?: undefined;
8985
releaseOnDeref?: object;
9086
}

docs-devsite/app.firebaseserverapp.md

+6-36
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ https://github.com/firebase/firebase-js-sdk
1212
# FirebaseServerApp interface
1313
A [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) holds the initialization information for a collection of services running in server enviornments.
1414

15-
Do not call this constructor directly. Instead, use to create an app.
15+
Do not call this constructor directly. Instead, use [initializeServerApp()](./app.md#initializeserverapp_30ab697) to create an app.
1616

1717
<b>Signature:</b>
1818

@@ -25,31 +25,15 @@ export interface FirebaseServerApp extends FirebaseApp
2525
2626
| Property | Type | Description |
2727
| --- | --- | --- |
28-
| [appCheckTokenVerified](./app.firebaseserverapp.md#firebaseserverappappchecktokenverified) | () =&gt; Promise&lt;void&gt; | Checks to see if the verification of the appCheckToken provided to has completed. If the optional appCheckToken parameter was omitted then the returned Promise is completed immediately.<!-- -->It is recommend that your application awaits this promise before initializing any Firebase products that use AppCheck. The Firebase SDKs will not use App Check tokens that are determined to be invalid or those that have not yet completed validation.<!-- -->The returned Promise is completed immediately if the optional appCheckToken parameter was omitted from FirebaseServerApp initialization. |
29-
| [authIdTokenVerified](./app.firebaseserverapp.md#firebaseserverappauthidtokenverified) | () =&gt; Promise&lt;void&gt; | Checks to see if the verification of the authIdToken provided to has completed.<!-- -->It is recommend that your application awaits this promise if an authIdToken was provided during FirebaseServerApp initialization before invoking getAuth(). If an instance of Auth is created before the Auth ID Token is validated, then the token will not be used by that instance of the Auth SDK.<!-- -->The returned Promise is completed immediately if the optional authIdToken parameter was omitted from FirebaseServerApp initialization. |
30-
| [installationTokenVerified](./app.firebaseserverapp.md#firebaseserverappinstallationtokenverified) | () =&gt; Promise&lt;void&gt; | Checks to see if the verification of the installationToken provided to has completed.<!-- -->It is recommend that your application awaits this promise before initializing any Firebase products that use Firebase Installations. The Firebase SDKs will not use Installation Auth tokens that are determined to be invalid or those that have not yet completed validation.<!-- -->The returned Promise is completed immediately if the optional appCheckToken parameter was omitted from FirebaseServerApp initialization. |
31-
| [name](./app.firebaseserverapp.md#firebaseserverappname) | string | There is no get for FirebaseServerApp, so the name is not relevant. However, it's declared here so that FirebaseServerApp conforms to the FirebaseApp interface declaration. Internally this string will always be empty for FirebaseServerApp instances. |
28+
| [authIdTokenVerified](./app.firebaseserverapp.md#firebaseserverappauthidtokenverified) | () =&gt; Promise&lt;void&gt; | Checks to see if the local verification of the authIdToken provided to [initializeServerApp()](./app.md#initializeserverapp_30ab697) has completed.<!-- -->It is recommend that your application awaits this promise before invoking getAuth() if an authIdToken was provided in the FirebaseServerAppSettings.<!-- -->The returned Promise is completed immediately if the optional authIdToken parameter was omitted from FirebaseServerApp initialization. |
29+
| [name](./app.firebaseserverapp.md#firebaseserverappname) | string | There is no getApp operation for FirebaseServerApps, so the name is not relevant for applications. However, it may be used internally, and is declared here so that FirebaseServerApp conforms to the FirebaseApp interface declaration. |
3230
| [settings](./app.firebaseserverapp.md#firebaseserverappsettings) | [FirebaseServerAppSettings](./app.firebaseserverappsettings.md#firebaseserverappsettings_interface) | The (read-only) configuration settings for this server app. These are the original parameters given in [initializeServerApp()](./app.md#initializeserverapp_30ab697)<!-- -->. |
3331
34-
## FirebaseServerApp.appCheckTokenVerified
35-
36-
Checks to see if the verification of the appCheckToken provided to has completed. If the optional appCheckToken parameter was omitted then the returned Promise is completed immediately.
37-
38-
It is recommend that your application awaits this promise before initializing any Firebase products that use AppCheck. The Firebase SDKs will not use App Check tokens that are determined to be invalid or those that have not yet completed validation.
39-
40-
The returned Promise is completed immediately if the optional appCheckToken parameter was omitted from FirebaseServerApp initialization.
41-
42-
<b>Signature:</b>
43-
44-
```typescript
45-
appCheckTokenVerified: () => Promise<void>;
46-
```
47-
4832
## FirebaseServerApp.authIdTokenVerified
4933
50-
Checks to see if the verification of the authIdToken provided to has completed.
34+
Checks to see if the local verification of the authIdToken provided to [initializeServerApp()](./app.md#initializeserverapp_30ab697) has completed.
5135
52-
It is recommend that your application awaits this promise if an authIdToken was provided during FirebaseServerApp initialization before invoking getAuth(). If an instance of Auth is created before the Auth ID Token is validated, then the token will not be used by that instance of the Auth SDK.
36+
It is recommend that your application awaits this promise before invoking getAuth() if an authIdToken was provided in the FirebaseServerAppSettings.
5337
5438
The returned Promise is completed immediately if the optional authIdToken parameter was omitted from FirebaseServerApp initialization.
5539
@@ -59,23 +43,9 @@ The returned Promise is completed immediately if the optional authIdToken parame
5943
authIdTokenVerified: () => Promise<void>;
6044
```
6145
62-
## FirebaseServerApp.installationTokenVerified
63-
64-
Checks to see if the verification of the installationToken provided to has completed.
65-
66-
It is recommend that your application awaits this promise before initializing any Firebase products that use Firebase Installations. The Firebase SDKs will not use Installation Auth tokens that are determined to be invalid or those that have not yet completed validation.
67-
68-
The returned Promise is completed immediately if the optional appCheckToken parameter was omitted from FirebaseServerApp initialization.
69-
70-
<b>Signature:</b>
71-
72-
```typescript
73-
installationTokenVerified: () => Promise<void>;
74-
```
75-
7646
## FirebaseServerApp.name
7747
78-
There is no get for FirebaseServerApp, so the name is not relevant. However, it's declared here so that FirebaseServerApp conforms to the FirebaseApp interface declaration. Internally this string will always be empty for FirebaseServerApp instances.
48+
There is no getApp operation for FirebaseServerApps, so the name is not relevant for applications. However, it may be used internally, and is declared here so that FirebaseServerApp conforms to the FirebaseApp interface declaration.
7949
8050
<b>Signature:</b>
8151

docs-devsite/app.firebaseserverappsettings.md

+11-43
Original file line numberDiff line numberDiff line change
@@ -23,58 +23,26 @@ export interface FirebaseServerAppSettings extends FirebaseAppSettings
2323
2424
| Property | Type | Description |
2525
| --- | --- | --- |
26-
| [appCheckToken](./app.firebaseserverappsettings.md#firebaseserverappsettingsappchecktoken) | string | An optional AppCheck token.<!-- -->If provided, the FirebaseServerApp instance will work to validate the token. The result of the validation can be monitored by invoking the FirebaseServerApp.appCheckTokenVerified(). Awaiting the Promise returned by appCheckTokenVerified is highly recommended if an AppCheck token is provided.<!-- -->If the token has been properly verified then the AppCheck token will be automatically used by Firebase SDKs that support App Check.<!-- -->If the token fails verification then a warning is logged and the token will not be used. |
27-
| [authIdToken](./app.firebaseserverappsettings.md#firebaseserverappsettingsauthidtoken) | string | An optional Auth ID token used to resume a signed in user session from a client runtime environment.<!-- -->If provided, the FirebaseServerApp instance will work to validate the token. The result of the validation can be queried via by the application by invoking the FirebaseServerApp.authIdTokenVerified(). Awaiting the Promise returned by authIdTokenVerified is highly recommended if an Auth ID token is provided.<!-- -->Once the token has been properly verified then invoking getAuth() will attempt to automatically sign in a user with the provided Auth ID Token.<!-- -->If the token fails verification then a warning is logged and Auth SDK will not attempt to sign in a user upon its initalization. |
28-
| [installationsAuthToken](./app.firebaseserverappsettings.md#firebaseserverappsettingsinstallationsauthtoken) | string | An optional Installation Auth token.<!-- -->If provided, the FirebaseServerApp instance will work to validate the token. The result of the validation can be monitored by invoking the FirebaseServerApp.installationTokenVerified(). Awaiting the Promise returned by appCheckTokenVerified is highly recommended before initalization any other Firebase SDKs.<!-- -->If the token has been properly verified then the Installation Auth token will be automatically used by Firebase SDKs that support Firebase Installations.<!-- -->If the token fails verification then a warning is logged and the token will not be used. |
26+
| [authIdToken](./app.firebaseserverappsettings.md#firebaseserverappsettingsauthidtoken) | string | An optional Auth ID token used to resume a signed in user session from a client runtime environment.<!-- -->If provided, the FirebaseServerApp instance will work to validate the token even before Auth is initialized. The result of the validation can be queried via by the application by invoking . Awaiting the Promise returned by is highly recommended if an authIdToken token is provided.<!-- -->Invoking getAuth() with a FirebaseServerApp configured with a validated authIdToken will cause an automatic attempt to sign in the user that the authIdToken represents. The token needs to have been recently minted for this operation to succeed, otherwise it will fail validation.<!-- -->If the token fails local verification, or if the Auth service has deemed it invalid when the Auth SDK is initialized, then a warning is logged to the console and the Auth SDK will not sign in a user upon initalization.<!-- -->If a user is successfully signed-in, then the Auth instance's onAuthStateChanged callback will be invoked with the User as per standard Auth flows. However, users created via authIdTokens do not have a refresh token and any attempted refresh operation will fail. |
2927
| [name](./app.firebaseserverappsettings.md#firebaseserverappsettingsname) | undefined | There is no get for FirebaseServerApps, so the name is not relevant. however it's always a blank string so that FirebaseServerApp conforms to the FirebaseApp interface declaration. |
30-
| [releaseOnDeref](./app.firebaseserverappsettings.md#firebaseserverappsettingsreleaseonderef) | object | An optional object. If provided, the Firebase SDK will use a FinalizationRegistry object to monitor the Garbage Collection status of the provided object, and the Firebase SDK will release its refrence on the FirebaseServerApp instance when the provided object is collected. or.<!-- -->The intent of this field is to help reduce memory overhead for long-running cloud functions executing SSR fulfillment without the customer's app needing to orchestrate FirebaseServerApp cleanup. Additionally, prexisting FirebaseServerApp instances may reused if they're identical to a previously generated one that has yet to be deleted.<!-- -->If the object is not provided then the application must clean up the FirebaseServerApp instance through the applicationss own standard mechanisms by invoking deleteApp.<!-- -->If the app provides an object in this parameter, but the application is executed in a JavaScript engine that predates the support of FinalizationRegistry (introduced in node v14.6.0, for instance), then the Firebase SDK will not be able to automatically clean up the FirebaseServerApp instance and an error will be thrown. |
31-
32-
## FirebaseServerAppSettings.appCheckToken
33-
34-
An optional AppCheck token.
35-
36-
If provided, the FirebaseServerApp instance will work to validate the token. The result of the validation can be monitored by invoking the FirebaseServerApp.appCheckTokenVerified(). Awaiting the Promise returned by appCheckTokenVerified is highly recommended if an AppCheck token is provided.
37-
38-
If the token has been properly verified then the AppCheck token will be automatically used by Firebase SDKs that support App Check.
39-
40-
If the token fails verification then a warning is logged and the token will not be used.
41-
42-
<b>Signature:</b>
43-
44-
```typescript
45-
appCheckToken?: string;
46-
```
28+
| [releaseOnDeref](./app.firebaseserverappsettings.md#firebaseserverappsettingsreleaseonderef) | object | An optional object. If provided, the Firebase SDK will use a FinalizationRegistry object to monitor the Garbage Collection status of the provided object, and the Firebase SDK will release its refrence on the FirebaseServerApp instance when the provided object is garbage collected.<!-- -->The intent of this field is to help reduce memory overhead for long-running cloud functions. If provided, the customer's app running in a SSR pass need not worry about FirebaseServerApp cleanup, so long as the reference object is deleted (by falling out of SSR scope, for instance.)<!-- -->If an object is not provided then the application must clean up the FirebaseServerApp instance by invoking deleteApp.<!-- -->If the application provides an object in this parameter, but the application is executed in a JavaScript engine that predates the support of FinalizationRegistry (introduced in node v14.6.0, for instance), then the Firebase SDK will not be able to automatically clean up the FirebaseServerApp instance and an error will be thrown. |
4729
4830
## FirebaseServerAppSettings.authIdToken
4931
5032
An optional Auth ID token used to resume a signed in user session from a client runtime environment.
5133
52-
If provided, the FirebaseServerApp instance will work to validate the token. The result of the validation can be queried via by the application by invoking the FirebaseServerApp.authIdTokenVerified(). Awaiting the Promise returned by authIdTokenVerified is highly recommended if an Auth ID token is provided.
34+
If provided, the FirebaseServerApp instance will work to validate the token even before Auth is initialized. The result of the validation can be queried via by the application by invoking . Awaiting the Promise returned by is highly recommended if an authIdToken token is provided.
5335
54-
Once the token has been properly verified then invoking getAuth() will attempt to automatically sign in a user with the provided Auth ID Token.
36+
Invoking getAuth() with a FirebaseServerApp configured with a validated authIdToken will cause an automatic attempt to sign in the user that the authIdToken represents. The token needs to have been recently minted for this operation to succeed, otherwise it will fail validation.
5537
56-
If the token fails verification then a warning is logged and Auth SDK will not attempt to sign in a user upon its initalization.
38+
If the token fails local verification, or if the Auth service has deemed it invalid when the Auth SDK is initialized, then a warning is logged to the console and the Auth SDK will not sign in a user upon initalization.
5739
58-
<b>Signature:</b>
59-
60-
```typescript
61-
authIdToken?: string;
62-
```
63-
64-
## FirebaseServerAppSettings.installationsAuthToken
65-
66-
An optional Installation Auth token.
67-
68-
If provided, the FirebaseServerApp instance will work to validate the token. The result of the validation can be monitored by invoking the FirebaseServerApp.installationTokenVerified(). Awaiting the Promise returned by appCheckTokenVerified is highly recommended before initalization any other Firebase SDKs.
69-
70-
If the token has been properly verified then the Installation Auth token will be automatically used by Firebase SDKs that support Firebase Installations.
71-
72-
If the token fails verification then a warning is logged and the token will not be used.
40+
If a user is successfully signed-in, then the Auth instance's onAuthStateChanged callback will be invoked with the User as per standard Auth flows. However, users created via authIdTokens do not have a refresh token and any attempted refresh operation will fail.
7341
7442
<b>Signature:</b>
7543
7644
```typescript
77-
installationsAuthToken?: string;
45+
authIdToken?: string;
7846
```
7947
8048
## FirebaseServerAppSettings.name
@@ -89,13 +57,13 @@ name?: undefined;
8957
9058
## FirebaseServerAppSettings.releaseOnDeref
9159
92-
An optional object. If provided, the Firebase SDK will use a FinalizationRegistry object to monitor the Garbage Collection status of the provided object, and the Firebase SDK will release its refrence on the FirebaseServerApp instance when the provided object is collected. or.
60+
An optional object. If provided, the Firebase SDK will use a FinalizationRegistry object to monitor the Garbage Collection status of the provided object, and the Firebase SDK will release its refrence on the FirebaseServerApp instance when the provided object is garbage collected.
9361
94-
The intent of this field is to help reduce memory overhead for long-running cloud functions executing SSR fulfillment without the customer's app needing to orchestrate FirebaseServerApp cleanup. Additionally, prexisting FirebaseServerApp instances may reused if they're identical to a previously generated one that has yet to be deleted.
62+
The intent of this field is to help reduce memory overhead for long-running cloud functions. If provided, the customer's app running in a SSR pass need not worry about FirebaseServerApp cleanup, so long as the reference object is deleted (by falling out of SSR scope, for instance.)
9563
96-
If the object is not provided then the application must clean up the FirebaseServerApp instance through the applicationss own standard mechanisms by invoking deleteApp.
64+
If an object is not provided then the application must clean up the FirebaseServerApp instance by invoking deleteApp.
9765
98-
If the app provides an object in this parameter, but the application is executed in a JavaScript engine that predates the support of FinalizationRegistry (introduced in node v14.6.0, for instance), then the Firebase SDK will not be able to automatically clean up the FirebaseServerApp instance and an error will be thrown.
66+
If the application provides an object in this parameter, but the application is executed in a JavaScript engine that predates the support of FinalizationRegistry (introduced in node v14.6.0, for instance), then the Firebase SDK will not be able to automatically clean up the FirebaseServerApp instance and an error will be thrown.
9967
10068
<b>Signature:</b>
10169

0 commit comments

Comments
 (0)