Skip to content

Commit

Permalink
- Updated nuget dependencies
Browse files Browse the repository at this point in the history
- Some small naming fixes
  • Loading branch information
theRainbird committed Nov 22, 2024
1 parent abf3ce5 commit e4b0d40
Show file tree
Hide file tree
Showing 9 changed files with 65 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,29 @@
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>CoreRemoting.Authentication</RootNamespace>
<AssemblyName>CoreRemoting.Authentication.GenericOsAuthProvider</AssemblyName>
<PackageVersion>1.1.7</PackageVersion>
<PackageVersion>1.2.1</PackageVersion>
<Authors>Hagen Siegel</Authors>
<Description>Generic OS user authentication provider for CoreRemoting</Description>
<Copyright>2020 Hagen Siegel</Copyright>
<Copyright>2024 Hagen Siegel</Copyright>
<PackageProjectUrl>https://github.com/theRainbird/CoreRemoting</PackageProjectUrl>
<PackageLicenseUrl></PackageLicenseUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Title>CoreRemoting.Authentication.GenericOsAuthProvider</Title>
<RepositoryUrl>https://github.com/theRainbird/CoreRemoting.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Remoting RPC Network Authentication Windows Linux</PackageTags>
<AssemblyVersion>1.1.7</AssemblyVersion>
<AssemblyVersion>1.2.1</AssemblyVersion>
<LangVersion>8</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Castle.Windsor" Version="6.0.0" />
<PackageReference Include="CoreRemoting" Version="1.1.15" />
<PackageReference Include="CoreRemoting.Authentication.LinuxPamAuthProvider" Version="1.1.7" />
<PackageReference Include="CoreRemoting.Authentication.WindowsAuthProvider" Version="1.1.7" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.2" />
<PackageReference Include="System.Diagnostics.Tools" Version="4.3.0" />
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="6.0.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,26 @@
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>CoreRemoting.Authentication</RootNamespace>
<AssemblyName>CoreRemoting.Authentication.LinuxPamAuthProvider</AssemblyName>
<PackageVersion>1.1.7</PackageVersion>
<PackageVersion>1.2.1</PackageVersion>
<Authors>Hagen Siegel</Authors>
<Description>Linux user authentication provider for CoreRemoting</Description>
<Copyright>2020 Hagen Siegel</Copyright>
<Copyright>2024 Hagen Siegel</Copyright>
<PackageProjectUrl>https://github.com/theRainbird/CoreRemoting</PackageProjectUrl>
<PackageLicenseUrl></PackageLicenseUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Title>CoreRemoting.Authentication.LinuxPamAuthProvider</Title>
<RepositoryUrl>https://github.com/theRainbird/CoreRemoting.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Remoting RPC Network Authentication Linux</PackageTags>
<AssemblyVersion>1.1.7</AssemblyVersion>
<AssemblyVersion>1.2.1</AssemblyVersion>
<LangVersion>8</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Castle.Windsor" Version="6.0.0" />
<PackageReference Include="CoreRemoting" Version="1.1.15" />
<PackageReference Include="Npam" Version="1.0.2" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,26 @@
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace>CoreRemoting.Authentication</RootNamespace>
<AssemblyName>CoreRemoting.Authentication.WindowsAuthProvider</AssemblyName>
<PackageVersion>1.1.7</PackageVersion>
<PackageVersion>1.2.1</PackageVersion>
<Authors>Hagen Siegel</Authors>
<Description>Windows user authentication provider for CoreRemoting</Description>
<Copyright>2020 Hagen Siegel</Copyright>
<Copyright>2024 Hagen Siegel</Copyright>
<PackageProjectUrl>https://github.com/theRainbird/CoreRemoting</PackageProjectUrl>
<PackageLicenseUrl></PackageLicenseUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Title>CoreRemoting.Authentication.WindowsAuthProvider</Title>
<RepositoryUrl>https://github.com/theRainbird/CoreRemoting.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>Remoting RPC Network Authentication Windows</PackageTags>
<AssemblyVersion>1.1.7</AssemblyVersion>
<AssemblyVersion>1.2.1</AssemblyVersion>
<LangVersion>8</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Castle.Windsor" Version="6.0.0" />
<PackageReference Include="CoreRemoting" Version="1.1.15" />
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="7.0.1" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.2" />
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="6.0.1" />
</ItemGroup>

</Project>
15 changes: 6 additions & 9 deletions CoreRemoting.Tests/RpcTests.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using CoreRemoting.Channels.Websocket;
using CoreRemoting.DependencyInjection;
using CoreRemoting.Serialization;
using CoreRemoting.Tests.ExternalTypes;
using CoreRemoting.Tests.Tools;
Expand Down Expand Up @@ -516,21 +513,21 @@ public void NonSerializableError_method_throws_Exception()
[Fact]
public async Task Disposed_client_subscription_doesnt_break_other_clients()
{
async Task roundtrip(bool encryption)
async Task Roundtrip(bool encryption)
{
var oldEncryption = _serverFixture.Server.Config.MessageEncryption;
_serverFixture.Server.Config.MessageEncryption = encryption;

try
{
RemotingClient createClient() => new RemotingClient(new ClientConfig()
RemotingClient CreateClient() => new RemotingClient(new ClientConfig()
{
ServerPort = _serverFixture.Server.Config.NetworkPort,
MessageEncryption = encryption,
});

using var client1 = createClient();
using var client2 = createClient();
using var client1 = CreateClient();
using var client2 = CreateClient();

client1.Connect();
client2.Connect();
Expand Down Expand Up @@ -558,10 +555,10 @@ async Task roundtrip(bool encryption)
}

// works!
await roundtrip(encryption: false);
await Roundtrip(encryption: false);

// fails!
await roundtrip(encryption: true);
await Roundtrip(encryption: true);
}
}
}
14 changes: 9 additions & 5 deletions CoreRemoting.Tests/Tools/CustomMessageBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using CoreRemoting.RpcMessaging;
using CoreRemoting.Serialization;
Expand All @@ -16,11 +17,13 @@ public CustomMessageBuilder()
Builder = new MethodCallMessageBuilder();
}

public Action<MethodCallMessage> ProcessMethodCallMessage { get; set; } = m => { };
public Action<MethodCallMessage> ProcessMethodCallMessage { get; set; } = _ => { };

public Action<IEnumerable<MethodCallParameterMessage>> ProcessMethodParameterInfos { get; set; } = m => { };
// ReSharper disable once MemberCanBePrivate.Global
public Action<IEnumerable<MethodCallParameterMessage>> ProcessMethodParameterInfos { get; set; } = _ => { };

public Action<MethodCallResultMessage> ProcessMethodCallResultMessage { get; set; } = m => { };
// ReSharper disable once MemberCanBePrivate.Global
public Action<MethodCallResultMessage> ProcessMethodCallResultMessage { get; set; } = _ => { };

private MethodCallMessageBuilder Builder { get; set; }

