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
Commit bb4b8091 authored by Rémy Coutable's avatar Rémy Coutable
Browse files

Merge branch 'backport-112-to-3-6-stable' into '3-6-stable'

Backport "Pass relevant git environment variables while calling `/allowed`" to 3-6-stable

See merge request !120
parents 0cc6cfc1 f85d650e
No related branches found
No related tags found
No related merge requests found
v3.6.7
- Send (a selection of) git environment variables while making the API call to `/allowed`, !112
v3.6.6
- Re-use the default logger when logging metrics data
Loading
Loading
3.6.6
3.6.7
Loading
Loading
@@ -21,7 +21,12 @@ class GitlabAccess
end
def exec
status = api.check_access('git-receive-pack', @repo_name, @actor, @changes, @protocol)
env = {
"GIT_ALTERNATE_OBJECT_DIRECTORIES" => ENV["GIT_ALTERNATE_OBJECT_DIRECTORIES"],
"GIT_OBJECT_DIRECTORY" => ENV["GIT_OBJECT_DIRECTORY"]
}
status = api.check_access('git-receive-pack', @repo_name, @actor, @changes, @protocol, env: env.to_json)
raise AccessDeniedError, status.message unless status.allowed?
Loading
Loading
Loading
Loading
@@ -15,14 +15,15 @@ class GitlabNet
CHECK_TIMEOUT = 5
READ_TIMEOUT = 300
def check_access(cmd, repo, actor, changes, protocol)
def check_access(cmd, repo, actor, changes, protocol, env: {})
changes = changes.join("\n") unless changes.kind_of?(String)
params = {
action: cmd,
changes: changes,
project: project_name(repo),
protocol: protocol
protocol: protocol,
env: env
}
if actor =~ /\Akey\-\d+\Z/
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