-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate adapters session logic from core package #496
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...SystemWebAdapters.SessionState/Microsoft.AspNetCore.SystemWebAdapters.SessionState.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net6.0;netcoreapp3.1;net472</TargetFrameworks> | ||
<HasImplementation>false</HasImplementation> | ||
<LangVersion>10</LangVersion> | ||
<IsPackable>true</IsPackable> | ||
<Nullable>enable</Nullable> | ||
<EnablePackageValidation>true</EnablePackageValidation> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<InternalsVisibleTo Include="Microsoft.AspNetCore.SystemWebAdapters.SessionState.Tests" /> | ||
<InternalsVisibleTo Include="DynamicProxyGenAssembly2" Key="0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<FrameworkFiles Include="**/*.Framework.cs" /> | ||
<StandardFiles Include="**/*.Standard.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' "> | ||
<Compile Remove="**/*" /> | ||
<Compile Include="@(StandardFiles)" /> | ||
<Compile Include="RemoteSession/RemoteAppSessionStateOptions.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'netcoreapp3.1' "> | ||
<Compile Remove="@(FrameworkFiles)" /> | ||
<Compile Remove="@(StandardFiles)" /> | ||
|
||
<FrameworkReference Include="Microsoft.AspNetCore.App" /> | ||
|
||
<Using Include="Microsoft.AspNetCore.Http.HttpContext" Alias="HttpContextCore" /> | ||
<Using Include="Microsoft.AspNetCore.Http.HttpResponse" Alias="HttpResponseCore" /> | ||
<Using Include="Microsoft.AspNetCore.Http.HttpRequest" Alias="HttpRequestCore" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net472' "> | ||
<Compile Remove="**/*" /> | ||
<Compile Include="@(FrameworkFiles)" /> | ||
<Compile Include="RemoteSession/RemoteAppSessionStateOptions.cs" /> | ||
<Compile Include="Serialization/SessionValues.cs" /> | ||
<Compile Include="Serialization/SerializedSessionState.cs" /> | ||
<Compile Include="Serialization/SessionSerializer.Shared.cs" /> | ||
|
||
<Reference Include="System.Web" /> | ||
|
||
<PackageReference Include="System.Text.Json" Version="6.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Microsoft.AspNetCore.SystemWebAdapters\Microsoft.AspNetCore.SystemWebAdapters.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
18 changes: 18 additions & 0 deletions
18
...SystemWebAdapters.SessionState/RemoteSession/RemoteAppSessionStateExtensions.Framework.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using Microsoft.AspNetCore.SystemWebAdapters.SessionState.RemoteSession; | ||
|
||
namespace Microsoft.AspNetCore.SystemWebAdapters; | ||
|
||
public static class RemoteAppSessionStateExtensions | ||
{ | ||
public static ISystemWebAdapterBuilder AddRemoteAppSession(this ISystemWebAdapterBuilder builder, Action<RemoteAppSessionStateOptions> configure) | ||
{ | ||
var options = new RemoteAppSessionStateOptions(); | ||
configure(options); | ||
builder.Modules.Add(new RemoteSessionModule(options)); | ||
return builder; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...dapters/Modules/ProxyOptions.Framework.cs → ...apters/Adapters/ProxyOptions.Framework.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...apters/src/Microsoft.AspNetCore.SystemWebAdapters/Adapters/SessionState/SessionOptions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Microsoft.AspNetCore.SystemWebAdapters.SessionState; | ||
|
||
/// <summary> | ||
/// An interface to register known keys for session objects. | ||
/// </summary> | ||
public class SessionOptions | ||
{ | ||
/// <summary> | ||
/// Gets the mapping of known session keys to types | ||
/// </summary> | ||
public IDictionary<string, Type> KnownKeys { get; } = new Dictionary<string, Type>(); | ||
|
||
/// <summary> | ||
/// Registers a session key name to be of type <typeparamref name="T"/> | ||
/// </summary> | ||
/// <typeparam name="T"></typeparam> | ||
/// <param name="key"></param> | ||
public void RegisterKey<T>(string key) => KnownKeys.Add(key, typeof(T)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
...Adapters/test/Microsoft.AspNetCore.SystemWebAdapters.SessionState.Tests/IsExternalInit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
namespace System.Runtime.CompilerServices; | ||
|
||
internal static class IsExternalInit | ||
{ | ||
} |
33 changes: 33 additions & 0 deletions
33
...pters.SessionState.Tests/Microsoft.AspNetCore.SystemWebAdapters.SessionState.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net6.0;netcoreapp3.1</TargetFrameworks> | ||
<Nullable>enable</Nullable> | ||
<LangVersion>10</LangVersion> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Autofac.Extras.Moq" Version="6.0.0" /> | ||
<PackageReference Include="AutoFixture" Version="4.15.0" /> | ||
<PackageReference Include="Moq" Version="4.16.1" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' "> | ||
<Compile Remove="IsExternalInit.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Using Include="Microsoft.AspNetCore.Http.HttpContext" Alias="HttpContextCore" /> | ||
<Using Include="Microsoft.AspNetCore.Http.HttpRequest" Alias="HttpRequestCore" /> | ||
<Using Include="Microsoft.AspNetCore.Http.HttpResponse" Alias="HttpResponseCore" /> | ||
|
||
<Using Include="System.Web.HttpContext" Alias="HttpContext"/> | ||
<Using Include="System.Web.HttpRequest" Alias="HttpRequest"/> | ||
<Using Include="System.Web.HttpResponse" Alias="HttpResponse"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.SystemWebAdapters.SessionState\Microsoft.AspNetCore.SystemWebAdapters.SessionState.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
File renamed without changes.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main goal was to remove these dependencies? What problems did we expect these to cause people?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That the general HttpContext adapter usage could be done without a bunch of new dependencies. People often complain when their packages.config ends up with a ton of new packages (which is what this will do to a .NET 4.7.2 app). Since they may not need the session stuff, this can be a pay-for-play thing.