Description
CodeCovSettings has a Token property that stores an API token but is missing the [SecretValue] attribute that other similar settings classes use.
File Locations
Missing attribute:
src/ModularPipelines.Build/Settings/CodeCovSettings.cs
public class CodeCovSettings
{
public string? Token { get; init; } // <-- Missing [SecretValue]
}
Correct pattern used elsewhere:
src/ModularPipelines.Build/Settings/NuGetSettings.cs
public record NuGetSettings
{
[SecretValue]
public string? ApiKey { get; init; }
}
src/ModularPipelines.Build/Settings/CodacySettings.cs
public record CodacySettings
{
[SecretValue]
public string? ApiKey { get; set; }
}
Why This Is a Problem
- Inconsistency with other settings classes
- The Token property likely contains a secret that should be obfuscated in logs
- Security concern - tokens without
[SecretValue] may be logged in plain text
Suggested Fix
Add the [SecretValue] attribute to the Token property:
public class CodeCovSettings
{
[SecretValue]
public string? Token { get; init; }
}
Description
CodeCovSettingshas aTokenproperty that stores an API token but is missing the[SecretValue]attribute that other similar settings classes use.File Locations
Missing attribute:
src/ModularPipelines.Build/Settings/CodeCovSettings.csCorrect pattern used elsewhere:
src/ModularPipelines.Build/Settings/NuGetSettings.cssrc/ModularPipelines.Build/Settings/CodacySettings.csWhy This Is a Problem
[SecretValue]may be logged in plain textSuggested Fix
Add the
[SecretValue]attribute to theTokenproperty: