Skip to content

Commit c8f7298

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

File tree

8 files changed

+4601
-910
lines changed

8 files changed

+4601
-910
lines changed

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: 14 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,17 @@ 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+
36+
# upgrade to v2 before using v2 commands
37+
self.cmd('webapp auth config-version upgrade -g {} -n {}'.format(resource_group, webapp_name))
3438

3539
# # update and verify
3640
self.cmd('webapp auth update -g {} -n {} --enabled true --runtime-version 1.2.8'
3741
.format(resource_group, webapp_name)).assert_with_checks([
38-
JMESPathCheck('platform', "{'enabled': True, 'runtimeVersion': '1.2.8'}")
42+
JMESPathCheck('platform.enabled', True),
43+
JMESPathCheck('platform.runtimeVersion', '1.2.8')
3944
])
4045

4146
with self.assertRaisesRegex(ArgumentUsageError, 'Usage Error: --client-secret and --client-secret-setting-name cannot both be '
@@ -79,6 +84,7 @@ def test_authV2_clientsecret_param_combinations(self, resource_group):
7984
.format(resource_group, webapp_name))
8085

8186
@ResourceGroupPreparer(name_prefix='cli_test_authV2')
87+
@AllowLargeResponse()
8288
def test_authV2_auth(self, resource_group):
8389
webapp_name = self.create_random_name('webapp-authentication-test', 40)
8490
plan_name = self.create_random_name('webapp-authentication-plan', 40)
@@ -92,17 +98,21 @@ def test_authV2_auth(self, resource_group):
9298

9399
# testing show command for newly created app and initial fields
94100
self.cmd('webapp auth show -g {} -n {}'.format(resource_group, webapp_name)).assert_with_checks([
95-
JMESPathCheck('properties', {})
101+
JMESPathCheck('properties.platform.enabled', False)
96102
])
103+
104+
self.cmd('webapp auth config-version upgrade -g {} -n {}'.format(resource_group, webapp_name))
97105

98106
# # update and verify
99107
self.cmd('webapp auth update -g {} -n {} --enabled true --runtime-version 1.2.8'
100108
.format(resource_group, webapp_name)).assert_with_checks([
101-
JMESPathCheck('platform', "{'enabled': True, 'runtimeVersion': '1.2.8'}")
109+
JMESPathCheck('platform.enabled', True),
110+
JMESPathCheck('platform.runtimeVersion', '1.2.8')
102111
])
103112

104113

105114
@ResourceGroupPreparer(name_prefix='cli_test_authV2')
115+
@AllowLargeResponse()
106116
def test_authV2_authclassic(self, resource_group):
107117
webapp_name = self.create_random_name('webapp-authentication-test', 40)
108118
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)