Skip to content

[Emulator] Support generateSignedPostPolicyV4 in Storage Emulator #10488

@7hokerz

Description

@7hokerz

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:

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
PR link

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions