Skip to content

Commit

Permalink
Upgrade to .NET 7.
Browse files Browse the repository at this point in the history
  • Loading branch information
IEvangelist committed Jan 19, 2023
1 parent f3d3465 commit 1237f52
Show file tree
Hide file tree
Showing 23 changed files with 75 additions and 71 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
default: 'Manual build'

env:
DOTNET_VERSION: '6.0.x' # set this to the dot net version to use
DOTNET_VERSION: '7.0.x' # set this to the dot net version to use

jobs:
build:
Expand All @@ -25,15 +25,15 @@ jobs:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@main

- name: 'Print manual build reason'
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo 'Reason: ${{ github.event.inputs.reason }}'
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@main
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on:
default: 'Manual build'

env:
DOTNET_VERSION: '6.0.x' # set this to the dot net version to use
DOTNET_VERSION: '7.0.x' # set this to the dot net version to use

jobs:
analyze:
Expand All @@ -49,7 +49,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@main
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
Expand All @@ -62,7 +62,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@main
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -78,7 +78,7 @@ jobs:
# uses a compiled language

- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@main
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

Expand All @@ -98,4 +98,4 @@ jobs:
# dotnet build ./src/HaveIBeenPwned.Client.PollyExtensions/HaveIBeenPwned.Client.PollyExtensions.csproj --configuration Release --no-restore

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@main
6 changes: 3 additions & 3 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- '**.csproj'

env:
DOTNET_VERSION: '6.0.x' # set this to the dot net version to use
DOTNET_VERSION: '7.0.x' # set this to the dot net version to use

jobs:
validate:
Expand All @@ -19,9 +19,9 @@ jobs:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@main
- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@main
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: publish nuget
on:
push:
tags:
- 2.*
- '**'

jobs:
publish:
Expand All @@ -26,7 +26,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
dotnet-version: 7.0.x

- name: Restore dependencies
run: |
Expand Down Expand Up @@ -54,19 +54,19 @@ jobs:
nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -NoSymbols -NonInteractive -ApiKey ${{secrets.NUGET_API_KEY}}
- name: Upload abstractions package
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@main
with:
name: HaveIBeenPwned.Client.Abstractions.${{ steps.regex-match.outputs.match }}.nupkg
path: packages/

- name: Upload client package
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@main
with:
name: HaveIBeenPwned.Client.${{ steps.regex-match.outputs.match }}.nupkg
path: packages/

- name: Upload polly extensions package
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@main
with:
name: HaveIBeenPwned.Client.PollyExtensions.${{ steps.regex-match.outputs.match }}.nupkg
path: packages/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2021 David Pine
Copyright (c) 2021-2023 David Pine

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="6.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="7.0.2" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="6.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.3" />
<PackageReference Include="Microsoft.Identity.Web" Version="1.23.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="7.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.2" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="7.0.2" />
<PackageReference Include="Microsoft.Identity.Web" Version="1.25.10" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions samples/HaveIBeenPwned.WebApi/HaveIBeenPwned.WebApi.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Description>Abstractions for HaveIBeenPwned.Client library.</Description>
Expand Down Expand Up @@ -54,7 +54,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MinVer" Version="2.5.0">
<PackageReference Include="MinVer" Version="4.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Description>This is an unofficial .NET HTTP client library exposing various "Have I Been Pwned" APIs, including Breaches, Pastes, and of course Pwned Passwords.</Description>
Expand Down Expand Up @@ -50,18 +50,18 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="6.0.3" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="7.0.2" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MinVer" Version="2.5.0">
<PackageReference Include="MinVer" Version="4.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Net.Http.Json" Version="6.0.0" />
<PackageReference Include="System.Net.Http.Json" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions src/HaveIBeenPwned.Client/DefaultPwnedClient.Breaches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ await client.GetFromJsonAsync<BreachDetails>(
}
catch (Exception ex)
{
_logger.LogError(ex, ex.Message);
_logger.LogError(ex, "{ExceptionMessage}", ex.Message);

return null!;
}
Expand Down Expand Up @@ -75,7 +75,7 @@ await client.GetFromJsonAsync<BreachDetails[]>(
}
catch (Exception ex)
{
_logger.LogError(ex, ex.Message);
_logger.LogError(ex, "{ExceptionMessage}", ex.Message);

return Array.Empty<BreachDetails>();
}
Expand All @@ -101,7 +101,7 @@ await client.GetFromJsonAsync<BreachDetails[]>(
}
catch (Exception ex)
{
_logger.LogError(ex, ex.Message);
_logger.LogError(ex, "{ExceptionMessage}", ex.Message);

return Array.Empty<BreachDetails>();
}
Expand All @@ -120,7 +120,7 @@ async Task<string[]> IPwnedBreachesClient.GetDataClassesAsync()
}
catch (Exception ex)
{
_logger.LogError(ex, ex.Message);
_logger.LogError(ex, "{ExceptionMessage}", ex.Message);

return Array.Empty<string>();
}
Expand Down
2 changes: 1 addition & 1 deletion src/HaveIBeenPwned.Client/DefaultPwnedClient.Passwords.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async Task<PwnedPassword> IPwnedPasswordsClient.GetPwnedPasswordAsync(string pla
}
catch (Exception ex)
{
_logger.LogError(ex, ex.Message);
_logger.LogError(ex, "{ExceptionMessage}", ex.Message);
}

