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

Make TokenManager#token_ttl callable (evaluated at call time) #15124

Merged
merged 4 commits into from
May 19, 2017

Conversation

imtayadeway
Copy link
Contributor

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

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
@miq-bot
Copy link
Member

miq-bot commented May 17, 2017

Checked commits imtayadeway/manageiq@e3a880a~...9fa3858 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
3 files checked, 0 offenses detected
Everything looks fine. 🍰

Copy link
Member

@isimluk isimluk left a 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! 👏

Copy link
Member

@jvlcek jvlcek left a 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.

@abellotti
Copy link
Member

LGTM!! Thanks @imtayadeway for fixing this. 🎵

@abellotti abellotti merged commit e35b6c2 into ManageIQ:master May 19, 2017
@abellotti abellotti added this to the Sprint 61 Ending May 22, 2017 milestone May 19, 2017
@chrispy1
Copy link

@miq-bot add-label fine/yes

simaishi pushed a commit that referenced this pull request Jun 8, 2017
Make TokenManager#token_ttl callable (evaluated at call time)
(cherry picked from commit e35b6c2)

https://bugzilla.redhat.com/show_bug.cgi?id=1459987
@simaishi
Copy link
Contributor

simaishi commented Jun 8, 2017

Fine backport details:

$ git log -1
commit e201995ab0a9e6df7837866ad43e6b7557d6c003
Author: Alberto Bellotti <abellotti@users.noreply.github.com>
Date:   Thu May 18 21:12:43 2017 -0400

    Merge pull request #15124 from imtayadeway/api/token-manager-token-ttl
    
    Make TokenManager#token_ttl callable (evaluated at call time)
    (cherry picked from commit e35b6c20838e9d63fc6ab8c90ad94a4e8210a4a3)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1459987

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

Successfully merging this pull request may close these issues.

7 participants