Expand All @@ -34,8 +37,9 @@ public MethodCallMessage BuildMethodCallMessage(ISerializerAdapter serializer, s
public IEnumerable<MethodCallParameterMessage> BuildMethodParameterInfos(ISerializerAdapter serializer, MethodInfo targetMethod, object[] args)
{
var m = Builder.BuildMethodParameterInfos(serializer, targetMethod, args);
ProcessMethodParameterInfos(m);
return m;
var methodCallParameterMessages = m as MethodCallParameterMessage[] ?? m.ToArray();
ProcessMethodParameterInfos(methodCallParameterMessages);
return methodCallParameterMessages;
}

public MethodCallResultMessage BuildMethodCallResultMessage(ISerializerAdapter serializer, Guid uniqueCallKey, MethodInfo method, object[] args, object returnValue)
Expand Down
2 changes: 1 addition & 1 deletion CoreRemoting/Channels/Tcp/TcpClientChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private void OnMessage(object sender, MessageReceivedEventArgs e)
{
if (e.Metadata != null && e.Metadata.ContainsKey("ServerAcceptConnection"))
{
if (!_tcpClient.SendAsync(new byte[1] { 0x0 }, _handshakeMetadata).Result && !_tcpClient.Connected)
if (!_tcpClient.SendAsync(new byte[] { 0x0 }, _handshakeMetadata).Result && !_tcpClient.Connected)
_tcpClient = null;
}
else
Expand Down
40 changes: 25 additions & 15 deletions CoreRemoting/CoreRemoting.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,34 @@

<PropertyGroup>
<LangVersion>default</LangVersion>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Title>CoreRemoting</Title>
<Authors>Hagen Siegel</Authors>
<Description>Easy to use Remoting library for .NET Core and .NET Framework</Description>
<Copyright>2024 Hagen Siegel</Copyright>
<Copyright>2024 Hagen Siegel</Copyright>
<PackageTags>Remoting RPC Network</PackageTags>
<Company>Hagen Siegel</Company>
<AssemblyVersion>1.2.0.0</AssemblyVersion>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyVersion>1.2.1.0</AssemblyVersion>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageProjectUrl>https://github.com/theRainbird/CoreRemoting</PackageProjectUrl>
<PackageLicenseUrl></PackageLicenseUrl>
<RepositoryUrl>https://github.com/theRainbird/CoreRemoting.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageVersion>1.2.0.0</PackageVersion>
<PackageReleaseNotes>- Added support for cross framework serialization
- Fixed possible thread deadlocks
- Improved service registration and methods for getting service registration metadata.
</PackageReleaseNotes>
<PackageVersion>1.2.1.0</PackageVersion>
<PackageReleaseNotes>- Change default serializer to BSON to align with non-classic API's default
- Change default channel to TCP to align with non-classic API's default
- Implement TCP channel recognition from Classic Remoting API configuration
- Preventing Leakage of the Remoting Session
- Use Async methods for WatsonTCP
- Replace obsolete methods for Aes encryption
- Remove RemotingSession in a separate task
- Avoid nested envelopes
- RemotingSession shouldn't overwrite the serialized exception with an empty MessageCallResult message.
- Try to keep useful information from the non-serializable exceptions.
- Fix a hang due to a WireMessage deserialization error.
- Demonstrate failing event dispatch when one of the clients disconnects unexpectedly.
- Don't try to dispatch the client events to a disposed remoting session.
- Try your best not to fail event dispatch even if the client had power failure</PackageReleaseNotes>
</PropertyGroup>

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand All @@ -32,21 +42,21 @@

<ItemGroup>
<PackageReference Include="Castle.Windsor" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Newtonsoft.Json.Bson" Version="1.0.2" />
<PackageReference Include="Serialize.Linq" Version="2.0.0" />
<PackageReference Include="Newtonsoft.Json.Bson" Version="1.0.3" />
<PackageReference Include="Serialize.Linq" Version="3.1.160" />
<PackageReference Include="stakx.DynamicProxy.AsyncInterceptor" Version="0.1.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="6.0.2" />
<PackageReference Include="System.Data.DataSetExtensions" Version="4.5.0" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="4.3.0" />
<PackageReference Include="System.Security.Cryptography.Algorithms" Version="4.3.1" />
<PackageReference Include="System.Security.Cryptography.Cng" Version="5.0.0" />
<PackageReference Include="System.Security.Cryptography.OpenSsl" Version="5.0.0" />
<PackageReference Include="System.Security.Principal.Windows" Version="5.0.0" />
<PackageReference Include="WatsonTcp" Version="6.0.5" />
<PackageReference Include="websocketsharp.core" Version="1.0.0" />
<PackageReference Include="WatsonTcp" Version="6.0.6" />
<PackageReference Include="websocketsharp.core" Version="1.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions CoreRemoting/RemotingSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ private void ProcessRpcMessage(WireMessage request)
var serializedResult = Array.Empty<byte>();
var method = default(MethodInfo);
var parameterValues = Array.Empty<object>();
// ReSharper disable once RedundantAssignment
var parameterTypes = Array.Empty<Type>();
var oneWay = false;

Expand Down
12 changes: 6 additions & 6 deletions CoreRemoting/Serialization/SerializableException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public SerializableException(string typeName, string message, string newStackTra
: base(message)
{
SourceTypeName = typeName;
stackTrace = newStackTrace;
_stackTrace = newStackTrace;
}

/// <summary>
Expand All @@ -56,7 +56,7 @@ public SerializableException(string typeName, string message, Exception innerExc
: base(message, innerException)
{
SourceTypeName = typeName;
stackTrace = newStackTrace;
_stackTrace = newStackTrace;
}

/// <summary>
Expand All @@ -67,7 +67,7 @@ public SerializableException(string typeName, string message, Exception innerExc
protected SerializableException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
stackTrace = info.GetString("MyStackTrace");
_stackTrace = info.GetString("MyStackTrace");
SourceTypeName = info.GetString("SourceTypeName");
}

Expand All @@ -81,11 +81,11 @@ protected SerializableException(SerializationInfo info, StreamingContext context
public override void GetObjectData(SerializationInfo info, StreamingContext context)
{
base.GetObjectData(info, context);
info.AddValue("MyStackTrace", stackTrace);
info.AddValue("MyStackTrace", _stackTrace);
info.AddValue("SourceTypeName", SourceTypeName);
}

private string stackTrace;
private string _stackTrace;

/// <summary>
/// Gets a string representation of the immediate frames on the call stack.
Expand All @@ -94,7 +94,7 @@ public override void GetObjectData(SerializationInfo info, StreamingContext cont
/// <PermissionSet>
/// <IPermission class="System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" version="1" PathDiscovery="*AllFiles*"/>
/// </PermissionSet>
public override string StackTrace => stackTrace ?? base.StackTrace;
public override string StackTrace => _stackTrace ?? base.StackTrace;

/// <summary>
/// Gets the type name of source exception.
Expand Down

0 comments on commit e4b0d40

Please sign in to comment.