Skip to content

Commit

Permalink
Merge pull request #137 from DuendeSoftware/brock/atm_update
Browse files Browse the repository at this point in the history
nuget updates, including Duende ATM
  • Loading branch information
leastprivilege authored Sep 25, 2022
2 parents 3e7009d + fe3fad0 commit ee9be8b
Show file tree
Hide file tree
Showing 24 changed files with 88 additions and 84 deletions.
6 changes: 3 additions & 3 deletions migrations/UserSessionDb/UserSessionDb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.9">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.9" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions samples/Api/Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.9" />
<PackageReference Include="Serilog.AspNetCore" Version="6.0.1" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions samples/Blazor6/Client/Blazor6.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="6.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.9" PrivateAssets="all" />
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
</ItemGroup>

Expand Down
6 changes: 3 additions & 3 deletions samples/Blazor6/Server/Blazor6.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="6.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.9" />

<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.AspNetCore" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions samples/IdentityServer/IdentityServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Duende.IdentityServer" Version="6.1.0" />
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
<PackageReference Include="Duende.IdentityServer" Version="6.1.5" />
<PackageReference Include="Serilog.AspNetCore" Version="6.0.1" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions samples/JS.Yarp/JS.Yarp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.9" />
<PackageReference Include="Serilog.AspNetCore" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions samples/JS6.EF/JS6.EF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.9" />
<PackageReference Include="Serilog.AspNetCore" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions samples/JS6/JS6.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.9" />
<PackageReference Include="Serilog.AspNetCore" Version="6.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.9" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MinVer" Version="4.0.0" PrivateAssets="all" />
<PackageReference Include="MinVer" Version="4.2.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Duende.Bff.Yarp/Duende.Bff.Yarp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

<ItemGroup>
<PackageReference Include="Yarp.ReverseProxy" Version="1.0.1" />
<PackageReference Include="MinVer" Version="4.0.0" PrivateAssets="all" />
<PackageReference Include="MinVer" Version="4.2.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/Duende.Bff/Duende.Bff.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />

<PackageReference Include="MinVer" Version="4.0.0" PrivateAssets="all" />
<PackageReference Include="MinVer" Version="4.2.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />

<PackageReference Include="Duende.AccessTokenManagement.OpenIdConnect" Version="1.0.0-preview.4" />
<PackageReference Include="Duende.AccessTokenManagement.OpenIdConnect" Version="1.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0"/>
<PackageReference Include="xunit" Version="2.4.1"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.10.3"/>
<PackageReference Include="coverlet.collector" Version="3.0.3">
<PackageReference Include="FluentAssertions" Version="6.7.0" />
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>

<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.0"/>
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="6.0.9" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Duende.Bff.EntityFramework\Duende.Bff.EntityFramework.csproj"/>
<ProjectReference Include="..\..\src\Duende.Bff.EntityFramework\Duende.Bff.EntityFramework.csproj" />
</ItemGroup>

</Project>
10 changes: 5 additions & 5 deletions test/Duende.Bff.EntityFramework.Tests/UserSessionStoreTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,10 @@ await _subject.CreateUserSessionAsync(new UserSession
}
}
[Fact]
public void GetUserSessionsAsync_for_missing_sub_and_sid_should_throw()
public async Task GetUserSessionsAsync_for_missing_sub_and_sid_should_throw()
{
Func<Task> f = () => _subject.GetUserSessionsAsync(new UserSessionsFilter());
f.Should().Throw<Exception>();
await f.Should().ThrowAsync<Exception>();
}


Expand Down Expand Up @@ -801,10 +801,10 @@ await _subject.CreateUserSessionAsync(new UserSession
}
}
[Fact]
public void DeleteUserSessionsAsync_for_missing_sub_and_sid_should_throw()
public async Task DeleteUserSessionsAsync_for_missing_sub_and_sid_should_throw()
{
Func<Task> f = () => _subject.DeleteUserSessionsAsync(new UserSessionsFilter());
f.Should().Throw<Exception>();
await f.Should().ThrowAsync<Exception>();
}

