From 5099cef3834db49b40cf5c35c19de86fd3f7489d Mon Sep 17 00:00:00 2001 From: Noelle Daley Date: Mon, 29 Oct 2018 15:44:06 -0700 Subject: [PATCH] enable alicloud in the ui --- ui/app/helpers/mountable-secret-engines.js | 6 ++++ .../components/wizard/alicloud-engine.hbs | 10 ++++++ .../secrets/backend/alicloud/secret-test.js | 31 +++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 ui/app/templates/components/wizard/alicloud-engine.hbs create mode 100644 ui/tests/acceptance/secrets/backend/alicloud/secret-test.js diff --git a/ui/app/helpers/mountable-secret-engines.js b/ui/app/helpers/mountable-secret-engines.js index 7d348985a..5868aec62 100644 --- a/ui/app/helpers/mountable-secret-engines.js +++ b/ui/app/helpers/mountable-secret-engines.js @@ -7,6 +7,12 @@ const MOUNTABLE_SECRET_ENGINES = [ type: 'ad', category: 'cloud', }, + { + displayName: 'AliCloud', + value: 'alicloud', + type: 'alicloud', + category: 'cloud', + }, { displayName: 'AWS', value: 'aws', diff --git a/ui/app/templates/components/wizard/alicloud-engine.hbs b/ui/app/templates/components/wizard/alicloud-engine.hbs new file mode 100644 index 000000000..8ff92bb4b --- /dev/null +++ b/ui/app/templates/components/wizard/alicloud-engine.hbs @@ -0,0 +1,10 @@ + +

+ The AliCloud secrets engine dynamically generates AliCloud access tokens based on RAM policies, or AliCloud STS credentials based on RAM roles. This generally makes working with AliCloud easier, since it does not involve clicking in the web UI. The AliCloud access tokens are time-based and are automatically revoked when the Vault lease expires. STS credentials are short-lived, non-renewable, and expire on their own. +

+
diff --git a/ui/tests/acceptance/secrets/backend/alicloud/secret-test.js b/ui/tests/acceptance/secrets/backend/alicloud/secret-test.js new file mode 100644 index 000000000..8181890c1 --- /dev/null +++ b/ui/tests/acceptance/secrets/backend/alicloud/secret-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 | alicloud/enable', function(hooks) { + setupApplicationTest(hooks); + + hooks.beforeEach(function() { + return authPage.login(); + }); + + test('enable alicloud', async function(assert) { + let enginePath = `alicloud-${new Date().getTime()}`; + await mountSecrets.visit(); + await mountSecrets.selectType('alicloud'); + 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 alicloud engine'); + }); +});