Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
d24424ff
Commit
d24424ff
authored
9 years ago
by
murgatroid99
Browse files
Options
Downloads
Patches
Plain Diff
Fixed stub construction in interop client
parent
afe3974b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ruby/pb/test/client.rb
+6
-6
6 additions, 6 deletions
src/ruby/pb/test/client.rb
with
6 additions
and
6 deletions
src/ruby/pb/test/client.rb
+
6
−
6
View file @
d24424ff
...
@@ -114,8 +114,8 @@ end
...
@@ -114,8 +114,8 @@ end
def
create_stub
(
opts
)
def
create_stub
(
opts
)
address
=
"
#{
opts
.
host
}
:
#{
opts
.
port
}
"
address
=
"
#{
opts
.
host
}
:
#{
opts
.
port
}
"
if
opts
.
secure
if
opts
.
secure
creds
=
ssl_creds
(
opts
.
use_test_ca
)
stub_opts
=
{
stub_opts
=
{
:creds
=>
ssl_creds
(
opts
.
use_test_ca
),
GRPC
::
Core
::
Channel
::
SSL_TARGET
=>
opts
.
host_override
GRPC
::
Core
::
Channel
::
SSL_TARGET
=>
opts
.
host_override
}
}
...
@@ -125,7 +125,7 @@ def create_stub(opts)
...
@@ -125,7 +125,7 @@ def create_stub(opts)
unless
opts
.
oauth_scope
.
nil?
unless
opts
.
oauth_scope
.
nil?
auth_creds
=
Google
::
Auth
.
get_application_default
(
opts
.
oauth_scope
)
auth_creds
=
Google
::
Auth
.
get_application_default
(
opts
.
oauth_scope
)
call_creds
=
GRPC
::
Core
::
CallCredentials
.
new
(
auth_creds
.
updater_proc
)
call_creds
=
GRPC
::
Core
::
CallCredentials
.
new
(
auth_creds
.
updater_proc
)
stub_opts
[
:
creds
]
=
stub_opts
[
:
creds
]
.
compose
call_creds
creds
=
creds
.
compose
call_creds
end
end
end
end
...
@@ -135,20 +135,20 @@ def create_stub(opts)
...
@@ -135,20 +135,20 @@ def create_stub(opts)
# use a metadata update proc that just adds the auth token.
# use a metadata update proc that just adds the auth token.
call_creds
=
GRPC
::
Core
::
CallCredentials
.
new
(
proc
{
|
md
|
md
.
merge
(
kw
)
})
call_creds
=
GRPC
::
Core
::
CallCredentials
.
new
(
proc
{
|
md
|
md
.
merge
(
kw
)
})
stub_opts
[
:
creds
]
=
stub_opts
[
:
creds
]
.
compose
call_creds
creds
=
creds
.
compose
call_creds
end
end
if
opts
.
test_case
==
'jwt_token_creds'
# don't use a scope
if
opts
.
test_case
==
'jwt_token_creds'
# don't use a scope
auth_creds
=
Google
::
Auth
.
get_application_default
auth_creds
=
Google
::
Auth
.
get_application_default
call_creds
=
GRPC
::
Core
::
CallCredentials
.
new
(
auth_creds
.
updater_proc
)
call_creds
=
GRPC
::
Core
::
CallCredentials
.
new
(
auth_creds
.
updater_proc
)
stub_opts
[
:
creds
]
=
stub_opts
[
:
creds
]
.
compose
call_creds
creds
=
creds
.
compose
call_creds
end
end
GRPC
.
logger
.
info
(
"... connecting securely to
#{
address
}
"
)
GRPC
.
logger
.
info
(
"... connecting securely to
#{
address
}
"
)
Grpc
::
Testing
::
TestService
::
Stub
.
new
(
address
,
**
stub_opts
)
Grpc
::
Testing
::
TestService
::
Stub
.
new
(
address
,
creds
,
**
stub_opts
)
else
else
GRPC
.
logger
.
info
(
"... connecting insecurely to
#{
address
}
"
)
GRPC
.
logger
.
info
(
"... connecting insecurely to
#{
address
}
"
)
Grpc
::
Testing
::
TestService
::
Stub
.
new
(
address
)
Grpc
::
Testing
::
TestService
::
Stub
.
new
(
address
,
:this_channel_is_insecure
)
end
end
end
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment