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

Duration of an hour is wrong #495

Open
RebSheb opened this issue Nov 9, 2023 · 4 comments
Open

Duration of an hour is wrong #495

RebSheb opened this issue Nov 9, 2023 · 4 comments

Comments

@RebSheb
Copy link

RebSheb commented Nov 9, 2023

Description

Hi, I was just looking at the code and testing to see if I could create a version with a longer than 1 hour console session and stumbled across the linked line. It states that there are 3200 seconds in an hour but 60 * 60 is in fact 3600? Perhaps I'm missing something or maybe it is a typo?

https://github.com/Noovolari/leapp/blob/11b375de7231a1f15ec95e736e1f779bad3ce6a0/packages/core/src/services/web-console-service.ts#L7C3-L7C3

Thanks,
Rob

@RebSheb
Copy link
Author

RebSheb commented Nov 9, 2023

Just searched for it and it also appears here:

const mockedSessionDuration = 3200;

And here:

const mockedSessionDuration = 3200;

@andreacavagna01
Copy link
Contributor

Thanks, surely this is a typo in the test. Thanks for the segnalation

@pethron
Copy link
Contributor

pethron commented Dec 19, 2023

Just chiming in; there's a typo in the variable's name instead of the actual duration.
The duration is purposely set to less than an hour to make it work with tools (like Terraform, AWS CLI, and such) that cache the credentials and don't always ask an external provider for the credentials. This caused some long-running commands or commands that were run near the expiration of the credentials to fail; the missing 400 seconds are practically a buffer. I think it's better to put it into the docs and comments.

@ericvilla
Copy link
Contributor

Hi everyone! There are two kinds of duration: one relative to the Leapp Session credentials, and the other relative to the web console. The second one has been set to 55 minutes in one of the latest releases; if the web console session expires, the user can manually re-open it from the desktop app to extend the duration.

"Default Webconsole Duration", which can be set from the global options menu, accepts values from 1 to 12 hours. This value is used to generate IAM Role Federated credentials and to open a new Web Console session. When a new Web Console session is created, even if its duration is 12 hours, it is considered expired when the underlying (AWS IAM Role Federated)/(AWS IAM Role Chained)/(AWS SSO Role) Session credentials are expired. i.e., AWS IAM Role Federated is the only scenario in which a Web Console session duration may last 12 hours.

I hope it makes sense to you @RebSheb. If you want to deepen the topic, please don't hesitate to keep in touch with us!

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

No branches or pull requests

4 participants