Skip to content

Commit ecb61c2

Browse files
committed
added fix for authV2 parsing with testing, rerecorded all cassettes
1 parent 5ac8c50 commit ecb61c2

8 files changed

Lines changed: 4599 additions & 910 deletions

src/authV2/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Release History
44
===============
55

6+
1.0.1
7+
++++++
8+
* Fix excluded paths parsing in `az webapp auth update` command.
9+
610
1.0.0
711
++++++
812
* Update module documentation.

src/authV2/azext_authV2/custom.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,11 @@ def update_auth_settings_v2(cmd, resource_group_name, name, set_string=None, ena
160160
if "globalValidation" not in existing_auth.keys():
161161
existing_auth["globalValidation"] = {}
162162
try:
163-
if isinstance(json.loads(excluded_paths), list):
164-
excluded_paths_list = json.loads(excluded_paths)
163+
parsed = json.loads(excluded_paths)
164+
if isinstance(parsed, list):
165+
excluded_paths_list = parsed
165166
else:
166-
excluded_paths_list = excluded_paths.split(",")
167+
excluded_paths_list = [parsed] if parsed else []
167168
except json.JSONDecodeError:
168169
excluded_paths_list = excluded_paths.split(",")
169170

src/authV2/azext_authV2/tests/latest/recordings/test_authV2_auth.yaml

Lines changed: 1478 additions & 322 deletions
Large diffs are not rendered by default.

src/authV2/azext_authV2/tests/latest/recordings/test_authV2_authclassic.yaml

Lines changed: 657 additions & 268 deletions
Large diffs are not rendered by default.

src/authV2/azext_authV2/tests/latest/recordings/test_authV2_clientsecret_param_combinations.yaml

Lines changed: 1159 additions & 308 deletions
Large diffs are not rendered by default.

src/authV2/azext_authV2/tests/latest/recordings/test_authV2_excluded_paths_parsing.yaml

Lines changed: 1284 additions & 4 deletions
Large diffs are not rendered by default.

src/authV2/azext_authV2/tests/latest/test_authV2_scenario.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
class Authv2ScenarioTest(ScenarioTest):
1717

1818
@ResourceGroupPreparer(name_prefix='cli_test_authV2')
19+
@AllowLargeResponse()
1920
def test_authV2_clientsecret_param_combinations(self, resource_group):
2021
webapp_name = self.create_random_name('webapp-authentication-test', 40)
2122
plan_name = self.create_random_name('webapp-authentication-plan', 40)
@@ -29,13 +30,15 @@ def test_authV2_clientsecret_param_combinations(self, resource_group):
2930

3031
# testing show command for newly created app and initial fields
3132
self.cmd('webapp auth show -g {} -n {}'.format(resource_group, webapp_name)).assert_with_checks([
32-
JMESPathCheck('properties', {})
33+
JMESPathCheck('properties.platform.enabled', False)
3334
])
35+
self.cmd('webapp auth config-version upgrade -g {} -n {}'.format(resource_group, webapp_name))
3436

3537
# # update and verify
3638
self.cmd('webapp auth update -g {} -n {} --enabled true --runtime-version 1.2.8'
3739
.format(resource_group, webapp_name)).assert_with_checks([
38-
JMESPathCheck('platform', "{'enabled': True, 'runtimeVersion': '1.2.8'}")
40+
JMESPathCheck('platform.enabled', True),
41+
JMESPathCheck('platform.runtimeVersion', '1.2.8')
3942
])
4043

4144
with self.assertRaisesRegex(ArgumentUsageError, 'Usage Error: --client-secret and --client-secret-setting-name cannot both be '
@@ -79,6 +82,7 @@ def test_authV2_clientsecret_param_combinations(self, resource_group):
7982
.format(resource_group, webapp_name))
8083

8184
@ResourceGroupPreparer(name_prefix='cli_test_authV2')
85+
@AllowLargeResponse()
8286
def test_authV2_auth(self, resource_group):
8387
webapp_name = self.create_random_name('webapp-authentication-test', 40)
8488
plan_name = self.create_random_name('webapp-authentication-plan', 40)
@@ -92,17 +96,21 @@ def test_authV2_auth(self, resource_group):
9296

9397
# testing show command for newly created app and initial fields
9498
self.cmd('webapp auth show -g {} -n {}'.format(resource_group, webapp_name)).assert_with_checks([
95-
JMESPathCheck('properties', {})
99+
JMESPathCheck('properties.platform.enabled', False)
96100
])
101+
102+
self.cmd('webapp auth config-version upgrade -g {} -n {}'.format(resource_group, webapp_name))
97103

98104
# # update and verify
99105
self.cmd('webapp auth update -g {} -n {} --enabled true --runtime-version 1.2.8'
100106
.format(resource_group, webapp_name)).assert_with_checks([
101-
JMESPathCheck('platform', "{'enabled': True, 'runtimeVersion': '1.2.8'}")
107+
JMESPathCheck('platform.enabled', True),
108+
JMESPathCheck('platform.runtimeVersion', '1.2.8')
102109
])
103110

104111

105112
@ResourceGroupPreparer(name_prefix='cli_test_authV2')
113+
@AllowLargeResponse()
106114
def test_authV2_authclassic(self, resource_group):
107115
webapp_name = self.create_random_name('webapp-authentication-test', 40)
108116
plan_name = self.create_random_name('webapp-authentication-plan', 40)

src/authV2/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from distutils import log as logger
1515
logger.warn("Wheel is not available, disabling bdist_wheel hook")
1616

17-
VERSION = '1.0.0'
17+
VERSION = '1.0.1'
1818

1919
# The full list of classifiers is available at
2020
# https://pypi.python.org/pypi?%3Aaction=list_classifiers

0 commit comments

Comments
 (0)