-
Notifications
You must be signed in to change notification settings - Fork 3.4k
[IoT Hub] Support for 2020-03-01 API and Network Isolation commands #13467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
43bdc26
Add authenticationType, endpointUri, and entityPath parameters to rou…
c-ryan-k 19b732c
Added AuthType and ContainerURI fileupload parameters on hub create
c-ryan-k 639f1be
Support for fileUpload authenticationType change on iot hub update co…
c-ryan-k 30f70ca
removed debug line
c-ryan-k 2404c1c
Testing and formatting updates, added temporary template file for ide…
c-ryan-k 974a745
Moved identity-based hub tests to new test function to avoid hub conf…
c-ryan-k 627ab69
Fix for Identity-Based file upload not utilizing connectionString
c-ryan-k 76994a7
Test recording updates
c-ryan-k 21ecd0e
WIP: Private-endpoint and private link resource implementation
c-ryan-k 38328c2
parameter fixes
c-ryan-k 1f45dde
test recording updates
c-ryan-k a30c3bc
whitespace / formatting fixes
c-ryan-k 41cbdef
Added help commands for private-endpoint-connection and private-link-…
c-ryan-k 187bf50
Added help example for identity-based routing endpoint
c-ryan-k 16da35f
Removed accidental change
c-ryan-k 4897673
Linting and style updates, addressing PR feedback
c-ryan-k 79ca36d
Rollback of accidental profile version update
c-ryan-k 30820f3
SDK and test updates
c-ryan-k aeaecc6
Test template path/name fix and test update
c-ryan-k 1a39023
Network isolation support
c-ryan-k d92e2a8
History update
c-ryan-k cd6e389
Test updates
c-ryan-k 68e1c9a
Merge branch 'azure-dev' into dev
c-ryan-k 440a431
Address PR feedback
c-ryan-k 1f2a105
Help update
c-ryan-k a80be8a
Address PR Feedback - add test recording processor to obscure access …
c-ryan-k File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/azure-cli/azure/cli/command_modules/iot/tests/latest/recording_processors.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| from azure_devtools.scenario_tests import RecordingProcessor | ||
| from azure_devtools.scenario_tests.utilities import is_text_payload | ||
|
|
||
| MOCK_KEY = 'mock_key' | ||
|
|
||
|
|
||
| class KeyReplacer(RecordingProcessor): | ||
|
|
||
| def process_request(self, request): | ||
| if is_text_payload(request) and isinstance(request.body, bytes): | ||
| request.body = self._replace_byte_keys(request.body) | ||
| elif is_text_payload(request) and isinstance(request.body, str): | ||
| request.body = self._replace_string_keys(request.body) | ||
| return request | ||
|
|
||
| def process_response(self, response): | ||
| if is_text_payload(response) and response['body']['string']: | ||
| response['body']['string'] = self._replace_string_keys(response['body']['string']) | ||
| return response | ||
|
|
||
| # pylint: disable=no-self-use | ||
| def _replace_string_keys(self, val): | ||
| import re | ||
| if 'primaryKey' in val: | ||
| val = re.sub(r'"primaryKey":( ?)"([^"]+)"', r'"primaryKey":"{}"' | ||
| .format(MOCK_KEY), val, flags=re.IGNORECASE) | ||
| if 'secondaryKey' in val: | ||
| val = re.sub(r'"secondaryKey":( ?)"([^"]+)"', r'"secondaryKey":"{}"' | ||
| .format(MOCK_KEY), val, flags=re.IGNORECASE) | ||
| return val | ||
|
|
||
| # pylint: disable=no-self-use | ||
| def _replace_byte_keys(self, val): | ||
| import re | ||
| if b'primaryKey' in val: | ||
| val = re.sub(b'"primaryKey":( ?)"([^"]+)"', '"primaryKey":"{}"' | ||
| .format(MOCK_KEY).encode(), val, flags=re.IGNORECASE) | ||
| if b'secondaryKey' in val: | ||
| val = re.sub(b'"secondaryKey":( ?)"([^"]+)"', '"secondaryKey":"{}"' | ||
| .format(MOCK_KEY).encode(), val, flags=re.IGNORECASE) | ||
| return val |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.