As we reevaluate how to best support and maintain Staging Ref in the future, we encourage development teams using this environment to highlight their use cases in the following issue: https://gitlab.com/gitlab-com/gl-infra/software-delivery/framework/software-delivery-framework-issue-tracker/-/issues/36.

Skip to content
Snippets Groups Projects
Unverified Commit b07facd9 authored by Ash McKenzie's avatar Ash McKenzie
Browse files

Log check_access result, including gl_type

parent 3ef2adf3
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -4,12 +4,12 @@ class GitAccessStatus
HTTP_MULTIPLE_CHOICES = '300'.freeze
attr_reader :message, :gl_repository, :gl_project_path, :gl_id, :gl_username,
:gitaly, :git_protocol, :git_config_options, :payload,
:gl_type, :gitaly, :git_protocol, :git_config_options, :payload,
:gl_console_messages
def initialize(status, status_code, message, gl_repository: nil,
gl_project_path: nil, gl_id: nil,
gl_username: nil, gitaly: nil, git_protocol: nil,
gl_username: nil, gl_type: nil, gitaly: nil, git_protocol: nil,
git_config_options: nil, payload: nil, gl_console_messages: [])
@status = status
@status_code = status_code
Loading
Loading
@@ -18,6 +18,7 @@ class GitAccessStatus
@gl_project_path = gl_project_path
@gl_id = gl_id
@gl_username = gl_username
@gl_type = gl_type
@git_config_options = git_config_options
@gitaly = gitaly
@git_protocol = git_protocol
Loading
Loading
@@ -34,6 +35,7 @@ class GitAccessStatus
gl_project_path: values["gl_project_path"],
gl_id: values["gl_id"],
gl_username: values["gl_username"],
gl_type: values["gl_type"],
git_config_options: values["git_config_options"],
gitaly: values["gitaly"],
git_protocol: values["git_protocol"],
Loading
Loading
@@ -48,4 +50,8 @@ class GitAccessStatus
def custom_action?
@status_code == HTTP_MULTIPLE_CHOICES
end
def success?
@status == true
end
end
Loading
Loading
@@ -31,7 +31,12 @@ class GitlabNet # rubocop:disable Metrics/ClassLength
url = "#{internal_api_endpoint}/allowed"
resp = post(url, params)
access_status_from_response(resp)
access_status_from_response(resp) do |access_status|
$logger.info('check_access result', success: access_status.success?,
gl_id: access_status.gl_id,
gl_username: access_status.gl_username,
gl_type: access_status.gl_type)
end
end
def discover(who)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment