mirror of
https://github.com/hashicorp/vault.git
synced 2026-06-08 16:24:51 -04:00
UI - only look for data.keys if it's not a queryRecord request on secrets (#6023)
This commit is contained in:
parent
8da2e1e9b0
commit
118ce23f12
2 changed files with 12 additions and 1 deletions
|
|
@ -4,7 +4,7 @@ import ApplicationSerializer from './application';
|
|||
export default ApplicationSerializer.extend({
|
||||
secretDataPath: 'data',
|
||||
normalizeItems(payload, requestType) {
|
||||
if (payload.data.keys && Array.isArray(payload.data.keys)) {
|
||||
if (requestType !== 'queryRecord' && payload.data.keys && Array.isArray(payload.data.keys)) {
|
||||
// if we have data.keys, it's a list of ids, so we map over that
|
||||
// and create objects with id's
|
||||
return payload.data.keys.map(secret => {
|
||||
|
|
|
|||
|
|
@ -138,6 +138,17 @@ module('Acceptance | secrets/secret/create', function(hooks) {
|
|||
);
|
||||
});
|
||||
|
||||
// https://github.com/hashicorp/vault/issues/5994
|
||||
test('version 1: key named keys', async function(assert) {
|
||||
await consoleComponent.runCommands([
|
||||
'vault write sys/mounts/test type=kv',
|
||||
'refresh',
|
||||
'vault write test/a keys=a keys=b',
|
||||
]);
|
||||
await showPage.visit({ backend: 'test', id: 'a' });
|
||||
assert.ok(showPage.editIsPresent, 'renders the page properly');
|
||||
});
|
||||
|
||||
test('it redirects to the path ending in / for list pages', async function(assert) {
|
||||
const path = `foo/bar/kv-path-${new Date().getTime()}`;
|
||||
await listPage.visitRoot({ backend: 'secret' });
|
||||
|
|
|
|||
Loading…
Reference in a new issue