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

KV search box when no list access to metadata #12626

Merged
merged 22 commits into from Sep 29, 2021
Merged

Conversation

Monkeychip
Copy link
Contributor

@Monkeychip Monkeychip commented Sep 24, 2021

This PR handles various permissions issues on the KV custom metadata project.

  1. When no list access on the metadata/ endpoint you can now search for a secret. If it doesn't exist or you don't have permissions then you see an error page. We could not catch the error and keep them on the same page because of control groups; they throw an identical error and we need to let it proceed.
Screen.Recording.2021-09-24.at.12.52.44.PM.mp4
  1. When no access to read on ${backend}/config, the config values (maxVersion, CAS, deleteVersionAfter) do not show.
Screen.Recording.2021-09-24.at.12.52.44.PM.mp4
  1. No read but create or update on metadata. The UI is requiring read permission or order to edit metadata.
Screen.Recording.2021-09-21.at.12.54.09.PM.mp4

@vercel vercel bot temporarily deployed to Preview – vault September 24, 2021 19:10 Inactive
@vercel vercel bot temporarily deployed to Preview – vault-storybook September 24, 2021 19:10 Inactive
@Monkeychip Monkeychip added this to the 1.9 milestone Sep 24, 2021
@Monkeychip Monkeychip marked this pull request as ready for review September 24, 2021 19:10
@Monkeychip Monkeychip changed the title get credentials card test and setup KV search box when no list access to metadata Sep 24, 2021
@@ -147,49 +147,4 @@ module('Acceptance | settings/mount-secret-backend', function(hooks) {
await settled();
assert.dom('[data-test-row-value="Maximum number of versions"]').hasText('Not set');
});

test('version 2 with no create to sys/mounts endpoint does not allows mounting of secret engine', async function(assert) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test was killing us. It is covered in other tests so I removed (it was one I created for the KV project).

@@ -391,7 +391,113 @@ module('Acceptance | secrets/secret/create', function(hooks) {
);
});

test('version 2 with restricted policy still allows creation', async function(assert) {
test('paths are properly encoded', async function(assert) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved all the policy tests together.

await click(`[data-test-auth-backend-link=${backend}]`);
await settled();
// this fails in IE11 on browserstack so going directly to URL
// let card = document.querySelector('[data-test-search-roles]').childNodes[1];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the issue with IE11

.catch(() => {
// there was an error likely in read metadata.
// still load the page and handle what you show by filtering for this property
this.noReadAccess = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to check for any particular error code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great question. Let me see if I can get more specific.

Copy link
Contributor

@arnav28 arnav28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants