Skip to content

Commit 316aaad

Browse files
committed
Fix issue when using kerberos auth with Rails 7
kerberos auth requires a wait_for_task under the covers. When we create this task, we store a backup copy of the incoming request params within the session object, so we can restore it later after the task we are waiting for has completed, and that session object is `Marshal.dump`ed into memcached. In Rails 7, Rails changed the ActionController::Parameters object to include some more objects as context, such as the request, and the request internally has an IO object that cannot be dumped. Since we don't actually need the context and instead only need the parameters, we can use `to_unsafe_h` instead of `deep_dup`, to get a copy of those parameters in HashWithIndifferentAccess form. Later when wait_for_task reconstructs the parameters, they will be placed back into the request object, which will get them back into the ActionController::Parameters format.
1 parent c01c87e commit 316aaad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/application_controller/wait_for_task.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def initiate_wait_for_task(options = {})
4949
session[:async][:params] ||= {}
5050

5151
# save the incoming parms + extra_params
52-
session[:async][:params] = params.deep_dup.merge(options[:extra_params] || {})
52+
session[:async][:params] = params.to_unsafe_h.merge(options[:extra_params] || {})
5353
session[:async][:params][:task_id] = task_id
5454

5555
# override method to be called, when the task is done

0 commit comments

Comments
 (0)