Skip to content

Commit

Permalink
UI - only look for data.keys if it's not a queryRecord request on sec…
Browse files Browse the repository at this point in the history
…rets (#6023)
  • Loading branch information
meirish authored Jan 10, 2019
1 parent 8da2e1e commit 118ce23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ui/app/serializers/secret.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand Down
11 changes: 11 additions & 0 deletions ui/tests/acceptance/secrets/backend/kv/secret-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' });
Expand Down

0 comments on commit 118ce23

Please sign in to comment.