return pwnedPassword;
Expand Down
2 changes: 1 addition & 1 deletion src/HaveIBeenPwned.Client/DefaultPwnedClient.Pastes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ await client.GetFromJsonAsync<Pastes[]>(
}
catch (Exception ex)
{
_logger.LogError(ex, ex.Message);
_logger.LogError(ex, "{ExceptionMessage}", ex.Message);

return Array.Empty<Pastes>();
}
Expand Down
4 changes: 1 addition & 3 deletions src/HaveIBeenPwned.Client/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@ static class StringExtensions
return value;
}

using var sha1 = SHA1.Create();

var hash = sha1.ComputeHash(Encoding.UTF8.GetBytes(value));
var hash = SHA1.HashData(Encoding.UTF8.GetBytes(value));
StringBuilder stringBuilder = new(hash.Length * 2);

foreach (var b in hash)
Expand Down
10 changes: 5 additions & 5 deletions src/HaveIBeenPwned.Client/HaveIBeenPwned.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Description>This is an unofficial .NET HTTP client library exposing various "Have I Been Pwned" APIs, including Breaches, Pastes, and of course Pwned Passwords.</Description>
Expand Down Expand Up @@ -50,17 +50,17 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MinVer" Version="2.5.0">
<PackageReference Include="MinVer" Version="4.2.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="System.Net.Http.Json" Version="6.0.0" />
<PackageReference Include="System.Net.Http.Json" Version="7.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion src/HaveIBeenPwned.Client/IPwnedBreachesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

namespace HaveIBeenPwned.Client;

/// <summary></summary>
/// <summary>
/// The "pwned" breaches client.
/// </summary>
public interface IPwnedBreachesClient
{
/// <summary>
Expand Down
4 changes: 3 additions & 1 deletion src/HaveIBeenPwned.Client/IPwnedPasswordsClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

namespace HaveIBeenPwned.Client;

/// <summary></summary>
/// <summary>
/// The "pwned" passwords client.
/// </summary>
public interface IPwnedPasswordsClient
{
/// <summary>
Expand Down
4 changes: 3 additions & 1 deletion src/HaveIBeenPwned.Client/IPwnedPastesClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

namespace HaveIBeenPwned.Client;

/// <summary></summary>
/// <summary>
/// The "pwned" pastes client.
/// </summary>
public interface IPwnedPastesClient
{
/// <summary>
Expand Down
Loading

0 comments on commit 1237f52

Please sign in to comment.