-
Notifications
You must be signed in to change notification settings - Fork 897
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
Make TokenManager#token_ttl callable (evaluated at call time) #15124
Make TokenManager#token_ttl callable (evaluated at call time) #15124
Conversation
If we pass in a value that can change (i.e. settings), it's evaluated once at construction time and will never change. Thus, if a user changes the session time out setting, a restart of the server is required. By making this value callable we can delay evaluation until call time, which honors updated settings values. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1451848
Checked commits imtayadeway/manageiq@e3a880a~...9fa3858 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pretty cool and clever! 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@imtayadeway This is great! Thank you. I approve the PR.
LGTM!! Thanks @imtayadeway for fixing this. 🎵 |
@miq-bot add-label fine/yes |
Make TokenManager#token_ttl callable (evaluated at call time) (cherry picked from commit e35b6c2) https://bugzilla.redhat.com/show_bug.cgi?id=1459987
Fine backport details:
|
If we pass in a value that can change (i.e. settings), it's evaluated
once at construction time and will never change. Thus, if a user
changes the session time out setting, a restart of the server is
required.
By making this value callable we can delay evaluation until call time,
which honors updated settings values.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1451848
/cc @isimluk @jvlcek
@miq-bot add-label bug, api
@miq-bot assign @abellotti