Skip to content

Commit

Permalink
Update dependencies to address external security vulnerabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
robmen committed Dec 5, 2024
1 parent 98e6a9b commit 8f0c32c
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/FeedGenerator/FeedGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Octokit" Version="4.0.3" />
<PackageReference Include="Octokit" Version="13.0.1" />
</ItemGroup>
</Project>
17 changes: 13 additions & 4 deletions src/Web/Models/ErrorEntity.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace WixToolset.Web.Models
{
using System;
using Microsoft.WindowsAzure.Storage.Table;
using Azure;
using Azure.Data.Tables;

public class ErrorEntity : TableEntity
public class ErrorEntity : ITableEntity
{
public ErrorEntity()
{
Expand All @@ -17,6 +18,14 @@ public ErrorEntity(string site, string key = null)
this.RowKey = key ?? DateTime.UtcNow.ToString("yyyy-MM-ddTHH-mm-ss-ffff") + "-" + Guid.NewGuid().ToString("N");
}

public string PartitionKey { get; set; }

public string RowKey { get; set; }

public ETag ETag { get; set; } = ETag.All;

public DateTimeOffset? Timestamp { get; set; }

public int StatusCode { get; set; }

public string IP { get; set; }
Expand All @@ -31,4 +40,4 @@ public ErrorEntity(string site, string key = null)

public string Text { get; set; }
}
}
}
15 changes: 12 additions & 3 deletions src/Web/Models/VisitEntity.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace WixToolset.Web.Models
{
using System;
using Microsoft.WindowsAzure.Storage.Table;
using Azure;
using Azure.Data.Tables;

public class VisitEntity : TableEntity
public class VisitEntity : ITableEntity
{
public VisitEntity()
{
Expand All @@ -19,6 +20,14 @@ public VisitEntity(string site, string purpose, string key = null)
this.Purpose = purpose;
}

public string PartitionKey { get; set; }

public string RowKey { get; set; }

public ETag ETag { get; set; } = ETag.All;

public DateTimeOffset? Timestamp { get; set; }

public string Method { get; set; }

public string IP { get; set; }
Expand Down
17 changes: 6 additions & 11 deletions src/Web/Services/StorageService.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.

namespace WixToolset.Web.Services
{
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Table;
using Azure.Data.Tables;
using WixToolset.Web.Models;

public class StorageService : IStorageService
Expand All @@ -18,10 +17,10 @@ public StorageService(string connectionString)
throw new ArgumentNullException(nameof(connectionString));
}

this.Storage = CloudStorageAccount.Parse(connectionString);
this.Storage = new TableServiceClient(connectionString);
}

private CloudStorageAccount Storage { get; }
private TableServiceClient Storage { get; }

public async Task LogErrorAsync(int code, string ip, string page, string referrer, Exception exception)
{
Expand All @@ -47,15 +46,11 @@ public async Task WriteToTableStorage(string tableName, ITableEntity entity)
{
try
{
var op = TableOperation.Insert(entity);

var client = this.Storage.CreateCloudTableClient();

var table = client.GetTableReference(tableName);
var table = this.Storage.GetTableClient(tableName);

await table.CreateIfNotExistsAsync();

await table.ExecuteAsync(op);
await table.AddEntityAsync(entity);
}
catch (Exception e)
{
Expand Down
7 changes: 4 additions & 3 deletions src/Web/Web.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="WindowsAzure.Storage" Version="8.1.4" />
<PackageReference Include="Azure.Data.Tables" Version="12.9.1" />
<PackageReference Include="System.Text.Json" Version="6.0.11" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning" Version="3.4.194" PrivateAssets="all" />
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.146" PrivateAssets="all" />
</ItemGroup>
</Project>
8 changes: 4 additions & 4 deletions src/test/XsdToMarkDownTests/XsdToMarkdownTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Markdig" Version="0.20.0" />
<PackageReference Include="Markdig" Version="0.38.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.3" PrivateAssets="All" />
<PackageReference Include="xunit" Version="2.4.1" PrivateAssets="All" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" PrivateAssets="All" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" PrivateAssets="All" />
<PackageReference Include="xunit" Version="2.9.2" PrivateAssets="All" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2" PrivateAssets="All" />
</ItemGroup>

</Project>

0 comments on commit 8f0c32c

Please sign in to comment.