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

Emulator auth when using both PubSub and FirebaseAdmin #690

Open
jfbenckhuijsen opened this issue Oct 15, 2024 · 3 comments
Open

Emulator auth when using both PubSub and FirebaseAdmin #690

jfbenckhuijsen opened this issue Oct 15, 2024 · 3 comments

Comments

@jfbenckhuijsen
Copy link
Contributor

Hey @loicmathieu,

I think I've run into an issue when using both pubsub and the FirebaseAdmin module when using the emulator.

As per https://cloud.google.com/pubsub/docs/emulator#pubsub-emulator-java for PubSub we need to use the "NoCredentials" class when connecting to the emulator

As per https://stackoverflow.com/questions/63781560/connecting-to-firestore-emulator-from-java-admin-sdk you need to use the EmulatorCredentials when connecting to the emulator.

As per https://docs.quarkiverse.io/quarkus-google-cloud-services/main/#emulators we can configure both Credentials as a CDI bean and a CredentialsProvider as CDI bean.

You can configure the "Credentials" to be the EmulatorCredentials and the CredentialsProvider to be the NoCredentialsProvider, and then it seems to work, but this is hardly intuitive for a user of the library (and is not documented).

I'd propose we add config options like we did for the Firestore situation to have the library automatically configure the right credentials for the emulator to use and avoid the hassle of needing to create that mock bean.

We can easily achieve this by using Instance to retrieve it at runtime if the emulator is switched off I'd say?

Lemme know what you think, can create the PR of course.

@loicmathieu
Copy link
Collaborator

Well, this is annoying I agree, and the blame is upsteam ;)

But yes, if you can provide something that ease these cases, I'll be happy to review it

@jfbenckhuijsen
Copy link
Contributor Author

jfbenckhuijsen commented Nov 1, 2024

Initial version #705

@jfbenckhuijsen
Copy link
Contributor Author

Need to look into the Firebase Admin version still btw

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

2 participants