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

Firebase storage rules don't reload on save #4366

Closed
DibyodyutiMondal opened this issue Mar 29, 2022 · 4 comments
Closed

Firebase storage rules don't reload on save #4366

DibyodyutiMondal opened this issue Mar 29, 2022 · 4 comments
Assignees

Comments

@DibyodyutiMondal
Copy link

DibyodyutiMondal commented Mar 29, 2022

[REQUIRED] Environment info

firebase-tools: 10.5.0

Platform: Windows 11, node 16

[REQUIRED] Test case

[REQUIRED] Steps to reproduce

rules_version = '2';
service firebase.storage {
  match /b/{bucket}/o {
    match /{file=**} {
      allow read, write: if true;
    }
  }
}

The above rule allows all operations

  1. Given the above rules, simply run the storage emulator, upload a file (example: file.txt).
  2. Then using a new browser tab, go to the emulator storage localhost url for that file (example: http://localhost:port/v0/b/project-id.appspot.com/o/file.txt). This should output the json of the object, as expected.
  3. Next, change the rules to allow read, write: if false. This disables all operations.
    The following is logged in the console:
    i storage: Change detected, updating rules for Cloud Storage...
  4. Reload the browser tab you had previously opened with the object's url. The json response still comes through instead of 403:Forbidden as it used to.
  5. Restart the emulator, then reload the tab for the file
  6. New rules now apply

[REQUIRED] Expected behavior

[REQUIRED] Actual behavior

@google-oss-bot
Copy link
Contributor

This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

@antoninbeaufort
Copy link

I can confirm that I have the same problem on same versions (firebase-tools, Windows and Node but I'm using WSL 2 with Ubuntu 20.04), need to restart emulators to get rules updated.

@yoavTaieb
Copy link

Same problem on Mac Monterey

@tohhsinpei
Copy link
Member

Thanks for the report. This should be fixed in #4337 which was included in yesterday's release. Let me know if the problem persists; otherwise closing the issue.

@tohhsinpei tohhsinpei self-assigned this Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants