Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
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
Boxiang Sun
gitlab-ce
Commits
57d34848
Commit
57d34848
authored
Oct 16, 2017
by
Jacob Vosmaer (GitLab)
Committed by
Sean McGivern
Oct 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix confusing double usage of 'metadata'
parent
8aa6e7ef
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
lib/gitlab/gitaly_client.rb
lib/gitlab/gitaly_client.rb
+16
-4
No files found.
lib/gitlab/gitaly_client.rb
View file @
57d34848
...
@@ -70,15 +70,27 @@ module Gitlab
...
@@ -70,15 +70,27 @@ module Gitlab
# All Gitaly RPC call sites should use GitalyClient.call. This method
# All Gitaly RPC call sites should use GitalyClient.call. This method
# makes sure that per-request authentication headers are set.
# makes sure that per-request authentication headers are set.
#
# This method optionally takes a block which receives the keyword
# arguments hash 'kwargs' that will be passed to gRPC. This allows the
# caller to modify or augment the keyword arguments. The block must
# return a hash.
#
# For example:
#
# GitalyClient.call(storage, service, rpc, request) do |kwargs|
# kwargs.merge(deadline: Time.now + 10)
# end
#
def
self
.
call
(
storage
,
service
,
rpc
,
request
)
def
self
.
call
(
storage
,
service
,
rpc
,
request
)
enforce_gitaly_request_limits
(
:call
)
enforce_gitaly_request_limits
(
:call
)
metadata
=
request_metadata
(
storage
)
kwargs
=
request_kwargs
(
storage
)
metadata
=
yield
(
metadata
)
if
block_given?
kwargs
=
yield
(
kwargs
)
if
block_given?
stub
(
service
,
storage
).
__send__
(
rpc
,
request
,
metadata
)
# rubocop:disable GitlabSecurity/PublicSend
stub
(
service
,
storage
).
__send__
(
rpc
,
request
,
kwargs
)
# rubocop:disable GitlabSecurity/PublicSend
end
end
def
self
.
request_
metadata
(
storage
)
def
self
.
request_
kwargs
(
storage
)
encoded_token
=
Base64
.
strict_encode64
(
token
(
storage
).
to_s
)
encoded_token
=
Base64
.
strict_encode64
(
token
(
storage
).
to_s
)
metadata
=
{
metadata
=
{
'authorization'
=>
"Bearer
#{
encoded_token
}
"
,
'authorization'
=>
"Bearer
#{
encoded_token
}
"
,
...
...
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