Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-shell
Commits
10b19aab
Commit
10b19aab
authored
Jul 06, 2017
by
Kim "BKC" Carlbäcker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Authentication
parent
947d4d49
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
go/internal/handler/receive_pack.go
go/internal/handler/receive_pack.go
+9
-1
go/internal/handler/upload_pack.go
go/internal/handler/upload_pack.go
+9
-1
No files found.
go/internal/handler/receive_pack.go
View file @
10b19aab
...
@@ -5,7 +5,10 @@ import (
...
@@ -5,7 +5,10 @@ import (
"fmt"
"fmt"
"os"
"os"
"google.golang.org/grpc"
pb
"gitlab.com/gitlab-org/gitaly-proto/go"
pb
"gitlab.com/gitlab-org/gitaly-proto/go"
"gitlab.com/gitlab-org/gitaly/auth"
"gitlab.com/gitlab-org/gitaly/client"
"gitlab.com/gitlab-org/gitaly/client"
)
)
...
@@ -14,7 +17,12 @@ func ReceivePack(gitalyAddress string, request *pb.SSHReceivePackRequest) (int32
...
@@ -14,7 +17,12 @@ func ReceivePack(gitalyAddress string, request *pb.SSHReceivePackRequest) (int32
return
-
1
,
fmt
.
Errorf
(
"no gitaly_address given"
)
return
-
1
,
fmt
.
Errorf
(
"no gitaly_address given"
)
}
}
conn
,
err
:=
client
.
Dial
(
gitalyAddress
,
client
.
DefaultDialOpts
)
connOpts
:=
client
.
DefaultDialOpts
if
token
:=
os
.
Getenv
(
"GITALY_TOKEN"
);
token
!=
""
{
connOpts
=
append
(
client
.
DefaultDialOpts
,
grpc
.
WithPerRPCCredentials
(
gitalyauth
.
RPCCredentials
(
token
)))
}
conn
,
err
:=
client
.
Dial
(
gitalyAddress
,
connOpts
)
if
err
!=
nil
{
if
err
!=
nil
{
return
-
1
,
err
return
-
1
,
err
}
}
...
...
go/internal/handler/upload_pack.go
View file @
10b19aab
...
@@ -5,7 +5,10 @@ import (
...
@@ -5,7 +5,10 @@ import (
"fmt"
"fmt"
"os"
"os"
"google.golang.org/grpc"
pb
"gitlab.com/gitlab-org/gitaly-proto/go"
pb
"gitlab.com/gitlab-org/gitaly-proto/go"
"gitlab.com/gitlab-org/gitaly/auth"
"gitlab.com/gitlab-org/gitaly/client"
"gitlab.com/gitlab-org/gitaly/client"
)
)
...
@@ -14,7 +17,12 @@ func UploadPack(gitalyAddress string, request *pb.SSHUploadPackRequest) (int32,
...
@@ -14,7 +17,12 @@ func UploadPack(gitalyAddress string, request *pb.SSHUploadPackRequest) (int32,
return
-
1
,
fmt
.
Errorf
(
"no gitaly_address given"
)
return
-
1
,
fmt
.
Errorf
(
"no gitaly_address given"
)
}
}
conn
,
err
:=
client
.
Dial
(
gitalyAddress
,
client
.
DefaultDialOpts
)
connOpts
:=
client
.
DefaultDialOpts
if
token
:=
os
.
Getenv
(
"GITALY_TOKEN"
);
token
!=
""
{
connOpts
=
append
(
client
.
DefaultDialOpts
,
grpc
.
WithPerRPCCredentials
(
gitalyauth
.
RPCCredentials
(
token
)))
}
conn
,
err
:=
client
.
Dial
(
gitalyAddress
,
connOpts
)
if
err
!=
nil
{
if
err
!=
nil
{
return
-
1
,
err
return
-
1
,
err
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment