-
Notifications
You must be signed in to change notification settings - Fork 255
Make URL Redaction more dynamic #2716
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
rads-1996
merged 13 commits into
microsoft:main
from
rads-1996:dynamic-config-for-url-redaction
Mar 27, 2026
+211
−21
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
e0651b7
Make URL Redaction more dynamic
rads-1996 8d1de51
Add missing colon
rads-1996 b4d41fd
Retrigger CI/CD pipeline
rads-1996 781fa52
Addressed feedback, modified config
rads-1996 9a25f45
Retrigger CI/CD pipeline
rads-1996 53aa2c8
Fix comparison issue
rads-1996 8368977
Fix comparison issue for false
rads-1996 ddc2531
Fix enum issue
rads-1996 0859848
Push changes after rebuild
rads-1996 1822734
Fix string literal issue
rads-1996 7af28dc
Fix failing test
rads-1996 72c224b
Modify enum logic
rads-1996 8fd3800
Addressed feedback
rads-1996 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
Some comments aren't visible on the classic Files Changed page.
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
80 changes: 80 additions & 0 deletions
80
shared/AppInsightsCore/src/enums/ai/UrlRedactionOptions.ts
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,80 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import { createEnumStyle } from "../EnumHelperFuncs"; | ||
|
|
||
| /** | ||
| * Controls how the user can configure which parts of the URL should be redacted. Example, certain query parameters, username and password, etc. | ||
| */ | ||
|
|
||
| export const enum eUrlRedactionOptions { | ||
| /** | ||
| * The default value, will redact the username and password as well as the default set of query parameters | ||
| */ | ||
| true = 1, | ||
|
|
||
| /** | ||
| * Does not redact username and password or any query parameters, the URL will be left as is. Note: this is not recommended as it may lead | ||
| * to sensitive data being sent in clear text. | ||
| */ | ||
| false = 2, | ||
|
|
||
| /** | ||
| * This will append any additional queryParams that the user has provided through redactQueryParams config to the default set i.e to | ||
| * @defaultValue ["sig", "Signature", "AWSAccessKeyId", "X-Goog-Signature"]. | ||
| */ | ||
| appendToDefault = 3, | ||
|
|
||
| /** | ||
| * This will replace the default set of query parameters to redact with the query parameters defined in redactQueryParams config, if provided by the user. | ||
| */ | ||
| replaceDefault = 4, | ||
|
|
||
| /** | ||
| * This will redact username and password in the URL but will not redact any query parameters, even those in the default set. | ||
| */ | ||
| usernamePasswordOnly = 5, | ||
|
|
||
| /** | ||
| * This will only redact the query parameter in the default set of query parameters to redact. It will not redact username and password. | ||
| */ | ||
| queryParamsOnly = 6, | ||
|
|
||
| } | ||
|
|
||
| export const UrlRedactionOptions = (/* @__PURE__ */ createEnumStyle<typeof eUrlRedactionOptions>({ | ||
| /** | ||
| * The default value, will redact the username and password as well as the default set of query parameters | ||
| */ | ||
| true: eUrlRedactionOptions.true, | ||
|
|
||
| /** | ||
| * Does not redact username and password or any query parameters, the URL will be left as is. Note: this is not recommended as it may lead | ||
| * to sensitive data being sent in clear text. | ||
| */ | ||
| false: eUrlRedactionOptions.false, | ||
|
|
||
| /** | ||
| * This will append any additional queryParams that the user has provided through redactQueryParams config to the default set i.e to | ||
| * @defaultValue ["sig", "Signature", "AWSAccessKeyId", "X-Goog-Signature"]. | ||
| */ | ||
| appendToDefault: eUrlRedactionOptions.appendToDefault, | ||
|
|
||
| /** | ||
| * This will replace the default set of query parameters to redact with the query parameters defined in redactQueryParams config, if provided by the user. | ||
| */ | ||
| replaceDefault: eUrlRedactionOptions.replaceDefault, | ||
|
|
||
| /** | ||
| * This will redact username and password in the URL but will not redact any query parameters, even those in the default set. | ||
| */ | ||
| usernamePasswordOnly: eUrlRedactionOptions.usernamePasswordOnly, | ||
|
|
||
| /** | ||
| * This will only redact the query parameter in the default set of query parameters to redact. It will not redact username and password. | ||
| */ | ||
| queryParamsOnly: eUrlRedactionOptions.queryParamsOnly, | ||
|
|
||
| })); | ||
|
|
||
| export type UrlRedactionOptions = boolean | eUrlRedactionOptions; |
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
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.