Skip to content
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

Storage security rules is always overwritten when I call firebase init storage #8170

Open
fanwgwg opened this issue Feb 5, 2025 · 1 comment

Comments

@fanwgwg
Copy link

fanwgwg commented Feb 5, 2025

[REQUIRED] Environment info

firebase-tools: 13.30.0

Platform: macOS

[REQUIRED] Test case

  1. Have some existing storage security rules on the Firebase console
  2. In CLI, run firebase init storage
  3. The storage.rules will be created from fresh, instead of downloading the latest rules in the console, therefore the next time when I run firebase deploy, all the security rules are overwritten.

[REQUIRED] Steps to reproduce

As mentioned above

[REQUIRED] Expected behavior

This behaviour is different from firestore security rules, where running firebase init firestore, the local file firestore.rules will be a copy of what I have in the console, instead of an empty template.

[REQUIRED] Actual behavior

The local rules are created from empty template.

@aalej
Copy link
Contributor

aalej commented Feb 5, 2025

Hey @fanwgwg, thanks for the detailed report! Let me try to ask our engineering team to see if we could modify the firebase init storage command's logic to first check for an existing Storage security rules in the Firebase project. If the rules exist, download and use them. Otherwise, create a new rules file from the template.

internal tracking bug: b/394778942

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants