Нема описа
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

functions-secrets-access.js 816B

123456789101112131415161718
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.command = void 0;
  4. const command_1 = require("../command");
  5. const logger_1 = require("../logger");
  6. const projectUtils_1 = require("../projectUtils");
  7. const secretManager_1 = require("../gcp/secretManager");
  8. exports.command = new command_1.Command("functions:secrets:access <KEY>[@version]")
  9. .description("Access secret value given secret and its version. Defaults to accessing the latest version.")
  10. .action(async (key, options) => {
  11. const projectId = (0, projectUtils_1.needProjectId)(options);
  12. let [name, version] = key.split("@");
  13. if (!version) {
  14. version = "latest";
  15. }
  16. const value = await (0, secretManager_1.accessSecretVersion)(projectId, name, version);
  17. logger_1.logger.info(value);
  18. });