Compiler Warning ASPIRERADIUS006
Questi contenuti non sono ancora disponibili nella tua lingua.
Radius secret store types and members are for evaluation purposes only and are subject to change or removal in future updates. Suppress this diagnostic to proceed.
This diagnostic warning is reported when using experimental Radius secret-store APIs from the Aspire.Hosting.Radius integration, including:
AddRadiusSecretStoreandWithSecretStore- their population callbacks, such as
WithData,WithExistingSecret, andWithSealedSecret, and their consumer callbacks RadiusSecretStoreType
These APIs declare a Radius secret store and populate it from Aspire secret parameters, existing cluster secrets, or GitOps sealed secrets.
Example
Section titled “Example”The following code generates ASPIRERADIUS006:
var builder = DistributedApplication.CreateBuilder(args);
var user = builder.AddParameter("db-user", secret: true);var pass = builder.AddParameter("db-pass", secret: true);
builder.AddRadiusSecretStore("db-creds", RadiusSecretStoreType.BasicAuthentication) .WithData(d => { d.Add("username", user); d.Add("password", pass); });
builder.Build().Run();To correct this warning
Section titled “To correct this warning”Suppress the warning with one of the following methods:
-
Set the severity of the rule in the .editorconfig file.
.editorconfig [*.{cs,vb}]dotnet_diagnostic.ASPIRERADIUS006.severity = noneFor more information about editor config files, see Configuration files for code analysis rules.
-
Add the following
PropertyGroupto your project file:C# project file <PropertyGroup><NoWarn>$(NoWarn);ASPIRERADIUS006</NoWarn></PropertyGroup> -
Suppress in code with the
#pragma warning disable ASPIRERADIUS006directive:Suppressing the warning var apiKey = builder.AddParameter("api-key", secret: true);#pragma warning disable ASPIRERADIUS006builder.AddRadiusSecretStore("api-creds", RadiusSecretStoreType.Generic).WithData(d => d.Add("api-key", apiKey));#pragma warning restore ASPIRERADIUS006
See also
Section titled “See also”- ASPIRERADIUS003 - Radius cloud provider APIs
- ASPIRERADIUS004 - Radius infrastructure customization APIs
- ASPIRERADIUS057 - Radius container image API