[Test Proxy] Accept parameter-level SAS sanitization - #25898
Merged
Conversation
scbedd
approved these changes
Aug 29, 2022
scbedd
left a comment
Member
There was a problem hiding this comment.
I really like _create_fake_token's implementation!
laiapat
added a commit
to laiapat/azure-sdk-for-python
that referenced
this pull request
Sep 22, 2022
azure-sdk
pushed a commit
to azure-sdk/azure-sdk-for-python
that referenced
this pull request
Oct 25, 2023
Add 2023-11-01-preview for appplatform (Azure#26231) * Adds base for updating Microsoft.AppPlatform from version preview/2023-09-01-preview to version 2023-11-01-preview * Updates readme * Updates API version in new specs and examples * Fix go readme for asa api (Azure#25897) * Update language specific readme.md for 2023-11-01-preview api version (Azure#25898) * add more build result information in build resource (Azure#25930) Co-authored-by: 刘清仪 <liuqingyi@liuqingyideMacBook-Pro.local> * Add apiTryOutEnabledState for api protal (Azure#25923) * Add swagger for Spring Cloud Gateway response cache (Azure#25924) * Update appplatform.json (Azure#26234) * Update appplatform.json * Update appplatform.json --------- Co-authored-by: Sandy Cai <sandy.caiqing@gmail.com> Co-authored-by: Qingyi Liu <34502364+smile37773@users.noreply.github.com> Co-authored-by: 刘清仪 <liuqingyi@liuqingyideMacBook-Pro.local>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Context: the Storage team discovered that there are cases where SAS tokens generated by tests can fail to match in playback because they contain tenant IDs. The problem is that
AzureRecordedTestCase.generate_sascurrently sanitizes only thesig,st, andseparameters of a generated token. In Storage's case, their tokens also contain asktidfield that includes a tenant ID. This ID doesn't get sanitized, and in playback the local value of the tenant ID ("00000000-0000-0000-0000-000000000000") doesn't match when a new SAS is generated.This PR expands the functionality of the
generate_sasmethod to resolve this issue. Afake_parameterskwarg can now be provided, specifying SAS token keys to sanitize. Since the change is purely additive, it's backwards-compatible for tests that rely on the existinggenerate_sasbehavior. The Storage team has reviewed this solution offline and given a thumbs-up.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines
generate_sasmethod.