Skip to content

Commit aba4f61

Browse files
author
Asaf Agami
authored
fix: Snyk Code configuration filtering & arm 64 support (#221)
1 parent bfd733b commit aba4f61

File tree

7 files changed

+55
-30
lines changed

7 files changed

+55
-30
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Snyk Changelog
22

3+
## [1.1.32]
4+
5+
### Added
6+
- Arm64 support.
7+
8+
### Changed
9+
- Snyk Code no longer filters configuration files.
10+
11+
### Fixed
12+
- Missing paths in the trust dialog in older VS versions.
13+
314
## [1.1.31]
415

516
### Added

Snyk.Code.Library/Service/FiltersService.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ public async Task<IList<string>> FilterFilesAsync(IEnumerable<string> filePaths,
5050
return filePaths
5151
.Where(path =>
5252
{
53-
if (configFileFilters.Contains(Path.GetFileName(path))
54-
|| this.IsFileInIgnoredDirectory(path)
53+
if (this.IsFileInIgnoredDirectory(path)
5554
|| this.IsFileSizeLargerThanMaximum(path))
5655
{
5756
return false;

Snyk.VisualStudio.Extension.2022/Snyk.VisualStudio.Extension.2022.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="17.0.32112.339" ExcludeAssets="runtime">
8282
<IncludeAssets>compile; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
8383
</PackageReference>
84-
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.0.5240">
84+
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="17.4.2120">
8585
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
8686
<PrivateAssets>all</PrivateAssets>
8787
</PackageReference>

Snyk.VisualStudio.Extension.2022/TrustDialogWindow.xaml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,37 +19,43 @@
1919
toolkit:Themes.UseVsTheme="True"
2020
Title="Snyk - This folder has not been trusted"
2121
MouseDown="TrustDialogWindow_OnMouseDown">
22+
<!--This file is duplicated between the extension projects rather than shared in the shared project.
23+
This is due to differences in imports-->
2224
<DockPanel Margin="10">
23-
<Button DockPanel.Dock="Top" HorizontalAlignment="Right" Click="DoNotTrustButton_OnClick" MinWidth="1" MinHeight="1" Width="35" Margin="0" Padding="0">
24-
<imaging:CrispImage Moniker="{x:Static catalog:KnownMonikers.Close}"/>
25+
<Button DockPanel.Dock="Top" HorizontalAlignment="Right" Click="DoNotTrustButton_OnClick" MinWidth="1"
26+
MinHeight="1" Width="35" Margin="0" Padding="0">
27+
<imaging:CrispImage Moniker="{x:Static catalog:KnownMonikers.Close}" />
2528
</Button>
2629
<StackPanel HorizontalAlignment="Right" DockPanel.Dock="Bottom" Orientation="Horizontal">
27-
<Button x:Name="TrustButton" Margin="5, 5" Content="Trust folder and continue" Click="TrustButton_OnClick"/>
28-
<Button x:Name="DoNotTrustButton" Margin="5, 5" Content="Don't scan" Click="DoNotTrustButton_OnClick"/>
30+
<Button x:Name="TrustButton" Margin="5, 5" Content="Trust folder and continue" Click="TrustButton_OnClick" />
31+
<Button x:Name="DoNotTrustButton" Margin="5, 5" Content="Don't scan" Click="DoNotTrustButton_OnClick" />
2932
</StackPanel>
3033
<Grid>
3134
<Grid.RowDefinitions>
32-
<RowDefinition Height="auto"/>
33-
<RowDefinition Height="auto"/>
35+
<RowDefinition Height="auto" />
36+
<RowDefinition Height="auto" />
3437
</Grid.RowDefinitions>
3538
<Grid Grid.Row="0">
3639
<Grid.ColumnDefinitions>
37-
<ColumnDefinition Width="*"/>
38-
<ColumnDefinition Width="5*"/>
40+
<ColumnDefinition Width="*" />
41+
<ColumnDefinition Width="5*" />
3942
</Grid.ColumnDefinitions>
40-
<imaging:CrispImage Grid.Column="0" Width="50" Moniker="{x:Static catalog:KnownMonikers.StatusSecurityWarning}"/>
43+
<imaging:CrispImage Grid.Column="0" Width="50"
44+
Moniker="{x:Static catalog:KnownMonikers.StatusSecurityWarning}" />
4145
<StackPanel VerticalAlignment="Center" Grid.Column="1" Margin="0, 0, 5, 0">
4246
<TextBlock FontSize="14">This folder has not been trusted:</TextBlock>
43-
<TextBlock FontSize="14" FontWeight="Bold" TextWrapping="Wrap" Text="{Binding ElementName=TrustWindow, Path=FolderPath}"/>
47+
<TextBlock FontSize="14" FontWeight="Bold" TextWrapping="Wrap"
48+
Text="{Binding ElementName=TrustWindow, Path=FolderPath}" />
4449
</StackPanel>
4550
</Grid>
4651
<StackPanel Grid.Row="1" Margin="5">
4752
<TextBlock TextWrapping="Wrap">
4853
When scanning folder files for vulnerabilities, Snyk may automatically execute code such as invoking the package manager to get dependency information. You should only scan folders you trust.
4954
</TextBlock>
5055
<TextBlock>
51-
<LineBreak/>
52-
<Hyperlink NavigateUri="https://docs.snyk.io/ide-tools/visual-studio-extension/workspace-trust" RequestNavigate="Hyperlink_OnRequestNavigate">
56+
<LineBreak />
57+
<Hyperlink NavigateUri="https://docs.snyk.io/ide-tools/visual-studio-extension/workspace-trust"
58+
RequestNavigate="Hyperlink_OnRequestNavigate">
5359
More information
5460
</Hyperlink>
5561
</TextBlock>

Snyk.VisualStudio.Extension.2022/source.extension.vsixmanifest

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,18.0)">
1717
<ProductArchitecture>amd64</ProductArchitecture>
1818
</InstallationTarget>
19+
<InstallationTarget Version="[17.0,18.0)" Id="Microsoft.VisualStudio.Community">
20+
<ProductArchitecture>arm64</ProductArchitecture>
21+
</InstallationTarget>
1922
</Installation>
2023
<Dependencies>
2124
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" />

Snyk.VisualStudio.Extension.Shared/Service/SnykTasksService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public async Task<bool> IsFolderTrustedAsync()
270270
}
271271

272272
/// <summary>
273-
/// Start a CLI download task in background thread.
273+
/// Start a CLI download task in background thread. Will only download the CLI if it's missing or outdated.
274274
/// </summary>
275275
/// <param name="downloadFinishedCallback"><see cref="CliDownloadFinishedCallback"/> callback object.</param>
276276
public void Download(CliDownloadFinishedCallback downloadFinishedCallback = null)

Snyk.VisualStudio.Extension/TrustDialogWindow.xaml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<ui:DialogWindow x:Class="Snyk.VisualStudio.Extension.TrustDialogWindow"
2-
x:Name="trustDialogWindow"
2+
x:Name="TrustWindow"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -10,7 +10,7 @@
1010
WindowStartupLocation="CenterScreen"
1111
IsCloseButtonEnabled="True"
1212
HasHelpButton="False"
13-
MinHeight="290" Height="290"
13+
MinHeight="290" Height="290"
1414
MinWidth="500" Width="500"
1515
BorderBrush="{x:Static SystemColors.WindowFrameBrush}" BorderThickness="1"
1616
WindowStyle="None" ResizeMode="NoResize" AllowsTransparency="True"
@@ -19,37 +19,43 @@
1919
toolkit:Themes.UseVsTheme="True"
2020
Title="Snyk - This folder has not been trusted"
2121
MouseDown="TrustDialogWindow_OnMouseDown">
22+
<!--This file is duplicated between the extension projects rather than shared in the shared project.
23+
This is due to differences in imports versions that cannot be resolved without duplication.-->
2224
<DockPanel Margin="10">
23-
<Button DockPanel.Dock="Top" HorizontalAlignment="Right" Click="DoNotTrustButton_OnClick" MinWidth="1" MinHeight="1" Width="35" Margin="0" Padding="0">
24-
<imaging:CrispImage Moniker="{x:Static catalog:KnownMonikers.Close}"/>
25+
<Button DockPanel.Dock="Top" HorizontalAlignment="Right" Click="DoNotTrustButton_OnClick" MinWidth="1"
26+
MinHeight="1" Width="35" Margin="0" Padding="0">
27+
<imaging:CrispImage Moniker="{x:Static catalog:KnownMonikers.Close}" />
2528
</Button>
2629
<StackPanel HorizontalAlignment="Right" DockPanel.Dock="Bottom" Orientation="Horizontal">
27-
<Button x:Name="TrustButton" Margin="5, 5" Content="Trust folder and continue" Click="TrustButton_OnClick"/>
28-
<Button x:Name="DoNotTrustButton" Margin="5, 5" Content="Don't scan" Click="DoNotTrustButton_OnClick"/>
30+
<Button x:Name="TrustButton" Margin="5, 5" Content="Trust folder and continue" Click="TrustButton_OnClick" />
31+
<Button x:Name="DoNotTrustButton" Margin="5, 5" Content="Don't scan" Click="DoNotTrustButton_OnClick" />
2932
</StackPanel>
3033
<Grid>
3134
<Grid.RowDefinitions>
32-
<RowDefinition Height="auto"/>
33-
<RowDefinition Height="auto"/>
35+
<RowDefinition Height="auto" />
36+
<RowDefinition Height="auto" />
3437
</Grid.RowDefinitions>
3538
<Grid Grid.Row="0">
3639
<Grid.ColumnDefinitions>
37-
<ColumnDefinition Width="*"/>
38-
<ColumnDefinition Width="5*"/>
40+
<ColumnDefinition Width="*" />
41+
<ColumnDefinition Width="5*" />
3942
</Grid.ColumnDefinitions>
40-
<imaging:CrispImage Grid.Column="0" Width="50" Moniker="{x:Static catalog:KnownMonikers.StatusSecurityWarning}"/>
43+
<imaging:CrispImage Grid.Column="0" Width="50"
44+
Moniker="{x:Static catalog:KnownMonikers.StatusSecurityWarning}" />
4145
<StackPanel VerticalAlignment="Center" Grid.Column="1" Margin="0, 0, 5, 0">
4246
<TextBlock FontSize="14">This folder has not been trusted:</TextBlock>
43-
<TextBlock FontSize="14" FontWeight="Bold" TextWrapping="Wrap" Text="{Binding ElementName=TrustWindow, Path=FolderPath}"/>
47+
<TextBlock FontSize="14" FontWeight="Bold" TextWrapping="Wrap"
48+
Text="{Binding ElementName=TrustWindow, Path=FolderPath}" />
4449
</StackPanel>
4550
</Grid>
4651
<StackPanel Grid.Row="1" Margin="5">
4752
<TextBlock TextWrapping="Wrap">
4853
When scanning folder files for vulnerabilities, Snyk may automatically execute code such as invoking the package manager to get dependency information. You should only scan folders you trust.
4954
</TextBlock>
5055
<TextBlock>
51-
<LineBreak/>
52-
<Hyperlink NavigateUri="https://docs.snyk.io/ide-tools/visual-studio-extension/workspace-trust" RequestNavigate="Hyperlink_OnRequestNavigate">
56+
<LineBreak />
57+
<Hyperlink NavigateUri="https://docs.snyk.io/ide-tools/visual-studio-extension/workspace-trust"
58+
RequestNavigate="Hyperlink_OnRequestNavigate">
5359
More information
5460
</Hyperlink>
5561
</TextBlock>

0 commit comments

Comments
 (0)