From c10291c17dce0b456d6da028d622cb4be0bdbec8 Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Mon, 29 Oct 2018 12:32:27 -0700 Subject: [PATCH] enable gcpkms --- ui/app/helpers/mountable-secret-engines.js | 6 ++++ .../components/wizard/gcpkms-engine.hbs | 10 ++++++ ui/app/templates/svg/icons/enable/gcpkms.hbs | 1 + .../secrets/backend/gcpkms/secrets-test.js | 31 +++++++++++++++++++ 4 files changed, 48 insertions(+) create mode 100644 ui/app/templates/components/wizard/gcpkms-engine.hbs create mode 100644 ui/app/templates/svg/icons/enable/gcpkms.hbs create mode 100644 ui/tests/acceptance/secrets/backend/gcpkms/secrets-test.js diff --git a/ui/app/helpers/mountable-secret-engines.js b/ui/app/helpers/mountable-secret-engines.js index 5868aec62..7256b3dce 100644 --- a/ui/app/helpers/mountable-secret-engines.js +++ b/ui/app/helpers/mountable-secret-engines.js @@ -43,6 +43,12 @@ const MOUNTABLE_SECRET_ENGINES = [ type: 'gcp', category: 'cloud', }, + { + displayName: 'Google Cloud KMS', + value: 'gcpkms', + type: 'gcpkms', + category: 'cloud', + }, { displayName: 'KV', value: 'kv', diff --git a/ui/app/templates/components/wizard/gcpkms-engine.hbs b/ui/app/templates/components/wizard/gcpkms-engine.hbs new file mode 100644 index 000000000..25559b960 --- /dev/null +++ b/ui/app/templates/components/wizard/gcpkms-engine.hbs @@ -0,0 +1,10 @@ + +

+ The Google Cloud KMS Vault secrets engine provides encryption and key management via Google Cloud KMS. It supports management of keys, including creation, rotation, and revocation, as well as encrypting and decrypting data with managed keys. This enables management of KMS keys through Vault's policies and IAM system. +

+
diff --git a/ui/app/templates/svg/icons/enable/gcpkms.hbs b/ui/app/templates/svg/icons/enable/gcpkms.hbs new file mode 100644 index 000000000..78dc96cf6 --- /dev/null +++ b/ui/app/templates/svg/icons/enable/gcpkms.hbs @@ -0,0 +1 @@ + diff --git a/ui/tests/acceptance/secrets/backend/gcpkms/secrets-test.js b/ui/tests/acceptance/secrets/backend/gcpkms/secrets-test.js new file mode 100644 index 000000000..aff902dd7 --- /dev/null +++ b/ui/tests/acceptance/secrets/backend/gcpkms/secrets-test.js @@ -0,0 +1,31 @@ +import { currentRouteName } from '@ember/test-helpers'; +import { module, test } from 'qunit'; +import { setupApplicationTest } from 'ember-qunit'; +import mountSecrets from 'vault/tests/pages/settings/mount-secret-backend'; +import backendsPage from 'vault/tests/pages/secrets/backends'; +import authPage from 'vault/tests/pages/auth'; +import withFlash from 'vault/tests/helpers/with-flash'; + +module('Acceptance | gcpkms/enable', function(hooks) { + setupApplicationTest(hooks); + + hooks.beforeEach(function() { + return authPage.login(); + }); + + test('enable gcpkms', async function(assert) { + let enginePath = `gcpkms-${new Date().getTime()}`; + await mountSecrets.visit(); + await mountSecrets.selectType('gcpkms'); + await withFlash( + mountSecrets + .next() + .path(enginePath) + .submit() + ); + + assert.equal(currentRouteName(), 'vault.cluster.secrets.backends', 'redirects to the backends page'); + + assert.ok(backendsPage.rows.filterBy('path', `${enginePath}/`)[0], 'shows the gcpkms engine'); + }); +});