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

Gate sync overview route for users without access #27320

Conversation

andaley
Copy link
Contributor

@andaley andaley commented May 31, 2024

🛠️ Description

Adds a secondary layer of protection to the Sync overview page, ensuring users can't access the page by pasting the URL directly.

  • Adds additional acceptance tests to cover this. We already have thorough integration testing of the sidebar, sync page, and flags service, but the acceptance tests here help verify that the redirects are working if a user directly visits the URL.

🔗 Links

Follow up to https://github.com/hashicorp/vault/pull/27262/files

📸 Screenshots

Ent tests pass locally except for unrelated replication / kv tests
Screenshot 2024-05-31 at 4 50 24 PM

🏗️ How to Build and Test the Change

🚫 Using an OSS cluster, verify you cannot directly access http://localhost:4200/ui/vault/sync/secrets/overview.
✅ Using an ENT cluster, verify you can access http://localhost:4200/ui/vault/sync/secrets/overview (and see "sync" in the sidebar).

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label May 31, 2024
@andaley andaley marked this pull request as ready for review May 31, 2024 23:43
@andaley andaley requested a review from a team as a code owner May 31, 2024 23:43
@andaley andaley added this to the 1.17.1 milestone May 31, 2024
Copy link

CI Results: failed ❌

Copy link

Build Results:
All builds succeeded! ✅

Copy link
Contributor

@hashishaw hashishaw 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! A couple change requests, and I'm wondering with the ent tests failing -- were you running against an enterprise backend?

Copy link
Contributor

@hashishaw hashishaw left a comment

Choose a reason for hiding this comment

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

Beautiful, thank you!

@andaley andaley merged commit 51bf477 into ui/VAULT-27608/hide-secrets-sync-when-no-access Jun 3, 2024
20 of 23 checks passed
@andaley andaley deleted the ui/vault-27736/add-sync-redirect branch June 3, 2024 17:05
Monkeychip added a commit that referenced this pull request Jun 11, 2024
…issions (#27262)

* intial changes, haven't tested client counts or done test coverage

* client count rename getter to clairfy

* fix has-permission api-paths

* wip

* wip

* fix: explicitly refresh vault.cluster model to re-fetch activatedFeatures after actication

* tests: fix # of assertions for verifying that activation was called

* tests: tidy overview-test

* add additional api permission path and move fetch back to application

* add test coverage for the service

* cleanup

* remove test that checked for upsell without license or on community

* small comment change

* welp missed component getter

* flaky test fix

* flaky test

* small nit changes from pr reviews

* add defaults to sync mirage handler

* Gate sync overview route for users without access (#27320)

* routes: add redirect if user does not have access to sync

* tests: verify redirect on sync overview page happens

* tests: organize tests modules to ensure enterprise is explicitly set up

* add type enterprise required now because we do a check for this first

* fix oss test

---------

Co-authored-by: Noelle Daley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/1.17.x hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-changelog ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants