mirror of
https://github.com/hashicorp/vault.git
synced 2026-02-18 18:38:08 -05:00
* [VAULT-33083] support mount external engine * add "Plugin type" and "Plugin version" fields to the enable mount page * add changelog * address copilot review comments * address PR comments, code cleanup * fix test failures * Add support for external plugins registered without a plugin version * external plugin should be enabled for enterprise only, plugin version should be mandatory for external plugins * fix tests * address copilot feedback * fix failing tests, add unit test coverage * address PR comments * address PR comments * remove dead code * move no external versions alert * Only show un-versioned plugin message if there are un-versioned plugins in the catalog. * address PR comments * use ApiService instead of custom PluginPinsService; fix failing tests * revert changes to forms/mount.ts and forms/auth/method.ts Co-authored-by: Shannon Roberts (Beagin) <beagins@users.noreply.github.com>
44 lines
1.4 KiB
JavaScript
44 lines
1.4 KiB
JavaScript
/**
|
|
* Copyright IBM Corp. 2016, 2025
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
import { setupTest } from 'ember-qunit';
|
|
import { module, test } from 'qunit';
|
|
import SecretsEngineForm from 'vault/forms/secrets/engine';
|
|
import { getExternalPluginNameFromBuiltin } from 'vault/utils/external-plugin-helpers';
|
|
|
|
module('Unit | Component | mount/secrets-engine-form', function (hooks) {
|
|
setupTest(hooks);
|
|
|
|
hooks.beforeEach(function () {
|
|
// Setup default model
|
|
const defaults = {
|
|
config: { listing_visibility: false },
|
|
options: { version: 2 },
|
|
};
|
|
this.model = new SecretsEngineForm(defaults, { isNew: true });
|
|
this.model.type = 'keymgmt';
|
|
this.model.data.path = 'keymgmt';
|
|
|
|
this.availableVersions = [
|
|
{ version: '1.0.0', isBuiltin: false },
|
|
{ version: '1.1.0', isBuiltin: false },
|
|
{ version: '2.0.0', isBuiltin: false },
|
|
{ version: '', isBuiltin: true },
|
|
];
|
|
});
|
|
|
|
test('getExternalPluginNameFromBuiltin returns correct name for keymgmt', function (assert) {
|
|
const externalName = getExternalPluginNameFromBuiltin('keymgmt');
|
|
assert.strictEqual(
|
|
externalName,
|
|
'vault-plugin-secrets-keymgmt',
|
|
'generates correct external plugin name for keymgmt'
|
|
);
|
|
});
|
|
|
|
test('model normalizedType returns correct value', function (assert) {
|
|
assert.strictEqual(this.model.normalizedType, 'keymgmt', 'returns correct normalized type');
|
|
});
|
|
});
|