-
Notifications
You must be signed in to change notification settings - Fork 902
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance the IAM role binding process (#4511)
* change up ordering, add jump out points, and add sleep * linting * yanking out sleep, adding in a better error message for the first deploy, and replacing reduce with our functional module * adding changelog
- Loading branch information
1 parent
1a75c1c
commit 6dd0b84
Showing
9 changed files
with
241 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
- Add support for secrets to v2 functions (#4451). | ||
- Fixes an issue where `ext:export` would write different param values than what it displayed in the prompt (#4515). | ||
- Enhances the functions IAM permission process and updates the error messages (#4511). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { bold } from "cli-color"; | ||
import { serviceUsageOrigin } from "../api"; | ||
import { Client } from "../apiv2"; | ||
import { FirebaseError } from "../error"; | ||
import * as utils from "../utils"; | ||
|
||
const apiClient = new Client({ | ||
urlPrefix: serviceUsageOrigin, | ||
apiVersion: "v1beta1", | ||
}); | ||
|
||
/** | ||
* Generate the service account for the service. Note: not every service uses the endpoint. | ||
* @param projectNumber gcp project number | ||
* @param service the service api (ex~ pubsub.googleapis.com) | ||
* @returns | ||
*/ | ||
export async function generateServiceIdentity( | ||
projectNumber: string, | ||
service: string, | ||
prefix: string | ||
) { | ||
utils.logLabeledBullet(prefix, `generating the service identity for ${bold(service)}...`); | ||
try { | ||
return await apiClient.post<unknown, unknown>( | ||
`projects/${projectNumber}/services/${service}:generateServiceIdentity` | ||
); | ||
} catch (err: unknown) { | ||
throw new FirebaseError(`Error generating the service identity for ${service}.`, { | ||
original: err as Error, | ||
}); | ||
} | ||
} |
Oops, something went wrong.