Skip to content

Commit

Permalink
Added secret manager API enablement on ext:install (#5702)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelgj committed Apr 17, 2023
1 parent d1244ee commit fd879c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@
- firestore:locations
- Adds `extensions` as an option in `firebase init`.
- Relaxed repo URI validation in ext:dev:publish (#5698).
- Added Secret Manager API enablement during ext:install for extensions that use secrets (#5702).
5 changes: 5 additions & 0 deletions src/commands/ext-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { getProjectId, needProjectId } from "../projectUtils";
import * as extensionsApi from "../extensions/extensionsApi";
import { ExtensionVersion, ExtensionSource } from "../extensions/types";
import * as refs from "../extensions/refs";
import * as secretsUtils from "../extensions/secretsUtils";
import { displayWarningPrompts } from "../extensions/warnings";
import * as paramHelper from "../extensions/paramHelper";
import {
Expand Down Expand Up @@ -197,6 +198,10 @@ async function installToManifest(options: InstallExtensionOptions): Promise<void
);
}

if (secretsUtils.usesSecrets(spec)) {
await secretsUtils.ensureSecretManagerApiEnabled(options);
}

const config = manifest.loadConfig(options);

let instanceId = spec.name;
Expand Down

0 comments on commit fd879c2

Please sign in to comment.