thisbejim / Pyrebase

A simple python wrapper for the Firebase API.
2.05k stars 525 forks source link

403 on Firebase Storage downloads #100

Open Kolymorph opened 7 years ago

Kolymorph commented 7 years ago

Can't download files with my service account, getting 403 Forbidden error. The only files I am allowed to download seem to be those that I have uploaded with Pyrebase on the same day. Older files and files uploaded from console/android are returning Forbidden. I do have an owner service account and firebase storage rules are set to allow read, write at all paths.

thisbejim commented 7 years ago

That's pretty weird, have you seen any changes in this behaviour since this post?

Kolymorph commented 7 years ago

No, the problem is still there. Seems to fail somewhere in here:


    def download(self, filename, token=None):
        # remove leading backlash
        path = self.path
        url = self.get_url(token)
        self.path = None
        if path.startswith('/'):
            path = path[1:]
        if self.credentials:
            blob = self.bucket.get_blob(path)

Images uploaded from Android fail getting blob, while pyrebase uploads do just fine.

shakirmengrani commented 7 years ago

i set my like as below then code runs fine service firebase.storage { match /b/shakirmengrani-8c9b1.appspot.com/o { match /{allPaths=} { allow read, write: if request.auth == null; } } } **