Skip to content

Conversation

@egor-miasnikov
Copy link
Contributor

@egor-miasnikov egor-miasnikov commented Aug 28, 2020

Description

Supports firebase-functions SDK feature in firebase/firebase-function#770

functions .runWith({ serviceAccountEmail: 'test-service-account@test.iam.gserviceaccount.com' }) .auth.user() .onCreate((user) => user);

It's an important feature for people who want to decrease and/or granulate roles and permission. For instance, read-only access for their cloud functions to a CloudSQL database. Currently, a developer needs to use the second deploy process for functions to change the service account.

Scenarios Tested

I've tested creating a new cloud function with specific service account and it works. I also tried updating a function and works fine too. I also tested without setting the service account property and it worked too (will be set default service account)

Sample Commands

No actual change in CLI options.

@samtstern
Copy link
Contributor

@egor-miasnikov thanks for this contribution! Let's first discuss on firebase-functions and then come back here if/when that is approved.

@lmakarov
Copy link

Currently, a developer needs to use the second deploy process for functions to change the service account.

@egor-miasnikov would you mind sharing more details about how you are currently changing the service account for a firebase function?

@egor-miasnikov
Copy link
Contributor Author

hey, @lmakarov we did double deploy for functions, but currently, after this PR we're using patched firebase libraries with our changes ;) and waiting for some news from @samtstern

@lmakarov
Copy link

lmakarov commented Nov 4, 2020

we did double deploy for functions

@egor-miasnikov do you mean something like?

firebase deploy --only functions:<function-name> gcloud functions deploy <function-name> --service-account=<custom-service-account> 
@egor-miasnikov
Copy link
Contributor Author

egor-miasnikov commented Nov 25, 2020

@lmakarov exactly

@joehan
Copy link
Contributor

joehan commented Nov 30, 2020

Hey all, sorry for the delay on this, the API review slipped past us for a bit, but it is approved now! There were a few other changes to the API requested, so I'm going to make those this week and do some testing. I'm hoping to get this released sometime later this week if all goes well. Thanks for the contribution and patience!

@joehan joehan merged commit 8697759 into firebase:master Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Manual indication that this has passed CLA.

5 participants