[Fact]
Expand Down Expand Up @@ -841,7 +841,7 @@ public async Task concurrent_deletes_with_exception_handler_and_detatching_shoul
await ctx1.SaveChangesAsync();

Func<Task> f1 = async () => await ctx2.SaveChangesAsync();
f1.Should().Throw<DbUpdateConcurrencyException>();
await f1.Should().ThrowAsync<DbUpdateConcurrencyException>();

try
{
Expand Down
16 changes: 8 additions & 8 deletions test/Duende.Bff.Tests/Duende.Bff.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@


<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.1" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="FluentAssertions" Version="5.10.3" />
<PackageReference Include="coverlet.collector" Version="3.0.3">
<PackageReference Include="FluentAssertions" Version="6.7.0" />
<PackageReference Include="coverlet.collector" Version="3.1.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="CsQuery.NETStandard" Version="1.3.6.1" />

<PackageReference Include="Duende.IdentityServer" Version="6.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.0" />
<PackageReference Include="Duende.IdentityServer" Version="6.1.5" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.9" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="6.0.9" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ public async Task login_endpoint_should_accept_returnUrl()
}

[Fact]
public void login_endpoint_should_not_accept_non_local_returnUrl()
public async Task login_endpoint_should_not_accept_non_local_returnUrl()
{
Func<Task> f = () => BffHost.BrowserClient.GetAsync(BffHost.Url("/bff/login") + "?returnUrl=https://foo");
f.Should().Throw<Exception>().And.Message.Should().Contain("returnUrl");
(await f.Should().ThrowAsync<Exception>()).And.Message.Should().Contain("returnUrl");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public async Task logout_endpoint_for_authenticated_should_require_sid()
await BffHost.BffLoginAsync("alice", "sid123");

Func<Task> f = () => BffHost.BffLogoutAsync();
f.Should().Throw<Exception>();
await f.Should().ThrowAsync<Exception>();

(await BffHost.GetIsUserLoggedInAsync()).Should().BeTrue();
}
Expand All @@ -61,7 +61,7 @@ public async Task logout_endpoint_for_authenticated_when_require_otpion_is_false
BffHost.BffOptions.RequireLogoutSessionId = false;

var response = await BffHost.BrowserClient.GetAsync(BffHost.Url("/bff/logout"));
response.StatusCode.Should().Be(302); // endsession
response.StatusCode.Should().Be(HttpStatusCode.Redirect); // endsession
response.Headers.Location.ToString().ToLowerInvariant().Should().StartWith(IdentityServerHost.Url("/connect/endsession"));
}

Expand All @@ -79,15 +79,15 @@ public async Task logout_endpoint_for_authenticated_user_without_sid_should_succ
await BffHost.IssueSessionCookieAsync("alice");

var response = await BffHost.BrowserClient.GetAsync(BffHost.Url("/bff/logout"));
response.StatusCode.Should().Be(302); // endsession
response.StatusCode.Should().Be(HttpStatusCode.Redirect); // endsession
response.Headers.Location.ToString().ToLowerInvariant().Should().StartWith(IdentityServerHost.Url("/connect/endsession"));
}

[Fact]
public async Task logout_endpoint_for_anonymous_user_without_sid_should_succeed()
{
var response = await BffHost.BrowserClient.GetAsync(BffHost.Url("/bff/logout"));
response.StatusCode.Should().Be(302); // endsession
response.StatusCode.Should().Be(HttpStatusCode.Redirect); // endsession
response.Headers.Location.ToString().ToLowerInvariant().Should().StartWith(IdentityServerHost.Url("/connect/endsession"));
}

Expand All @@ -108,19 +108,19 @@ public async Task logout_endpoint_should_accept_returnUrl()
await BffHost.BffLoginAsync("alice", "sid123");

var response = await BffHost.BrowserClient.GetAsync(BffHost.Url("/bff/logout") + "?sid=sid123&returnUrl=/foo");
response.StatusCode.Should().Be(302); // endsession
response.StatusCode.Should().Be(HttpStatusCode.Redirect); // endsession
response.Headers.Location.ToString().ToLowerInvariant().Should().StartWith(IdentityServerHost.Url("/connect/endsession"));

