Skip to content

Commit

Permalink
Update to ASP.NET Core 8 RC 2 (#810)
Browse files Browse the repository at this point in the history
- Update to RC 2 of ASP.NET Core 8.
- Update NuGet packages to their latest versions.
- Fix obsolete warnings.
- Fix StyleCop warning.
- Fix tests after update to Wilson 7.0.0.
  • Loading branch information
martincostello authored Oct 10, 2023
1 parent 837fa59 commit bdc6fbd
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
18 changes: 9 additions & 9 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project>

<ItemGroup>
<PackageVersion Include="JetBrains.Annotations" Version="2022.1.0" />
<PackageVersion Include="JustEat.HttpClientInterception" Version="3.1.2" />
<PackageVersion Include="JetBrains.Annotations" Version="2023.2.0" />
<PackageVersion Include="JustEat.HttpClientInterception" Version="4.0.0" />
<PackageVersion Include="MartinCostello.Logging.XUnit" Version="0.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.0-rc.1.23421.29" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0-rc.1.23421.29" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.0-rc.1.23421.29" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="6.16.0" />
<PackageVersion Include="NSubstitute" Version="5.0.0" />
<PackageVersion Include="Shouldly" Version="4.1.0" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.435" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="8.0.0-rc.2.23480.2" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.0-rc.2.23480.2" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.0-rc.2.23480.2" />
<PackageVersion Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="7.0.0" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="Shouldly" Version="4.2.1" />
<PackageVersion Include="StyleCop.Analyzers" Version="1.2.0-beta.507" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-->
<PackageValidationBaselineVersion Condition="'$(PackageValidationBaselineVersion)' == ''">7.0.0</PackageValidationBaselineVersion>
<PreReleaseVersionLabel>rc</PreReleaseVersionLabel>
<PreReleaseVersionIteration>1</PreReleaseVersionIteration>
<PreReleaseVersionIteration>2</PreReleaseVersionIteration>
<PreReleaseBrandingLabel>Release Candidate $(PreReleaseVersionIteration)</PreReleaseBrandingLabel>
<StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
<DotNetFinalVersionKind Condition="'$(StabilizePackageVersion)' == 'true'">release</DotNetFinalVersionKind>
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"sdk": {
"version": "8.0.100-rc.1.23455.8",
"version": "8.0.100-rc.2.23502.2",
"allowPrerelease": true,
"rollForward": "major"
},

"tools": {
"dotnet": "8.0.100-rc.1.23455.8"
"dotnet": "8.0.100-rc.2.23502.2"
},

"msbuild-sdks": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,16 @@ await GenerateTokenAsync(Configure, async (context) =>
securityToken.Payload.ShouldContainKeyAndValue("aud", "https://appleid.apple.com");
securityToken.Payload.ShouldContainKeyAndValue("iss", "my-team-id");
securityToken.Payload.ShouldContainKeyAndValue("sub", "my-client-id");
securityToken.Payload.Iat.HasValue.ShouldBeTrue();
securityToken.Payload.Exp.HasValue.ShouldBeTrue();
securityToken.Payload.Expiration.HasValue.ShouldBeTrue();
securityToken.Payload.Keys.OrderBy((p) => p).ShouldBe(
["aud", "exp", "iat", "iss", "nbf", "sub"],
Case.Sensitive,
"JWT payload contains unexpected additional claims.");
((long)securityToken.Payload.Iat!.Value).ShouldBeGreaterThanOrEqualTo(utcNow.ToUnixTimeSeconds());
((long)securityToken.Payload.Exp!.Value).ShouldBeGreaterThanOrEqualTo(utcNow.AddSeconds(60).ToUnixTimeSeconds());
((long)securityToken.Payload.Exp.Value).ShouldBeLessThanOrEqualTo(utcNow.AddSeconds(70).ToUnixTimeSeconds());
securityToken.Payload.IssuedAt.ShouldBeGreaterThanOrEqualTo(utcNow.UtcDateTime.AddSeconds(-utcNow.Second));
((long)securityToken.Payload.Expiration!.Value).ShouldBeGreaterThanOrEqualTo(utcNow.AddSeconds(60).ToUnixTimeSeconds());
((long)securityToken.Payload.Expiration.Value).ShouldBeLessThanOrEqualTo(utcNow.AddSeconds(70).ToUnixTimeSeconds());
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static void ConfigureServices(IServiceCollection services)
// Assert
exception.InnerException.ShouldNotBeNull();
exception.InnerException.ShouldBeOfType<SecurityTokenValidationException>();
exception.InnerException.InnerException.ShouldBeOfType<ArgumentException>();
exception.InnerException.InnerException.ShouldBeOfType<SecurityTokenMalformedException>();
exception.InnerException.InnerException!.Message.ShouldNotBeNull();
exception.InnerException.InnerException.Message.ShouldStartWith("IDX");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/

namespace AspNet.Security.OAuth.Smartsheet;

public class SmartsheetTests(ITestOutputHelper outputHelper) : OAuthTests<SmartsheetAuthenticationOptions>(outputHelper)
{
public override string DefaultScheme => SmartsheetAuthenticationDefaults.AuthenticationScheme;
Expand Down

0 comments on commit bdc6fbd

Please sign in to comment.