Skip to content

Commit

Permalink
fix testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Elliot-xq committed May 16, 2024
1 parent 2b28e6c commit b6995b1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions docker/generic/start_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,11 @@ def make_argparser():
connecting to Google service control. If it is `open`, the request will be allowed,
otherwise, it will be rejected. Default is `open`.
''')
parser.add_argument('--service_control_enable_api_key_uid_reporting',
default=False,
help='''
Enable when need to report api_key_uid in the telemetry report.'''
)
parser.add_argument(
'--disable_jwks_async_fetch',
action='store_true',
Expand Down Expand Up @@ -1382,6 +1387,12 @@ def gen_proxy_config(args):
if args.service_control_network_fail_policy == "close":
proxy_conf.extend(["--service_control_network_fail_open=false"])

if args.service_control_enable_api_key_uid_reporting:
proxy_conf.extend([
"--service_control_enable_api_key_uid_reporting",
args.service_control_enable_api_key_uid_reporting
])

if args.service_json_path:
proxy_conf.extend(["--service_json_path", args.service_json_path])

Expand Down
5 changes: 3 additions & 2 deletions tests/start_proxy/start_proxy_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,21 +192,23 @@ def test_gen_proxy_config(self):
'--disable_tracing'
]),
# service_control_network_fail_policy=open
# service_control_enable_api_key_uid_reporting=true
(['-R=managed','--enable_strict_transport_security',
'--http_port=8079', '--service_control_quota_retries=3',
'--service_control_report_timeout_ms=300',
'--service_control_network_fail_policy=open', '--check_metadata',
'--service_control_enable_api_key_uid_reporting=true',
'--disable_tracing', '--underscores_in_headers'],
['bin/configmanager', '--logtostderr', '--rollout_strategy', 'managed',
'--backend_address', 'http://127.0.0.1:8082', '--v', '0',
'--listener_port', '8079', '--enable_strict_transport_security',
'--service_control_quota_retries', '3',
'--service_control_report_timeout_ms', '300',
'--service_control_enable_api_key_uid_reporting', 'true',
'--check_metadata', '--underscores_in_headers',
'--disable_tracing'
]),
# service_control_network_fail_policy=close
# service_control_enable_api_key_uid_reporting=false
(['-R=managed','--enable_strict_transport_security',
'--http_port=8079', '--service_control_quota_retries=3',
'--service_control_report_timeout_ms=300',
Expand All @@ -218,7 +220,6 @@ def test_gen_proxy_config(self):
'--service_control_quota_retries', '3',
'--service_control_report_timeout_ms', '300',
'--service_control_network_fail_open=false',
'--service_control_enable_api_key_uid_reporting=false',
'--check_metadata', '--underscores_in_headers',
'--disable_tracing'
]),
Expand Down

0 comments on commit b6995b1

Please sign in to comment.