diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-09-09 15:25:13 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-09-09 15:25:13 +0300 |
commit | 229ba800d77e9a2baed1ee8fcd937ac0b094c3e0 (patch) | |
tree | afa45b0c71b9a5336629f66b9e913e0c861c9d87 | |
parent | 4534c1b11dfc9cb500ca792a058e15bb4e710e52 (diff) | |
parent | e9cf9a233926e89ec115b4107e25ab958ee64f32 (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.go | 7 |
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) |