Comments (4)
Making a dry run call when the number of the added resources changes only fixes half of the problem.
The another part comes from the way AccessDurationRequest
component is written. Because it keeps the list of options in its own state, it ignores any changes to the accessRequest.maxDuration
prop.
There is a useEffect
that updates this state when assumeStartTime
changes, but ignores accessRequest
.
When this was added, we talked that this is a React anti-pattern, and you planned to refactor that later.
I think that ideally it should work as below:
- Get rid of all state and effects in
AccessDurationRequest
. - Duration options should be calculated at
useRequestCheckout
level (anduseAccessRequestCheckout
in Connect, respectively). These options shouldn't be kept in the state, but rather calculated dynamically. - The selected option should be kept at the top level in the component hierarchy, as it is now . We would update its value in the callback that makes the dry run call.
- The ideal UX would be to update this value only if it is empty or not in the new list of options. But for simplicity we can always overwrite it after making the dry run call.
- To avoid code duplication, I would keep that logic in a hook like
useRequestDuration
and use in Web UI and Connect.
@kimlisa do you have time do address this problem?
Alternatively, if we don't have time for such refactor, we could only add making the dry run call and adjust the useEffect
to run when accessRequest.maxDuration
changes.
from teleport.
oh that's so weird... i run into similar problem in the web UI where
- requesting from the access request page gives me the correct max (12 hours, fyi this is your session TTL, and it will be lower the longer you've been logged in)
- requesting from the resource list gives me max 8 hours
from teleport.
I think I know what's going on.
We used to make the access request dry run call when the checkout sidebar opened. However, in the unified resources it is opened permanently, so we make the call only when the component mounts (so we send an empty request and it returns that 4 minutes duration).
To fix this, we should make the dry run call every time the user adds a resource.
It also looks like we had a bug even previously, because we didn't make the call if the resource was removed from a request. I don't think this is correct, and we should always call dry run when the number of added resources changes, correct? cc @kimlisa
from teleport.
i'm in a good place to start refactoring and i'll tackle this today
from teleport.
Related Issues (20)
- Routing of proxied requests HOT 1
- Support database access for CosmosDB APIs
- Resource enrollment flows should not default to "auto-discovery" HOT 1
- Discover RDS IAM script issues
- Discover RDS database registration issues HOT 2
- Discover RDS security group picker is confusing HOT 1
- User creation in Discover RDS flow is a pain HOT 2
- Show commands available to an `observer` within a moderated session
- eggsoil
- Capability to provide custom tags to all teleport-managed/created cloud resources
- Teleport Connect tab with CLI database client hangs if client is not found
- Procedure for OpenSSH Cert Authority Rotation HOT 2
- Unexpected behavior with role mapping using Trusted Cluster using AWS role ARNS
- Improve tctl user experience HOT 1
- Support optional argument to `tsh proxy kube --exec` to specify process to run in the new shell
- `tsh proxy aws` fails after one minute when using per-session MFA HOT 4
- Support more user-friendly UX for `tsh proxy aws`
- Remote port forwarding with Teleport doesn't correctly unbind port when client disconnects HOT 1
- Automatic updates restarts Teleport when agent is healthy
- config file log level affects `teleport` command verbosity HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teleport.