Commit 89a2d435 authored by Jacob Vosmaer's avatar Jacob Vosmaer

We don't need an around_filter

parent ebb6a075
...@@ -7,7 +7,7 @@ class Projects::GitHttpController < Projects::ApplicationController ...@@ -7,7 +7,7 @@ class Projects::GitHttpController < Projects::ApplicationController
# Git clients will not know what authenticity token to send along # Git clients will not know what authenticity token to send along
skip_before_action :verify_authenticity_token skip_before_action :verify_authenticity_token
skip_before_action :repository skip_before_action :repository
around_action :authenticate_user before_action :authenticate_user
before_action :ensure_project_found! before_action :ensure_project_found!
# GET /foo/bar.git/info/refs?service=git-upload-pack (git pull) # GET /foo/bar.git/info/refs?service=git-upload-pack (git pull)
...@@ -44,8 +44,7 @@ class Projects::GitHttpController < Projects::ApplicationController ...@@ -44,8 +44,7 @@ class Projects::GitHttpController < Projects::ApplicationController
def authenticate_user def authenticate_user
if project && project.public? && upload_pack? if project && project.public? && upload_pack?
yield return # Allow access
return
end end
if allow_basic_auth? && has_basic_credentials?(request) if allow_basic_auth? && has_basic_credentials?(request)
...@@ -61,8 +60,7 @@ class Projects::GitHttpController < Projects::ApplicationController ...@@ -61,8 +60,7 @@ class Projects::GitHttpController < Projects::ApplicationController
end end
if ci? || user if ci? || user
yield return # Allow access
return
end end
elsif allow_kerberos_spnego_auth? && has_spnego_credentials?(request) elsif allow_kerberos_spnego_auth? && has_spnego_credentials?(request)
spnego_token = Base64.strict_decode64(auth_param(request)) spnego_token = Base64.strict_decode64(auth_param(request))
...@@ -70,8 +68,7 @@ class Projects::GitHttpController < Projects::ApplicationController ...@@ -70,8 +68,7 @@ class Projects::GitHttpController < Projects::ApplicationController
if user if user
set_www_authenticate(spnego_challenge) if spnego_response_token set_www_authenticate(spnego_challenge) if spnego_response_token
yield return # Allow access
return
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment