Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UI - allow kv secret with "keys" key #6023

Merged
merged 1 commit into from
Jan 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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