firebase / firebase-admin-java

Firebase Admin Java SDK
https://firebase.google.com/docs/admin/setup
Apache License 2.0
525 stars 253 forks source link

Connect to Firebase Storage Emulator? #570

Open ScottPierce opened 3 years ago

ScottPierce commented 3 years ago

[READ] Step 1: Are you in the right place?

[REQUIRED] Step 2: Describe your environment

[REQUIRED] Step 3: Describe the problem

I'm using this library and I'm trying to use the environment variable FIREBASE_STORAGE_EMULATOR_HOST to get it to point to the local emulator that I'm running. It doesn't seem to work. However, when I search for FIREBASE_STORAGE_EMULATOR_HOST in this project, I can't seem to find it either. The documentation lead me to believe that I can manipulate the SDK to use the emulator by setting this environment variable, but that doesn't seem to be the case for Java.

  1. Can someone confirm this?
  2. How should I be connecting my development server to the storage emulator? I detail how I tried to use the google cloud storage sdk to do that and failed here: https://github.com/googleapis/java-storage/issues/875
hiranya911 commented 2 years ago

This is how the Node.js Admin SDK does it: https://github.com/firebase/firebase-admin-node/blob/bf959e31ef0e04f7039db1c8f41c2fb70605757f/src/storage/storage.ts#L61

You should be able to do the same in Java by manually setting the STORAGE_EMULATOR_HOST environment variable.

ScottPierce commented 2 years ago

@hiranya911 I don't see this environment variable used anywhere in the project - https://github.com/firebase/firebase-admin-java/search?q=STORAGE_EMULATOR_HOST

What is your confidence level that this will work?

hiranya911 commented 2 years ago

That's an environment variable supported by the google-cloud-storage library.firebase-admin-java doesn't have any Storage implementation code.

Update: It looks like only the Node.js Storage client supports the emulator as of now. Java and other languages do not support it at all.

ScottPierce commented 2 years ago

@hiranya911 Is there any updated news regarding this?

mitschwimmer commented 2 years ago

@hiranya911 the PR https://github.com/firebase/firebase-admin-java/pull/523 and the issue https://github.com/firebase/firebase-admin-java/issues/452 lead me to believe otherwise. Can you state whether this is a feature you, or more specifically the Admin SDK, support?

lahirumaramba commented 2 years ago

The Admin Java SDK currently does not support the storage emulator. Please refer to the Admin SDK emulator availability for more information. We do not currently have immediate plans to add storage support. I will update this issue if there are any updates.

@mitschwimmer You are correct, the Admin Java SDK supports the Auth emulator since the v7.2.0 release. Looks like it is missing from the above availability matrix. We will get that page updated soon. Thanks!

ScottPierce commented 2 years ago

This is out of date. Java supports Auth Emulator now.

On Tue, Jan 25, 2022 at 1:05 PM Lahiru Maramba @.***> wrote:

The Admin Java SDK currently does not support the storage emulator. Please refer to the Admin SDK emulator availability https://firebase.google.com/docs/emulator-suite/install_and_configure#admin_sdk_availability for more information. We do not currently have immediate plans to add storage support. I will update this issue if there are any updates.

@mitschwimmer https://github.com/mitschwimmer You are correct, the Admin Java SDK supports the Auth emulator since the v7.2.0 release. Looks like it is missing from the above availability matrix. We will get that page updated soon. Thanks!

— Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-admin-java/issues/570#issuecomment-1021464687, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGUWAIU7SXPAFBIK4SGLNTUX3Q4XANCNFSM46UEJTIA . You are receiving this because you authored the thread.Message ID: @.***>

cvb941 commented 1 year ago

Any updates on this issue? We would like to use the Storage Emulator in our project.