gravitational / teleport

The easiest, and most secure way to access and protect all of your infrastructure.
https://goteleport.com
GNU Affero General Public License v3.0
17.37k stars 1.74k forks source link

Drop Access Request doesn't refresh access #42381

Open scottpgallagher opened 3 months ago

scottpgallagher commented 3 months ago

Expected behavior: When dropping an Access Request in Teleport Connect that the page would refresh what a user had access to prior to escalation.

Current behavior: Dropping an Access Request does not refresh the page.

Workaround: You can click on another tab (eg Pinned Resources) and back and the privileges/resources will referesh.

Bug details:

ravicious commented 3 months ago

I ran into the same issue a couple of days ago. It certainly is an unexpected thing to happen, especially since assuming a request does refresh the resources.

I believe at the time when this was implemented, we ran into an "architectural" issue and we couldn't think of an easy way to fix this. Long story short, the function that refreshes resources cannot be called when dropping an access request due to hierarchy of React components.

However, I just talked about it with Grzegorz and there should be a straightforward way to address this. We need to move <ResourcesContext> in the hierarchy as high as needed. Then the two functions exposed by this context need to accept an extra arg which is the URI of the workspace which should refresh its resources in all open tabs.