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
Fixes #31177 - make registration variables more readable #8106
Conversation
Issues: #31177 |
@@ -19,18 +19,20 @@ def global_registration_vars | |||
host_group = Hostgroup.authorized(:view_hostgroups).find(params['hostgroup_id']) if params["hostgroup_id"].present? | |||
operatingsystem = Operatingsystem.authorized(:view_operatingsystems).find(params['operatingsystem_id']) if params["operatingsystem_id"].present? | |||
|
|||
context = { | |||
user: User.current, | |||
auth_token: User.current.jwt_token!(expiration: 4.hours.to_i), |
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.
Any idea why we are using 4.hours.to_i, does 4 hours has a significance or it is a random time frame?
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.
It was there before, just moving things around. However, I would agree that it's ugly that it's hardcoded and not even a constant.
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.
makes sense 👍
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.
a bit of offtopic to this PR: We could extract that to be configurable, however is that necessary? Personally I'd wait until someone asks for it, the first token is configurable already. We have enough settings already. The other option would be to base on the expiration set for the first request. However do not that these two expirations are not the same thing. If you think it's valuable, please describe how we should set this and link the issue to https://projects.theforeman.org/issues/30440.
@ares, this pull request is currently not mergeable. Please rebase against the develop branch and push again. If you have a remote called 'upstream' that points to this repository, you can do this by running:
This message was auto-generated by Foreman's prprocessor |
PR rebased and empty line added, this should be good for merge |
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.
Thanks!
No description provided.