Skip to content
GitLab
Next
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
gitlab-shell
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
GitLab.org
gitlab-shell
Merge requests
!969
An error occurred while fetching the assigned milestone of the selected merge_request.
Draft: Poc: Use SSH RPC exposed by Workhorse
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
Draft: Poc: Use SSH RPC exposed by Workhorse
id-use-workhorse-git-ssh-rpc
into
main
Overview
2
Commits
3
Pipelines
7
Changes
3
1 unresolved thread
Hide all comments
Closed
Igor Drozdov
requested to merge
id-use-workhorse-git-ssh-rpc
into
main
11 months ago
Overview
2
Commits
3
Pipelines
7
Changes
3
1 unresolved thread
Hide all comments
Expand
Related issue:
PoC: SSH requests routing (gitlab#438826 - closed)
0
0
Merge request reports
Viewing commit
e627f0d8
Prev
Next
Show latest version
3 files
+
49
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
e627f0d8
Poc: Use SSH RPC exposed by Workhorse
· e627f0d8
Igor Drozdov
authored
11 months ago
internal/command/uploadpack/git_workhorse_call.go
0 → 100644
+
41
−
0
Options
package
uploadpack
import
(
"context"
"crypto/tls"
"io"
"net"
"net/http"
"golang.org/x/net/http2"
"gitlab.com/gitlab-org/gitlab-shell/v14/internal/command/shared/accessverifier"
)
func
(
c
*
Command
)
performWorkhorseCall
(
ctx
context
.
Context
,
response
*
accessverifier
.
Response
)
error
{
client
:=
&
http
.
Client
{
Transport
:
&
http2
.
Transport
{
AllowHTTP
:
true
,
DialTLSContext
:
func
(
ctx
context
.
Context
,
network
,
addr
string
,
cfg
*
tls
.
Config
)
(
net
.
Conn
,
error
)
{
dialer
:=
&
net
.
Dialer
{}
return
dialer
.
DialContext
(
ctx
,
network
,
addr
)
},
},
}
req
,
err
:=
http
.
NewRequestWithContext
(
ctx
,
http
.
MethodPost
,
response
.
GitRpcUrl
,
io
.
NopCloser
(
c
.
ReadWriter
.
In
))
if
err
!=
nil
{
return
err
}
req
.
Header
.
Set
(
"Authorization"
,
response
.
GitRpcAuthHeader
)
resp
,
err
:=
client
.
Do
(
req
)
if
err
!=
nil
{
return
err
}
defer
resp
.
Body
.
Close
()
_
,
err
=
io
.
Copy
(
c
.
ReadWriter
.
Out
,
resp
.
Body
)
return
err
}
Loading