Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-09-09 15:25:13 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-09-09 15:25:13 +0300
commit229ba800d77e9a2baed1ee8fcd937ac0b094c3e0 (patch)
treeafa45b0c71b9a5336629f66b9e913e0c861c9d87
parent4534c1b11dfc9cb500ca792a058e15bb4e710e52 (diff)
parente9cf9a233926e89ec115b4107e25ab958ee64f32 (diff)
Merge branch 'smh-fix-build-500' into 'master'
Bring back WithID to backchannel package as it is used in tests See merge request gitlab-org/gitaly!3849
-rw-r--r--internal/backchannel/server.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/backchannel/server.go b/internal/backchannel/server.go
index 1d40c0241..d318e929a 100644
--- a/internal/backchannel/server.go
+++ b/internal/backchannel/server.go
@@ -42,6 +42,13 @@ func GetPeerID(ctx context.Context) (ID, error) {
return wrapper.peerID(), nil
}
+// WithID stores the ID in the provided AuthInfo so it can be later accessed by the RPC handler.
+// GetYamuxSession gets the yamux session of the current peer connection.
+// This is exported to facilitate testing.
+func WithID(authInfo credentials.AuthInfo, id ID) credentials.AuthInfo {
+ return authInfoWrapper{id: id, AuthInfo: authInfo}
+}
+
// GetYamuxSession gets the yamux session of the current peer connection.
func GetYamuxSession(ctx context.Context) (*yamux.Session, error) {
peerInfo, ok := peer.FromContext(ctx)