Skip to content

Commit 622475e

Browse files
committed
resolve static analysis errors
1 parent fc0ca67 commit 622475e

File tree

13 files changed

+18
-7
lines changed

13 files changed

+18
-7
lines changed

src/Accounts/Authentication/Utilities/CustomAssemblyResolver.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ public static class CustomAssemblyResolver
3030
{"System.Text.Encodings.Web", new Version("4.0.4.0")},
3131
{"System.Text.Json", new Version("4.0.0.0")},
3232
{"System.Threading.Tasks.Extensions", new Version("4.2.0.0")},
33+
{"Microsoft.IdentityModel.Logging", new Version("6.8.0.0")},
34+
{"Microsoft.IdentityModel.Tokens", new Version("6.8.0.0")},
3335
{"System.Xml.ReaderWriter", new Version("4.1.0.0")}
3436
};
3537

src/ContainerRegistry/ContainerRegistry/Commands/ConnectAzureContainerRegistry.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,10 @@
2323

2424
namespace Microsoft.Azure.Commands.ContainerRegistry
2525
{
26-
[Cmdlet("Connect", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ContainerRegistry")]
26+
[Cmdlet("Connect", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ContainerRegistry", DefaultParameterSetName = WithoutNameAndPasswordParameterSet)]
2727
[OutputType(typeof(bool))]
2828
public class ConnectAzureContainerRegistry : ContainerRegistryCmdletBase
2929
{
30-
private const string WithoutNameAndPasswordParameterSet = "WithoutNameAndPasswordParameterSet";
31-
private const string WithNameAndPasswordParameterSet = "WithNameAndPasswordParameterSet";
32-
3330
[Parameter(Mandatory = true, HelpMessage = "Azure Container Registry Name.", ParameterSetName = WithoutNameAndPasswordParameterSet)]
3431
[Parameter(Mandatory = true, HelpMessage = "Azure Container Registry Name.", ParameterSetName = WithNameAndPasswordParameterSet)]
3532
[ValidateNotNullOrEmpty]

src/ContainerRegistry/ContainerRegistry/Commands/ImportAzureContainerRegistryImage.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
namespace Microsoft.Azure.Commands.ContainerRegistry.Commands
2525
{
26-
[Cmdlet("Import", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ContainerRegistryImage", SupportsShouldProcess = true)]
26+
[Cmdlet("Import", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "ContainerRegistryImage", DefaultParameterSetName = ImportImageByResourceId, SupportsShouldProcess = true)]
2727
[OutputType(typeof(bool))]
2828
public class ImportAzureContainerRegistryImage : ContainerRegistryCmdletBase
2929
{

src/ContainerRegistry/ContainerRegistry/Models/ContainerRegistryCmdletBase.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ public abstract class ContainerRegistryCmdletBase : AzureRMCmdlet
8585
protected const string InvalidRegistryOrReplicationResourceIdErrorMessage = "This is an invalid container registry resource id or replication resource id";
8686
protected const string InvalidReplicationResourceIdErrorMessage = "This is an invalid replication resource id";
8787

88+
protected const string WithoutNameAndPasswordParameterSet = "WithoutNameAndPasswordParameterSet";
89+
protected const string WithNameAndPasswordParameterSet = "WithNameAndPasswordParameterSet";
90+
8891
protected struct PasswordNameStrings
8992
{
9093
internal const string Password = "password";

src/ContainerRegistry/ContainerRegistry/help/Connect-AzContainerRegistry.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Login to an azure container registry.
1212

1313
## SYNTAX
1414

15-
### WithoutNameAndPasswordParameterSet
15+
### WithoutNameAndPasswordParameterSet (Default)
1616
```
1717
Connect-AzContainerRegistry -Name <String> [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
1818
```

src/ContainerRegistry/ContainerRegistry/help/Import-AzContainerRegistryImage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Import image from a public/azure registry to an azure container registry.
1212

1313
## SYNTAX
1414

15-
### ImportImageByResourceId
15+
### ImportImageByResourceId (Default)
1616
```
1717
Import-AzContainerRegistryImage -ResourceGroupName <String> -RegistryName <String> -SourceImage <String>
1818
-SourceRegistryResourceId <String> [-Mode <String>] [-TargetTag <String[]>]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
"Directory","Assembly Name","Assembly Version","Referencing Assembly","Severity","ProblemId","Description","Remediation"
22
"Az.ContainerRegistry","Microsoft.Win32.Registry","4.1.1.0","System.Management.Automation","0","3000","Missing assembly Microsoft.Win32.Registry referenced from System.Management.Automation","Ensure that the assembly is included in the Wix file or directory"
33
"Az.ContainerRegistry","Microsoft.PowerShell.CoreCLR.Eventing","6.1.0.0","System.Management.Automation","0","3000","Missing assembly Microsoft.PowerShell.CoreCLR.Eventing referenced from System.Management.Automation","Ensure that the assembly is included in the Wix file or directory"
4+
"Az.ContainerRegistry","System.IdentityModel.Tokens.Jwt","5.1.2.0","Microsoft.Azure.ContainerRegistry","0","3000","Missing assembly System.IdentityModel.Tokens.Jwt referenced from Microsoft.Azure.ContainerRegistry","Ensure that the assembly is included in the Wix file or directory"
5+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"Target","AssemblyName","AssemblyVersion","Severity","ProblemId","Description","Remediation"
2+
"File version 1.1 in D:\a\1\s\artifacts\Debug\Az.ContainerRegistry\Microsoft.IdentityModel.Logging.dll, File version 5.6 in D:\a\1\s\artifacts\Debug\Az.Attestation\Microsoft.IdentityModel.Logging.dll","Microsoft.IdentityModel.Logging","5.6.0.0","0","7000","Shared assembly conflict, shared assemblies with the same assembly version have differing file versions","Update the assembly reference for Microsoft.IdentityModel.Logging in one of the referring assemblies"
3+
"File version 5.1 in D:\a\1\s\artifacts\Debug\Az.ContainerRegistry\Microsoft.IdentityModel.Tokens.dll, File version 5.6 in D:\a\1\s\artifacts\Debug\Az.Attestation\Microsoft.IdentityModel.Tokens.dll","Microsoft.IdentityModel.Tokens","5.6.0.0","0","7000","Shared assembly conflict, shared assemblies with the same assembly version have differing file versions","Update the assembly reference for Microsoft.IdentityModel.Tokens in one of the referring assemblies"

tools/StaticAnalysis/Exceptions/Az.ContainerRegistry/SignatureIssues.csv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
"Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistry.dll","Microsoft.Azure.Commands.ContainerRegistry.NewAzureContainerRegistryWebhook","New-AzContainerRegistryWebhook","1","8420","Parameter set 'NameResourceGroupParameterSet' of cmdlet 'New-AzContainerRegistryWebhook' contains at least one parameter with a position larger than four, which is discouraged.","Limit the number of positional parameters in a single parameter set to four or fewer."
44
"Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistry.dll","Microsoft.Azure.Commands.ContainerRegistry.NewAzureContainerRegistryWebhook","New-AzContainerRegistryWebhook","1","8420","Parameter set 'RegistryObjectParameterSet' of cmdlet 'New-AzContainerRegistryWebhook' contains at least one parameter with a position larger than four, which is discouraged.","Limit the number of positional parameters in a single parameter set to four or fewer."
55
"Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistry.dll","Microsoft.Azure.Commands.ContainerRegistry.NewAzureContainerRegistryWebhook","New-AzContainerRegistryWebhook","1","8420","Parameter set 'ResourceIdParameterSet' of cmdlet 'New-AzContainerRegistryWebhook' contains at least one parameter with a position larger than four, which is discouraged.","Limit the number of positional parameters in a single parameter set to four or fewer."
6+
"Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistry.dll","Microsoft.Azure.Commands.ContainerRegistry.ConnectAzureContainerRegistry","Connect-AzContainerRegistry","1","8100","Connect-AzContainerRegistry Does not support ShouldProcess but the cmdlet verb Connect indicates that it should.","Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue"
7+
"Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistry.dll","Microsoft.Azure.Commands.ContainerRegistry.Commands.NewAzureContainerRegistryNetworkRule","New-AzContainerRegistryNetworkRule","1","8100","New-AzContainerRegistryNetworkRule Does not support ShouldProcess but the cmdlet verb New indicates that it should.","Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue"
8+
"Microsoft.Azure.PowerShell.Cmdlets.ContainerRegistry.dll","Microsoft.Azure.Commands.ContainerRegistry.Commands.SetAzureContainerRegistryNetworkRuleSet","Set-AzContainerRegistryNetworkRuleSet","1","8100","Set-AzContainerRegistryNetworkRuleSet Does not support ShouldProcess but the cmdlet verb Set indicates that it should.","Determine if the cmdlet should implement ShouldProcess and if so determine if it should implement Force / ShouldContinue"
9+

0 commit comments

Comments
 (0)