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
3b6fef12
Commit
3b6fef12
authored
9 years ago
by
Jan Tattermusch
Browse files
Options
Downloads
Patches
Plain Diff
fix some python auth interop tests
parent
e2a1bf46
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/python/grpcio_test/grpc_interop/client.py
+7
-2
7 additions, 2 deletions
src/python/grpcio_test/grpc_interop/client.py
tools/run_tests/run_interop_tests.py
+1
-1
1 addition, 1 deletion
tools/run_tests/run_interop_tests.py
with
8 additions
and
3 deletions
src/python/grpcio_test/grpc_interop/client.py
+
7
−
2
View file @
3b6fef12
...
@@ -71,12 +71,17 @@ def _oauth_access_token(args):
...
@@ -71,12 +71,17 @@ def _oauth_access_token(args):
def
_stub
(
args
):
def
_stub
(
args
):
if
args
.
oauth_scope
:
if
args
.
oauth_scope
:
if
args
.
test_case
==
'
oauth2_auth_token
'
:
if
args
.
test_case
==
'
oauth2_auth_token
'
:
# TODO(jtattermusch): This testcase sets the auth metadata key-value
# manually, which also means that the user would need to do the same
# thing every time he/she would like to use and out of band oauth token.
# The transformer function that produces the metadata key-value from
# the access token should be provided by gRPC auth library.
access_token
=
_oauth_access_token
(
args
)
access_token
=
_oauth_access_token
(
args
)
metadata_transformer
=
lambda
x
:
[
metadata_transformer
=
lambda
x
:
[
(
'
A
uthorization
'
,
'
Bearer %s
'
%
access_token
)]
(
'
a
uthorization
'
,
'
Bearer %s
'
%
access_token
)]
else
:
else
:
metadata_transformer
=
lambda
x
:
[
metadata_transformer
=
lambda
x
:
[
(
'
A
uthorization
'
,
'
Bearer %s
'
%
_oauth_access_token
(
args
))]
(
'
a
uthorization
'
,
'
Bearer %s
'
%
_oauth_access_token
(
args
))]
else
:
else
:
metadata_transformer
=
lambda
x
:
[]
metadata_transformer
=
lambda
x
:
[]
if
args
.
use_tls
:
if
args
.
use_tls
:
...
...
This diff is collapsed.
Click to expand it.
tools/run_tests/run_interop_tests.py
+
1
−
1
View file @
3b6fef12
...
@@ -350,7 +350,7 @@ def add_auth_options(language, test_case, cmdline, env):
...
@@ -350,7 +350,7 @@ def add_auth_options(language, test_case, cmdline, env):
default_account_arg
=
'
--default_service_account=830293263384-compute@developer.gserviceaccount.com
'
default_account_arg
=
'
--default_service_account=830293263384-compute@developer.gserviceaccount.com
'
if
test_case
in
[
'
jwt_token_creds
'
,
'
per_rpc_creds
'
,
'
oauth2_auth_token
'
]:
if
test_case
in
[
'
jwt_token_creds
'
,
'
per_rpc_creds
'
,
'
oauth2_auth_token
'
]:
if
language
in
[
'
csharp
'
,
'
node
'
,
'
php
'
,
'
ruby
'
]:
if
language
in
[
'
csharp
'
,
'
node
'
,
'
php
'
,
'
python
'
,
'
ruby
'
]:
env
[
'
GOOGLE_APPLICATION_CREDENTIALS
'
]
=
key_filepath
env
[
'
GOOGLE_APPLICATION_CREDENTIALS
'
]
=
key_filepath
else
:
else
:
cmdline
+=
[
key_file_arg
]
cmdline
+=
[
key_file_arg
]
...
...
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