fireemu 0.21.0 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -16
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ Fireemu is being developed to close these gaps. For example, it provides:
|
|
|
16
16
|
|
|
17
17
|
Fireemu is still in development and does not yet reproduce every feature and behavior of production Firebase. Before relying on Fireemu’s test results in CI or other automated workflows, we recommend differential testing against production Firebase services for the features and critical workflows your application uses. Run the same tests against Fireemu and a dedicated Firebase test project, and check for differences in results and behavior that could affect your application. Use a dedicated test project, not your live production project.
|
|
18
18
|
|
|
19
|
-
See the [capability manifest](https://github.com/t-k/fireemu/blob/v0.
|
|
19
|
+
See the [capability manifest](https://github.com/t-k/fireemu/blob/v0.23.0/crates/fireemu/src/capabilities.json) and [compatibility documentation](https://github.com/t-k/fireemu/blob/v0.23.0/docs/compatibility-contract.md) for supported features, known differences, and the status of compatibility verification.
|
|
20
20
|
|
|
21
21
|
## Quick start
|
|
22
22
|
|
|
@@ -72,13 +72,13 @@ Fireemu supports Cloud Firestore, Firebase Authentication (Identity Platform), C
|
|
|
72
72
|
| Cloud Pub/Sub | Schemas, BigQuery and Cloud Storage subscription delivery, and some APIs such as `UpdateTopic` are not supported. |
|
|
73
73
|
| Firebase App Check | Local testing with debug tokens is supported. Real attestation through Play Integrity, App Attest, DeviceCheck, or reCAPTCHA, and replay protection using limited-use tokens, are not supported. |
|
|
74
74
|
|
|
75
|
-
This table highlights key limitations; it is not exhaustive. Check individual API support and conditions with the following command or the [capability manifest](https://github.com/t-k/fireemu/blob/v0.
|
|
75
|
+
This table highlights key limitations; it is not exhaustive. Check individual API support and conditions with the following command or the [capability manifest](https://github.com/t-k/fireemu/blob/v0.23.0/crates/fireemu/src/capabilities.json).
|
|
76
76
|
|
|
77
77
|
```sh
|
|
78
78
|
npx fireemu capabilities
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
See the [Functions support inventory](https://github.com/t-k/fireemu/blob/v0.
|
|
81
|
+
See the [Functions support inventory](https://github.com/t-k/fireemu/blob/v0.23.0/docs/functions-export-inventory.md) for support by trigger type.
|
|
82
82
|
|
|
83
83
|
### Unsupported products
|
|
84
84
|
|
|
@@ -139,7 +139,7 @@ Use `--ui-port 0` to disable the UI. When automatic UI startup cannot bind the d
|
|
|
139
139
|
|
|
140
140
|
When a Functions codebase is loaded, the Functions page shows registered functions, triggers, invocation results, and logs. You can run scheduled functions immediately or advance the virtual clock to their next scheduled execution.
|
|
141
141
|
|
|
142
|
-
For clock-sensitive and parallel integration tests, [test clocks and independent worlds](https://github.com/t-k/fireemu/blob/v0.
|
|
142
|
+
For clock-sensitive and parallel integration tests, [test clocks and independent worlds](https://github.com/t-k/fireemu/blob/v0.23.0/docs/test-worlds.md) describes explicit Node Date/timer/Cloud Tasks policies and the `fireemu/testing` helper. Separate worlds isolate their clocks, Rules, Functions and service state, including when they use the same project ID.
|
|
143
143
|
|
|
144
144
|
### Export data
|
|
145
145
|
|
|
@@ -200,7 +200,7 @@ An existing `fireemu.toml` is not overwritten unless `--force` is supplied. An e
|
|
|
200
200
|
`up`, `exec`, `emulators:start` and `emulators:exec` choose their configuration files as follows.
|
|
201
201
|
|
|
202
202
|
1. `--config <file>` and `--firebase-json <file>` load exactly the files they name, and nothing is searched for. `--config` parses a `.toml` path as TOML (case-insensitive, including `.TOML`) and every other extension as JSON. A TOML configuration must set `schemaVersion = 1`; it is never read as a `firebase.json`, which is JSON only. `--firebase-json` always reads JSON.
|
|
203
|
-
2. Otherwise, the single `fireemu.toml` or `fireemu.json` in the current directory is loaded as if it were passed with `--config`. If both files exist, startup is refused: remove one or select a file with `--config`. Its `firebaseJson` entry, resolved relative to the loaded file, names the `firebase.json` to load. A `firebase.json` beside a `fireemu.toml` without a `firebaseJson` entry is not loaded, and the startup output says so. Neither `fireemu.toml` nor `fireemu.json` in a parent directory is used, because the paths it contains are relative to the current directory.
|
|
203
|
+
2. Otherwise, the single `fireemu.toml` or `fireemu.json` in the current directory is loaded as if it were passed with `--config`. If both files exist, startup is refused: remove one or select a file with `--config`. Its `firebaseJson` entry, resolved relative to the loaded file, names the `firebase.json` to load. A `firebase.json` beside a `fireemu.toml` without a `firebaseJson` entry is not loaded, and the startup output says so. Neither `fireemu.toml` nor `fireemu.json` in a parent directory is used, because the paths it contains are relative to the current directory. Relative paths inside a canonical file (`rules.source`, `storage.rules`, `functions.source`, `firestore.indexFile` and the other file settings) are read from the working directory, whichever directory the file is in; only `firebaseJson` and the paths inside a `firebase.json` are read from the file's own directory.
|
|
204
204
|
3. Otherwise, the nearest `firebase.json` is loaded as if it were passed with `--firebase-json`: the one in the current directory, else the first one found in a parent directory, as the Firebase CLI finds it. Its paths and the `.firebaserc` beside it are read from its directory.
|
|
205
205
|
4. Otherwise, the built-in defaults apply, and no Security Rules are loaded.
|
|
206
206
|
|
|
@@ -272,7 +272,7 @@ JSON also works: existing `fireemu.json` files and `--config <path>.json` remain
|
|
|
272
272
|
| Unsigned emulator custom tokens are accepted | `auth.allowUnsignedCustomTokens` | refused |
|
|
273
273
|
| Firestore and Storage Security Rules accept `@firebase/rules-unit-testing`'s unsigned mock ID token (`authenticatedContext()`, the client SDK's `mockUserToken`) | `auth.allowUnsignedIdTokens` | mock-token fallback disabled; normally verified fireemu-issued tokens still accepted |
|
|
274
274
|
| Identity-provider sign-in accepts the fixture assertions and the sign-in widget (`/emulator/auth/handler`), for built-in, `oidc.*` and `saml.*` providers; under `strict` an `oidc.*` or `saml.*` provider must still be configured and enabled (`auth.providers` or the Admin API), as production requires | `auth.idpAssertions` (`"fixture"`) | `"signed"`: OIDC ID tokens must verify with an `auth.idpSigners` key, SAML responses with the provider's certificates, and the fixture and built-in providers are refused |
|
|
275
|
-
| The strict Eventarc listener admits any credential or none, so the Admin SDK publishes with a fake credential (see [Eventarc authentication](https://github.com/t-k/fireemu/blob/v0.
|
|
275
|
+
| The strict Eventarc listener admits any credential or none, so the Admin SDK publishes with a fake credential (see [Eventarc authentication](https://github.com/t-k/fireemu/blob/v0.23.0/docs/eventarc-authentication.md)) | `eventarc.authentication` (`"permissive"`) | `"production"`: a missing, malformed or JWT-shaped bearer is refused with production's 401 |
|
|
276
276
|
| A tenant of `auth.tenants` can have any readable id, such as `tenant-a` | `auth.tenantIdFormat` (`"readable"`) | the id must have production's generated form, the display name, a hyphen and five characters of `a-z0-9` (`"generated"`) |
|
|
277
277
|
| Multi-tenancy is on: the Admin API creates tenants and `auth.tenants` loads without an `updateConfig` call | `auth.multiTenant.allowTenants` (`true`) | unset until it is enabled, as in a new production project: tenant routes are refused and `auth.tenants` needs `allowTenants: true` |
|
|
278
278
|
| Multi-factor authentication is on, SMS and TOTP, without a console toggle, an `updateConfig` call or an `auth.mfa` block | `auth.mfa` (`state: "ENABLED"`, `PHONE_SMS` and TOTP) | off until enabled, as in a new production project: enrollment is refused with `OPERATION_NOT_ALLOWED : SMS based MFA not enabled.` or `TOTP based MFA not enabled.` |
|
|
@@ -320,7 +320,7 @@ You can also name the configuration file with `--config`.
|
|
|
320
320
|
npx fireemu up --config ./fireemu.toml
|
|
321
321
|
```
|
|
322
322
|
|
|
323
|
-
Keep Fireemu-specific settings in a Fireemu configuration file containing `schemaVersion = 1`, rather than in `firebase.json`. See the [configuration schema](https://github.com/t-k/fireemu/blob/v0.
|
|
323
|
+
Keep Fireemu-specific settings in a Fireemu configuration file containing `schemaVersion = 1`, rather than in `firebase.json`. See the [configuration schema](https://github.com/t-k/fireemu/blob/v0.23.0/spec/config/fireemu.schema.json) for all available settings.
|
|
324
324
|
|
|
325
325
|
### Firebase Authentication (Identity Platform) configuration
|
|
326
326
|
|
|
@@ -351,9 +351,9 @@ Unsigned custom tokens minted by the Firebase Admin SDK in emulator mode are acc
|
|
|
351
351
|
|
|
352
352
|
The unsigned mock ID token of `@firebase/rules-unit-testing` is accepted by default when Firestore and Storage Security Rules are evaluated, including with the `strict` profile. This is the token `authenticatedContext()` and the client SDKs' `mockUserToken` option send (`createMockUserToken` in `@firebase/util`). Normal verification runs first. Only after it fails can the mock-token fallback accept a token. Under `strict` that fallback accepts only the exact SDK shape: a JWT whose header is exactly `{"alg":"none","type":"JWT"}` and whose signature is empty. `request.auth` is built from the token's claims, as the official emulator builds it, when the token names a subject (`sub`) and its audience (`aud`) is the project the request goes to. Its `exp` is not checked, because the SDK sets `iat: 0` and `exp: 3600` by default. Every other token is verified as before, expiry included. That covers the unsigned ID tokens fireemu itself issues (their header carries `typ`, not `type`), and a token that claims a signature that does not verify is still refused. The `emulator` profile accepts any unsigned token, as the official emulator does, and its Storage also accepts another project's token. Set `auth.allowUnsignedIdTokens` to `false` (in either profile) or set `productionExact` to disable this fallback. Neither setting refuses fireemu-issued unsigned ID tokens that pass normal verification. Changing only an issued token's header to the SDK shape can still pass normal verification of its payload; it is not a refusal test. For a refusal test, use `createMockUserToken` with its default `iat: 0` / `exp: 3600`, or construct that exact header and empty signature with those times, a subject and the routed project as audience, and run with a clock after expiry (including Firestore's 30-second allowance). A session with `auth.idTokenSigning = "session-rsa"` accepts no unsigned token. The setting does not affect callable Functions, Identity Toolkit or App Check.
|
|
353
353
|
|
|
354
|
-
See the [configuration schema](https://github.com/t-k/fireemu/blob/v0.
|
|
354
|
+
See the [configuration schema](https://github.com/t-k/fireemu/blob/v0.23.0/spec/config/fireemu.schema.json) for the format and accepted values of each setting.
|
|
355
355
|
|
|
356
|
-
Declare `auth.authorizedDomains`, for example `["localhost", "app.test"]`, to set the initial project-wide list in either profile. The list replaces the defaults, so include `localhost` if your tests use it. An empty list authorizes no host under `strict`; an absent or `null` setting keeps the existing defaults (`localhost` and the project's `firebaseapp.com` and `web.app` domains). Validation uses the Admin API's rules for the selected profile, including its conversion of numeric and boolean entries to strings and omission of `null` entries; use strings when writing the list. Fireemu intentionally keeps `localhost` in its defaults for development. The [recorded production sandbox baseline](https://github.com/t-k/fireemu/blob/v0.
|
|
356
|
+
Declare `auth.authorizedDomains`, for example `["localhost", "app.test"]`, to set the initial project-wide list in either profile. The list replaces the defaults, so include `localhost` if your tests use it. An empty list authorizes no host under `strict`; an absent or `null` setting keeps the existing defaults (`localhost` and the project's `firebaseapp.com` and `web.app` domains). Validation uses the Admin API's rules for the selected profile, including its conversion of numeric and boolean entries to strings and omission of `null` entries; use strings when writing the list. Fireemu intentionally keeps `localhost` in its defaults for development. The [recorded production sandbox baseline](https://github.com/t-k/fireemu/blob/v0.23.0/conformance/auth-action-production.json) does not include it; new production projects may also omit it. This default is a Fireemu-only convenience, and declaring the list replaces it. Tenant-scoped strict action links currently check the tenant's default domains rather than this project declaration; support for the parent project's live list is pending.
|
|
357
357
|
|
|
358
358
|
An Admin update changes the live list. A session reset restores the declared list, when present, and preserves an Admin-written list when no initial list was declared. Projects created later receive the declaration word for word, independently of the default project's live list; listing a particular project's `firebaseapp.com` or `web.app` domain therefore gives later projects that same domain. Clearing accounts leaves the live list alone. Auth export/import carries accounts without the domain list or its declaration. The `emulator` profile accepts the setting and exposes the list, while continuing to allow action-link continue URLs outside it.
|
|
359
359
|
|
|
@@ -442,7 +442,7 @@ adjacentIntervals = 1
|
|
|
442
442
|
|
|
443
443
|
#### Enable multi-tenancy
|
|
444
444
|
|
|
445
|
-
Multi-tenancy works by default under both profiles: a new project allows tenants, so the Admin API creates them and `auth.tenants` loads without `multiTenant.allowTenants`. `productionExact` (`strict` only) starts a project as production does, with the switch unset until it is enabled through the Admin API, or with `auth.multiTenant` in the file (see "Start with tenants" below). A declared `allowTenants: false` always turns it off. See the [compatibility documentation](https://github.com/t-k/fireemu/blob/v0.
|
|
445
|
+
Multi-tenancy works by default under both profiles: a new project allows tenants, so the Admin API creates them and `auth.tenants` loads without `multiTenant.allowTenants`. `productionExact` (`strict` only) starts a project as production does, with the switch unset until it is enabled through the Admin API, or with `auth.multiTenant` in the file (see "Start with tenants" below). A declared `allowTenants: false` always turns it off. See the [compatibility documentation](https://github.com/t-k/fireemu/blob/v0.23.0/docs/compatibility-contract.md) for the supported Admin API scope.
|
|
446
446
|
|
|
447
447
|
#### Start with tenants
|
|
448
448
|
|
|
@@ -493,7 +493,7 @@ A manual run (`POST /v1/sessions/{session}/functions/{name}:run`) enqueues one r
|
|
|
493
493
|
|
|
494
494
|
On a task-queue function (`onTaskDispatched`), the same `POST /v1/sessions/{session}/functions/{name}:run` releases the Cloud Tasks that wait for their `scheduleTime`: all of them, or the one named by a `{"task": "<task id>"}` body (404 when no waiting task has that id). Under the strict profile a task enqueued with a `scheduleTime` waits for it, so this is how a test runs a task due in an hour without moving the clock; a released task still obeys the queue's rate and concurrency limits. The Functions page of the Emulator UI lists the waiting tasks with their due time and a **Run now** button.
|
|
495
495
|
|
|
496
|
-
See the [configuration schema](https://github.com/t-k/fireemu/blob/v0.
|
|
496
|
+
See the [configuration schema](https://github.com/t-k/fireemu/blob/v0.23.0/spec/config/fireemu.schema.json) for available settings and values.
|
|
497
497
|
|
|
498
498
|
### Firestore history limits
|
|
499
499
|
|
|
@@ -569,7 +569,7 @@ Fireemu is compatible with the listed Local Emulator Suite products as shipped b
|
|
|
569
569
|
|
|
570
570
|
The `strict` and `emulator` profiles differ in some behaviors to serve their respective purposes. Where the official emulator and production Firebase disagree, Fireemu also adopts production behavior in some cases and records the difference.
|
|
571
571
|
|
|
572
|
-
Check support for the specific APIs and conditions your application uses, rather than relying on product names alone. The [compatibility contract](https://github.com/t-k/fireemu/blob/v0.
|
|
572
|
+
Check support for the specific APIs and conditions your application uses, rather than relying on product names alone. The [compatibility contract](https://github.com/t-k/fireemu/blob/v0.23.0/spec/compatibility/contract.json) records scope and known differences. The [compatibility documentation](https://github.com/t-k/fireemu/blob/v0.23.0/docs/compatibility-contract.md) explains the verification process and how to interpret its records.
|
|
573
573
|
|
|
574
574
|
### Network exposure of the Storage port
|
|
575
575
|
|
|
@@ -600,7 +600,7 @@ allowNonLoopbackHosts = true
|
|
|
600
600
|
|
|
601
601
|
### Changes between versions
|
|
602
602
|
|
|
603
|
-
Configuration and behavior may change between releases. See the [CHANGELOG](https://github.com/t-k/fireemu/blob/v0.
|
|
603
|
+
Configuration and behavior may change between releases. See the [CHANGELOG](https://github.com/t-k/fireemu/blob/v0.23.0/CHANGELOG.md) for release changes.
|
|
604
604
|
|
|
605
605
|
## Performance
|
|
606
606
|
|
|
@@ -617,7 +617,7 @@ The following results come from one `standard` run at commit `f3b942c`. Ratios a
|
|
|
617
617
|
|
|
618
618
|
The 95% confidence interval for the startup-time ratio is `[21.4, 21.8]`. For the peak-memory ratio, calculated as official emulator divided by Fireemu, it is `[10.2, 11.1]`.
|
|
619
619
|
|
|
620
|
-
See [benchmark.yml](https://github.com/t-k/fireemu/blob/v0.
|
|
620
|
+
See [benchmark.yml](https://github.com/t-k/fireemu/blob/v0.23.0/.github/workflows/benchmark.yml) for the workflow and [`tools/bench/`](https://github.com/t-k/fireemu/tree/v0.23.0/tools/bench/) for the benchmark implementation.
|
|
621
621
|
|
|
622
622
|
## Reporting issues and contributing
|
|
623
623
|
|
|
@@ -625,8 +625,8 @@ When reporting an issue, include the Fireemu and Firebase SDK versions, the prof
|
|
|
625
625
|
|
|
626
626
|
For compatibility issues, also state whether you are comparing against the actual Firebase service or the official emulator, along with the expected and actual results. Remove credentials and personal information before sharing configuration files or logs.
|
|
627
627
|
|
|
628
|
-
See the [development guide](https://github.com/t-k/fireemu/blob/v0.
|
|
628
|
+
See the [development guide](https://github.com/t-k/fireemu/blob/v0.23.0/docs/development.md) for build and test instructions.
|
|
629
629
|
|
|
630
630
|
## License
|
|
631
631
|
|
|
632
|
-
Fireemu is licensed under the [Apache License 2.0](https://github.com/t-k/fireemu/blob/v0.
|
|
632
|
+
Fireemu is licensed under the [Apache License 2.0](https://github.com/t-k/fireemu/blob/v0.23.0/LICENSE). Third-party notices are listed in [THIRD_PARTY_LICENSES.txt](https://github.com/t-k/fireemu/blob/v0.23.0/THIRD_PARTY_LICENSES.txt).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fireemu",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "A local runtime for testing Firebase SDK and Functions code, checked against production Firebase behavior",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"emulator",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
],
|
|
32
32
|
"type": "module",
|
|
33
33
|
"optionalDependencies": {
|
|
34
|
-
"@fireemu/darwin-arm64": "0.
|
|
35
|
-
"@fireemu/darwin-x64": "0.
|
|
36
|
-
"@fireemu/linux-x64": "0.
|
|
37
|
-
"@fireemu/linux-arm64": "0.
|
|
38
|
-
"@fireemu/win32-x64": "0.
|
|
34
|
+
"@fireemu/darwin-arm64": "0.23.0",
|
|
35
|
+
"@fireemu/darwin-x64": "0.23.0",
|
|
36
|
+
"@fireemu/linux-x64": "0.23.0",
|
|
37
|
+
"@fireemu/linux-arm64": "0.23.0",
|
|
38
|
+
"@fireemu/win32-x64": "0.23.0"
|
|
39
39
|
},
|
|
40
40
|
"engines": {
|
|
41
41
|
"node": ">=20"
|