Class ProtoUriSanitizer

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll

Text-level redaction for the addresses integrations trace: URI user-info (credentials) is removed unconditionally, and the values of well-known sensitive query parameters are replaced. Shared by HTTP, gRPC, messaging and web so one policy cannot drift between packages.

public static class ProtoUriSanitizer
Inheritance
ProtoUriSanitizer
Inherited Members

Fields

RedactedValue

The value sensitive parameters are replaced with.

public const string RedactedValue = "[REDACTED]"

Field Value

string

Properties

DefaultSensitiveQueryParameters

The query parameter names redacted when an integration has no rule of its own.

public static IReadOnlyList<string> DefaultSensitiveQueryParameters { get; }

Property Value

IReadOnlyList<string>

Methods

Sanitize(string, IReadOnlyCollection<string>?)

Sanitizes an address with the supplied sensitive query parameter names.

public static string Sanitize(string address, IReadOnlyCollection<string>? sensitiveQueryParameters = null)

Parameters

address string
sensitiveQueryParameters IReadOnlyCollection<string>

Returns

string

Sanitize(Uri?, IReadOnlyCollection<string>?)

Sanitizes an address with the default sensitive query parameter names.

public static string? Sanitize(Uri? address, IReadOnlyCollection<string>? sensitiveQueryParameters = null)

Parameters

address Uri
sensitiveQueryParameters IReadOnlyCollection<string>

Returns

string

WithoutUserInfo(string)

Removes user:password@ from an address, leaving everything else untouched.

public static string WithoutUserInfo(string address)

Parameters

address string

Returns

string