firebase / firebase/firebase-tools
[Emulator] Support generateSignedPostPolicyV4 in Storage Emulator
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.3k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 84
Description
**Description:**
Currently, the Firebase Storage Emulator does not fully support `generateSignedPostPolicyV4`.
When using this method in a local environment, it fails to route requests to the local emulator endpoint,
making it difficult to test authenticated direct uploads (POST) without hitting production buckets.
Example:
```ts
const [signedUrl] = await bucket.file(filePath).generateSignedPostPolicyV4({
expires: expirationTime,
conditions,
fields,
});
```
I would like to propose adding support for `generateSignedPostPolicyV4` within the Firebase Storage Emulator.
I have already implemented this feature and verified its functionality in a local environment.
**Important Dependency Note:**
This feature requires `@google-cloud/storage` version 7.20.0 or higher.
Previously (in v7.19.0 and below), there was an issue where `STORAGE_EMULATOR_HOST` was not correctly respected for certain signed URL operations.
I have personally contributed to the `@google-cloud/storage` library to fix this, and the fix was officially released in version 7.20.0.
Therefore, updating this dependency is a prerequisite for this feature.
[Issue link](https://github.com/googleapis/nodejs-storage/issues/2715)
[PR link](https://github.com/googleapis/nodejs-storage/pull/2716)
I almost have the implementation ready and would like to submit a Pull Request to contribute this feature to firebase-tools.
Please let me know if there are any specific guidelines I should follow before opening the PR.
Contributor guide
Assessment
This issue has not been assessed yet.