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
00450af7
Commit
00450af7
authored
9 years ago
by
murgatroid99
Browse files
Options
Downloads
Patches
Plain Diff
Made ruby per-rpc creds interop use auth plugin API
parent
a4d3d2c7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/ruby/lib/grpc.rb
+2
-2
2 additions, 2 deletions
src/ruby/lib/grpc.rb
src/ruby/pb/test/client.rb
+11
-7
11 additions, 7 deletions
src/ruby/pb/test/client.rb
with
13 additions
and
9 deletions
src/ruby/lib/grpc.rb
+
2
−
2
View file @
00450af7
# Copyright 2015, Google Inc.
# Copyright 2015
-2016
, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
...
...
@@ -27,7 +27,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ssl_roots_path
=
File
.
expand_path
(
'../../../etc/roots.pem'
,
__FILE__
)
ssl_roots_path
=
File
.
expand_path
(
'../../../
../
etc/roots.pem'
,
__FILE__
)
unless
ENV
[
'GRPC_DEFAULT_SSL_ROOTS_FILE_PATH'
]
ENV
[
'GRPC_DEFAULT_SSL_ROOTS_FILE_PATH'
]
=
ssl_roots_path
end
...
...
This diff is collapsed.
Click to expand it.
src/ruby/pb/test/client.rb
+
11
−
7
View file @
00450af7
#!/usr/bin/env ruby
# Copyright 2015, Google Inc.
# Copyright 2015
-2016
, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
...
...
@@ -266,16 +266,20 @@ class NamedTests
def
per_rpc_creds
auth_creds
=
Google
::
Auth
.
get_application_default
(
@args
.
oauth_scope
)
kw
=
auth_creds
.
updater_proc
.
call
({})
update_metadata
=
proc
do
|
md
|
kw
=
auth_creds
.
updater_proc
.
call
({})
# TODO(jtattermusch): downcase the metadata keys here to make sure
# they are not rejected by C core. This is a hotfix that should
# be addressed by introducing auto-downcasing logic.
kw
=
Hash
[
kw
.
each_pair
.
map
{
|
k
,
v
|
[
k
.
downcase
,
v
]
}]
# TODO(mlumish): downcase the metadata keys here to make sure
# they are not rejected by C core. This is a hotfix that should
# be addressed by introducing auto-downcasing logic.
Hash
[
kw
.
each_pair
.
map
{
|
k
,
v
|
[
k
.
downcase
,
v
]
}]
end
call_creds
=
GRPC
::
Core
::
CallCredentials
.
new
(
update_metadata
)
resp
=
perform_large_unary
(
fill_username:
true
,
fill_oauth_scope:
true
,
**
kw
)
credentials:
call_creds
)
json_key
=
File
.
read
(
ENV
[
AUTH_ENV
])
wanted_email
=
MultiJson
.
load
(
json_key
)[
'client_email'
]
assert
(
"
#{
__callee__
}
: bad username"
)
{
wanted_email
==
resp
.
username
}
...
...
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