response = await IdentityServerHost.BrowserClient.GetAsync(response.Headers.Location.ToString());
response.StatusCode.Should().Be(302); // logout
response.StatusCode.Should().Be(HttpStatusCode.Redirect); // logout
response.Headers.Location.ToString().ToLowerInvariant().Should().StartWith(IdentityServerHost.Url("/account/logout"));

response = await IdentityServerHost.BrowserClient.GetAsync(response.Headers.Location.ToString());
response.StatusCode.Should().Be(302); // post logout redirect uri
response.StatusCode.Should().Be(HttpStatusCode.Redirect); // post logout redirect uri
response.Headers.Location.ToString().ToLowerInvariant().Should().StartWith(BffHost.Url("/signout-callback-oidc"));

response = await BffHost.BrowserClient.GetAsync(response.Headers.Location.ToString());
response.StatusCode.Should().Be(302); // root
response.StatusCode.Should().Be(HttpStatusCode.Redirect); // root
response.Headers.Location.ToString().ToLowerInvariant().Should().Be("/foo");
}

Expand All @@ -130,7 +130,7 @@ public async Task logout_endpoint_should_reject_non_local_returnUrl()
await BffHost.BffLoginAsync("alice", "sid123");

Func<Task> f = () => BffHost.BrowserClient.GetAsync(BffHost.Url("/bff/logout") + "?sid=sid123&returnUrl=https://foo");
f.Should().Throw<Exception>().And.Message.Should().Contain("returnUrl");
(await f.Should().ThrowAsync<Exception>()).And.Message.Should().Contain("returnUrl");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using Xunit;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using System.Net;

namespace Duende.Bff.Tests.Endpoints.Management
{
Expand All @@ -33,7 +34,7 @@ public async Task custom_ManagementBasePath_should_affect_basepath(string path)

var response = await BffHost.BrowserClient.SendAsync(req);

response.StatusCode.Should().NotBe(404);
response.StatusCode.Should().NotBe(HttpStatusCode.NotFound);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Security.Claims;
using System.Threading.Tasks;
using Xunit;
using System.Net;

namespace Duende.Bff.Tests.Endpoints.Management
{
Expand Down Expand Up @@ -58,7 +59,7 @@ public async Task user_endpoint_for_authenticated_user_without_csrf_header_shoul
var req = new HttpRequestMessage(HttpMethod.Get, BffHost.Url("/bff/user"));
var response = await BffHost.BrowserClient.SendAsync(req);

response.StatusCode.Should().Be(401);
response.StatusCode.Should().Be(HttpStatusCode.Unauthorized);
}

[Fact]
Expand All @@ -68,7 +69,7 @@ public async Task user_endpoint_for_unauthenticated_user_should_fail()
req.Headers.Add("x-csrf", "1");
var response = await BffHost.BrowserClient.SendAsync(req);

response.StatusCode.Should().Be(401);
response.StatusCode.Should().Be(HttpStatusCode.Unauthorized);
}

[Fact]
Expand Down
8 changes: 4 additions & 4 deletions test/Duende.Bff.Tests/Endpoints/RemoteEndpointTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,21 +331,21 @@ public async Task endpoints_that_disable_csrf_should_not_require_csrf_header()
}

[Fact]
public void calls_to_endpoint_without_bff_metadata_should_fail()
public async Task calls_to_endpoint_without_bff_metadata_should_fail()
{
var req = new HttpRequestMessage(HttpMethod.Get, BffHost.Url("/not_bff_endpoint"));

Func<Task> f = () => BffHost.BrowserClient.SendAsync(req);
f.Should().Throw<Exception>();
await f.Should().ThrowAsync<Exception>();
}

[Fact]
public void calls_to_bff_not_in_endpoint_routing_should_fail()
public async Task calls_to_bff_not_in_endpoint_routing_should_fail()
{
var req = new HttpRequestMessage(HttpMethod.Get, BffHost.Url("/invalid_endpoint/test"));

Func<Task> f = () => BffHost.BrowserClient.SendAsync(req);
f.Should().Throw<Exception>();
await f.Should().ThrowAsync<Exception>();
}
}
}
Loading

0 comments on commit ee9be8b

Please sign in to comment.