-
Notifications
You must be signed in to change notification settings - Fork 945
[ServerApp] Firebase Server App feature branch #8005
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
3037b86
[FirebaseServerApp] Add ServerApp to feature branch (#7894)
DellaBitta fc0362f
Merge branch 'master' into feature-firebaseserverapp
DellaBitta fc44b08
[ServerApp] Update feature branch Auth implementation to use the auth…
DellaBitta 562d619
[ServerApp] Remove appCheck and installations tokens. Will ad them ba…
DellaBitta abc9d87
[ServerApp] Mangle the FirebaseServerApp name (#7993)
DellaBitta 6df26bb
[ServerApp] RefCount FirebaseServerApps (#8000)
DellaBitta 9fd761b
Merge branch 'master' into feature-firebaseserverapp
DellaBitta 92c655a
revert two FirebaseServerApps members to private
DellaBitta 5b7d7ef
[SeverApp] Restrict certain auth operations (#8015)
DellaBitta 64f48f6
Added a changeset
DellaBitta 7ba816a
add firebase entry to the changeset
DellaBitta 345d4bd
Documentation updates.
DellaBitta 31b10e1
marked _serverApps as internal
DellaBitta e583b80
Copy fixes for documentation.
DellaBitta 8e5221b
reference type
DellaBitta 725f843
Remove requireEmulator from getTestInstanceForServerApp in auth iTest…
DellaBitta f9ca3b7
Descriptive errors when changing the current user.
DellaBitta 01161ef
lint fixes
DellaBitta 003b3c7
Merge branch 'master' into feature-firebaseserverapp
DellaBitta eabee1a
Fix for authStateReady for FirebaseServerApp (#8085)
jamesdaniels e3e3339
Merge branch 'master' into feature-firebaseserverapp
DellaBitta 9f74ac9
Remove authIDTokenVerified (#8089)
DellaBitta db24403
[FirebaseServerApp] add a new serverapp type for usage tracking. (#8094)
DellaBitta File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
'@firebase/auth': minor | ||
'@firebase/app': minor | ||
'firebase': minor | ||
--- | ||
|
||
Added the new `FirebaseServerApp` interface to bridge state | ||
data between client and server runtime environments. This interface extends `FirebaseApp`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
Project: /docs/reference/js/_project.yaml | ||
Book: /docs/reference/_book.yaml | ||
page_type: reference | ||
|
||
{% comment %} | ||
DO NOT EDIT THIS FILE! | ||
This is generated by the JS SDK team, and any local changes will be | ||
overwritten. Changes should be made in the source code at | ||
https://github.com/firebase/firebase-js-sdk | ||
{% endcomment %} | ||
|
||
# FirebaseServerApp interface | ||
A [FirebaseServerApp](./app.firebaseserverapp.md#firebaseserverapp_interface) holds the initialization information for a collection of services running in server environments. | ||
|
||
Do not call this constructor directly. Instead, use [initializeServerApp()](./app.md#initializeserverapp_30ab697) to create an app. | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface FirebaseServerApp extends FirebaseApp | ||
``` | ||
<b>Extends:</b> [FirebaseApp](./app.firebaseapp.md#firebaseapp_interface) | ||
## Properties | ||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [name](./app.firebaseserverapp.md#firebaseserverappname) | string | There is no <code>getApp()</code> operation for <code>FirebaseServerApp</code>, so the name is not relevant for applications. However, it may be used internally, and is declared here so that <code>FirebaseServerApp</code> conforms to the <code>FirebaseApp</code> interface. | | ||
| [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)<!-- -->. | | ||
## FirebaseServerApp.name | ||
There is no `getApp()` operation for `FirebaseServerApp`<!-- -->, 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. | ||
<b>Signature:</b> | ||
```typescript | ||
name: string; | ||
``` | ||
## FirebaseServerApp.settings | ||
The (read-only) configuration settings for this server app. These are the original parameters given in [initializeServerApp()](./app.md#initializeserverapp_30ab697)<!-- -->. | ||
<b>Signature:</b> | ||
```typescript | ||
readonly settings: FirebaseServerAppSettings; | ||
``` | ||
### Example | ||
```javascript | ||
const app = initializeServerApp(settings); | ||
console.log(app.settings.authIdToken === options.authIdToken); // true | ||
|
||
``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
Project: /docs/reference/js/_project.yaml | ||
Book: /docs/reference/_book.yaml | ||
page_type: reference | ||
|
||
{% comment %} | ||
DO NOT EDIT THIS FILE! | ||
This is generated by the JS SDK team, and any local changes will be | ||
overwritten. Changes should be made in the source code at | ||
https://github.com/firebase/firebase-js-sdk | ||
{% endcomment %} | ||
|
||
# FirebaseServerAppSettings interface | ||
Configuration options given to [initializeServerApp()](./app.md#initializeserverapp_30ab697) | ||
|
||
<b>Signature:</b> | ||
|
||
```typescript | ||
export interface FirebaseServerAppSettings extends FirebaseAppSettings | ||
``` | ||
<b>Extends:</b> [FirebaseAppSettings](./app.firebaseappsettings.md#firebaseappsettings_interface) | ||
## Properties | ||
| Property | Type | Description | | ||
| --- | --- | --- | | ||
| [authIdToken](./app.firebaseserverappsettings.md#firebaseserverappsettingsauthidtoken) | string | An optional Auth ID token used to resume a signed in user session from a client runtime environment.<!-- -->Invoking <code>getAuth</code> with a <code>FirebaseServerApp</code> configured with a validated <code>authIdToken</code> causes an automatic attempt to sign in the user that the <code>authIdToken</code> represents. The token needs to have been recently minted for this operation to succeed.<!-- -->If the token fails local verification, or if the Auth service has failed to validate it when the Auth SDK is initialized, then a warning is logged to the console and the Auth SDK will not sign in a user on initalization.<!-- -->If a user is successfully signed in, then the Auth instance's <code>onAuthStateChanged</code> callback is invoked with the <code>User</code> object as per standard Auth flows. However, <code>User</code> objects created via an <code>authIdToken</code> do not have a refresh token. Attempted <code>refreshToken</code> operations fail. | | ||
| [name](./app.firebaseserverappsettings.md#firebaseserverappsettingsname) | undefined | There is no <code>getApp()</code> operation for <code>FirebaseServerApp</code>, so the name is not relevant for applications. However, it may be used internally, and is declared here so that <code>FirebaseServerApp</code> conforms to the <code>FirebaseApp</code> interface. | | ||
| [releaseOnDeref](./app.firebaseserverappsettings.md#firebaseserverappsettingsreleaseonderef) | object | An optional object. If provided, the Firebase SDK uses a <code>FinalizationRegistry</code> object to monitor the garbage collection status of the provided object. The Firebase SDK releases its reference on the <code>FirebaseServerApp</code> instance when the provided <code>releaseOnDeref</code> object is garbage collected.<!-- -->You can use this field to reduce memory management overhead for your application. If provided, an app running in a SSR pass does not need to perform <code>FirebaseServerApp</code> 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 <code>FirebaseServerApp</code> instance by invoking <code>deleteApp</code>.<!-- -->If the application provides an object in this parameter, but the application is executed in a JavaScript engine that predates the support of <code>FinalizationRegistry</code> (introduced in node v14.6.0, for instance), then an error is thrown at <code>FirebaseServerApp</code> initialization. | | ||
## FirebaseServerAppSettings.authIdToken | ||
An optional Auth ID token used to resume a signed in user session from a client runtime environment. | ||
Invoking `getAuth` with a `FirebaseServerApp` configured with a validated `authIdToken` causes 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. | ||
If the token fails local verification, or if the Auth service has failed to validate it when the Auth SDK is initialized, then a warning is logged to the console and the Auth SDK will not sign in a user on initalization. | ||
If a user is successfully signed in, then the Auth instance's `onAuthStateChanged` callback is invoked with the `User` object as per standard Auth flows. However, `User` objects created via an `authIdToken` do not have a refresh token. Attempted `refreshToken` operations fail. | ||
<b>Signature:</b> | ||
```typescript | ||
authIdToken?: string; | ||
``` | ||
## FirebaseServerAppSettings.name | ||
There is no `getApp()` operation for `FirebaseServerApp`<!-- -->, 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. | ||
<b>Signature:</b> | ||
```typescript | ||
name?: undefined; | ||
``` | ||
## FirebaseServerAppSettings.releaseOnDeref | ||
An optional object. If provided, the Firebase SDK uses a `FinalizationRegistry` object to monitor the garbage collection status of the provided object. The Firebase SDK releases its reference on the `FirebaseServerApp` instance when the provided `releaseOnDeref` object is garbage collected. | ||
You can use this field to reduce memory management overhead for your application. If provided, an app running in a SSR pass does not need to perform `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 an error is thrown at `FirebaseServerApp` initialization. | ||
<b>Signature:</b> | ||
```typescript | ||
releaseOnDeref?: object; | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.