dev_ec
jingquan huang 5 years ago
parent e3c66ae7f6
commit 2911459aa8

@ -8,7 +8,10 @@ class GitsController < ApplicationController
# 供 git-workhorse反向调用认证 # 供 git-workhorse反向调用认证
def auth def auth
# HTTP_AUTHORIZATION: "Basic 这里base64编码的的密码(user:passwd)" # HTTP_AUTHORIZATION: "Basic 这里base64编码的的密码(user:passwd)"
decodes = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z)
rand_code = decodes.sample(10).join
logger.info("11111112222223333 HTTP_AUTHORIZATION: #{request.env["HTTP_AUTHORIZATION"]}") logger.info("11111112222223333 HTTP_AUTHORIZATION: #{request.env["HTTP_AUTHORIZATION"]}")
logger.info("1111111 git auth start: code is #{rand_code}, time is #{Time.now}")
# logger.info("#########-----request_env: #{request.env}") # logger.info("#########-----request_env: #{request.env}")
# {"service"=>"git-receive-pack", "controller"=>"gits", "action"=>"auth", # {"service"=>"git-receive-pack", "controller"=>"gits", "action"=>"auth",
# "url"=>"forge01/cermyt39.git/info/refs"} # "url"=>"forge01/cermyt39.git/info/refs"}
@ -68,6 +71,7 @@ class GitsController < ApplicationController
authenticate_or_request_with_http_basic do |username, password| authenticate_or_request_with_http_basic do |username, password|
result result
logger.info("1111111 git auth end: code is #{rand_code}, time is #{Time.now}")
end end
end end

Loading…
Cancel
Save