Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="benchmark" value="https://ci.appveyor.com/nuget/benchmarkdotnet" />
<add key="corefxlab" value="https://dotnet.myget.org/F/dotnet-corefxlab/" />
<add key="AspNetVNext" value="https://www.myget.org/F/aspnetvnext/api/v3/index.json" />
<add key="dotnet.myget.org dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" protocolVersion="3" />
</packageSources>
<disabledPackageSources>
<add key="Microsoft and .NET" value="true" />
Expand All @@ -17,4 +14,4 @@
<bindingRedirects>
<add key="skip" value="False" />
</bindingRedirects>
</configuration>
</configuration>
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
os: Visual Studio 2019 Preview
os: Visual Studio 2022
build: off

environment:
Expand Down
6 changes: 3 additions & 3 deletions src/CondenserDotNet.Client/CondenserDotNet.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="3.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Server.Abstractions" Version="2.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Server.Abstractions" Version="2.2.0" />
</ItemGroup>

<!--<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0" />
</ItemGroup>

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

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace CondenserDotNet.Middleware.CleanShutdown
{
Expand All @@ -14,7 +14,7 @@ public static IServiceCollection AddCleanShutdown(this IServiceCollection servic

public static IApplicationBuilder UseCleanShutdown(this IApplicationBuilder appBuilder)
{
var appLifetime = appBuilder.ApplicationServices.GetService<IApplicationLifetime>();
var appLifetime = appBuilder.ApplicationServices.GetService<IHostApplicationLifetime>();
var shutdownService = appBuilder.ApplicationServices.GetService<CleanShutdownService>();
appLifetime.ApplicationStopping.Register(() => shutdownService.Shutdown());
appBuilder.UseMiddleware<CleanShutdownMiddleware>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1</TargetFrameworks>
<AssemblyName>CondenserDotNet.Middleware</AssemblyName>
<PackageId>CondenserDotNet.Middleware</PackageId>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using CondenserDotNet.Middleware.CleanShutdown;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace CondenserDotNet.Middleware.ConsulCleanShutdown
{
Expand All @@ -18,7 +15,7 @@ public static IServiceCollection AddConsulShutdown(this IServiceCollection servi

public static IApplicationBuilder UseConsulShutdown(this IApplicationBuilder appBuilder, string shutdownMessage)
{
var appLifetime = appBuilder.ApplicationServices.GetService<IApplicationLifetime>();
var appLifetime = appBuilder.ApplicationServices.GetService<IHostApplicationLifetime>();
var shutdownService = appBuilder.ApplicationServices.GetService<ConsulShutdownService>();
shutdownService.ShutdownMessage = shutdownMessage;
appLifetime.ApplicationStopping.Register(shutdownService.Stopping);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ static WindowsAuthFeature()

public void Dispose()
{
#if NET6_0_WINDOWS
Identity?.Dispose();
#endif
_handshake?.Dispose();
Identity = null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public sealed class WindowsHandshake : IDisposable
{
private SecurityHandle _context;
private SecurityHandle _ntlmHandle;
private WindowsIdentity _identity;
private WindowsIdentity _identity = null; //initialise to avoid not used warning.
private readonly DateTime _dateStarted = DateTime.UtcNow;
private static readonly ASC_REQ _requestType = ASC_REQ.ASC_REQ_CONFIDENTIALITY | ASC_REQ.ASC_REQ_REPLAY_DETECT
| ASC_REQ.ASC_REQ_SEQUENCE_DETECT | ASC_REQ.ASC_REQ_CONNECTION;
Expand Down Expand Up @@ -79,7 +79,9 @@ public unsafe string AcceptSecurityToken(string returnTokenType, byte[] token)
returnToken = "Negotiate " + Convert.ToBase64String(byteSpan);
}
QuerySecurityContextToken(ref _context, out var handle);
_identity = new WindowsIdentity(handle);
#if NET6_0_WINDOWS
_identity = new WindowsIdentity(handle)
#endif
Interop.Kernel32.CloseHandle(handle);
return returnToken;
}
Expand Down
2 changes: 1 addition & 1 deletion src/CondenserDotNet.Stats/CondenserDotNet.Stats.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>net6.0;net5.0;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ public async Task CanAuthenticateWithNtlm()
using (var result = await client.GetAsync($"http://localhost:55555"))
{
var name = await result.Content.ReadAsStringAsync();
#if NET6_0_WINDOWS
Assert.Equal(System.Security.Principal.WindowsIdentity.GetCurrent().Name, name);
#endif
}
}
finally
Expand All @@ -53,6 +55,7 @@ public void Configure(IApplicationBuilder app)
app.Use(async (context, next) =>
{
await context.Response.WriteAsync(context.User.Identity.Name);
await next.Invoke();
return;
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<AssemblyName>Condenser.Tests.Integration</AssemblyName>
<PackageId>Condenser.Tests.Integration</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
Expand All @@ -24,12 +24,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coveralls.io" Version="1.4.2" />
<PackageReference Include="OpenCover" Version="4.6.519" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="OpenCover" Version="4.7.1221" />
<PackageReference Include="xunit" Version="2.4.1" />
</ItemGroup>

<ItemGroup>
Expand Down
11 changes: 7 additions & 4 deletions test/CondenserTests/CondenserTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
<AssemblyName>CondenserTests</AssemblyName>
<PackageId>CondenserTests</PackageId>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
Expand All @@ -18,11 +18,14 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coveralls.io" Version="1.4.2" />
<PackageReference Include="OpenCover" Version="4.6.519" />
<PackageReference Include="OpenCover" Version="4.7.1221" />
<PackageReference Include="Microsoft.CodeCoverage" Version="1.0.3" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.0.1" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
Expand Down
2 changes: 1 addition & 1 deletion version.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>5.2.1</VersionPrefix>
<VersionPrefix>6.0.0</VersionPrefix>
<VersionSuffix>beta</VersionSuffix>
</PropertyGroup>
</Project>