UI - only look for data.keys if it's not a queryRecord request on secrets (#6023)

This commit is contained in:
Matthew Irish 2019-01-10 11:18:29 -06:00 committed by GitHub
parent 8da2e1e9b0
commit 118ce23f12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -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 => {

View file

@ -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' });