Skip to content

Commit

Permalink
0.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
osexpert committed Apr 2, 2024
1 parent 82a3251 commit 376aaae
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 68 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Company>osexpert</Company>

<VersionPrefix>0.0.1</VersionPrefix>
<VersionPrefix>0.0.2</VersionPrefix>
<PackageTags>remoting rpc grpc dotnet-remoting</PackageTags>
<Description>GRPC Remoting library for .NET Core and .NET Framework</Description>

Expand Down
6 changes: 3 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<PackageVersion Include="Open.ChannelExtensions" Version="8.0.2" />
<PackageVersion Include="System.Security.Principal.Windows" Version="5.0.0" />
<PackageVersion Include="System.Text.Json" Version="8.0.2" />

<PackageVersion Include="TupleAsJsonArray.Redux" Version="1.1.0" />
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.0" />
<PackageVersion Include="MessagePack" Version="2.5.140" />
Expand All @@ -35,8 +36,7 @@
<PackageVersion Include="K4os.Compression.LZ4.Streams" Version="1.3.6" />
<PackageVersion Include="MemoryPack" Version="1.10.0" />
<PackageVersion Include="Nullable " Version="1.3.1" />
<PackageVersion Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageVersion Include="MSTest.TestAdapter" Version="2.2.10" />
<PackageVersion Include="MSTest.TestFramework" Version="2.2.10" />

</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<Authors>osexpert, Hagen Siegel</Authors>
<Copyright>2022 osexpert, 2022 Hagen Siegel</Copyright>
<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks>
<Authors>osexpert</Authors>
<Copyright>2022 osexpert</Copyright>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>


<ItemGroup>
<PackageReference Include="System.Text.Json" />
<PackageReference Include="TupleAsJsonArray.Redux" />
<PackageReference Include="TupleAsJsonArray.Redux" Condition="'$(TargetFramework)' == 'net6.0'" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions GoreRemoting.Serialization.Json/JsonAdapter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using GoreRemoting.Serialization.Json.ArgTypes;
#if NET6_0_OR_GREATER
using TupleAsJsonArray;
#endif

namespace GoreRemoting.Serialization.Json
{
Expand All @@ -23,7 +25,9 @@ private static JsonSerializerOptions CreateDefaultOptions()
ReferenceHandler = ReferenceHandler.Preserve,
Converters =
{
#if NET6_0_OR_GREATER
new TupleConverterFactory()
#endif
},
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<Authors>osexpert</Authors>
<Copyright>2022 osexpert</Copyright>
<Nullable>enable</Nullable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<Authors>osexpert</Authors>
<Copyright>2022 osexpert</Copyright>
<Nullable>enable</Nullable>
Expand Down
56 changes: 0 additions & 56 deletions TODO.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
Intern strings like vs-streamjsonrpc? For messagepack.

Security?
During desser, somehow validate that the types sent match the signature of the method called?
If a method take object as arg, then its pointless off course, all will pass.
It is not easy to reach the method sig\types in the code that desser (for MessagePack nor possible at all since it happens within the library).
But I am not sure if this is a security problem. The only bad thing you can do is to serialize things that will fail to be used as argument
for target method, but I guess it would be better to detect this before deserialize of the type,
but it depends on, what bad thing can really happen by deserialize random types?
For binary formatter it is bad, but this is because the way to creates the objects, using reflection to call ctors.
Other serializers I don't think have these problems, so the harm you can do with them...I think it theoretical.
Anyways...this is all based on BinaryFormatter and migrating away from it, so security is not the main point here.
When all is migrated away from BinaryFormatter to some other formatter, then you could must easier switch the transport too.

CallContext
ResultContext? Maybe an idea to separate them, have a separate context that flows back to the client...


session:

client heartbeat
Expand Down Expand Up @@ -47,47 +34,6 @@ OnUnobservedException
OnException
OnClientTriggeredException


info.AddValue("ClassName", GetClassName(), typeof(string)); // Do not rename (binary serialization)
info.AddValue("Message", _message, typeof(string)); // Do not rename (binary serialization)
info.AddValue("Data", _data, typeof(IDictionary)); // Do not rename (binary serialization)
info.AddValue("InnerException", _innerException, typeof(Exception)); // Do not rename (binary serialization)
info.AddValue("HelpURL", _helpURL, typeof(string)); // Do not rename (binary serialization)
info.AddValue("StackTraceString", SerializationStackTraceString, typeof(string)); // Do not rename (binary serialization)
info.AddValue("RemoteStackTraceString", _remoteStackTraceString, typeof(string)); // Do not rename (binary serialization)
info.AddValue("RemoteStackIndex", 0, typeof(int)); // Do not rename (binary serialization)
info.AddValue("ExceptionMethod", null, typeof(string)); // Do not rename (binary serialization)
info.AddValue("HResult", _HResult); // Do not rename (binary serialization)
info.AddValue("Source", _source, typeof(string)); // Do not rename (binary serialization)
info.AddValue("WatsonBuckets", SerializationWatsonBuckets, typeof(byte[])); // Do not rename (binary serialization)
}
protected Exception(SerializationInfo info, StreamingContext context)
{
if (info == null)
throw new ArgumentNullException(nameof(info));

_message = info.GetString("Message"); // Do not rename (binary serialization)
_data = (IDictionary?)(info.GetValueNoThrow("Data", typeof(IDictionary))); // Do not rename (binary serialization)
_innerException = (Exception?)(info.GetValue("InnerException", typeof(Exception))); // Do not rename (binary serialization)
_helpURL = info.GetString("HelpURL"); // Do not rename (binary serialization)
_stackTraceString = info.GetString("StackTraceString"); // Do not rename (binary serialization)
_remoteStackTraceString = info.GetString("RemoteStackTraceString"); // Do not rename (binary serialization)
_HResult = info.GetInt32("HResult"); // Do not rename (binary serialization)
_source = info.GetString("Source"); // Do not rename (binary serialization)

RestoreRemoteStackTrace(info, context);
}

special ctor for exceptions?
has to be serializable?
Check this: StreamJsonRpc

security: check that types are of same types in service methods?
so would loop methods with same name and same numer of args. Then check if types sent match those types,
and only then deserialize to real type.
BUT is this really a problem for json and memorypack etc? I dont think so...


remote linq
https://github.com/dotnet/csharplang/discussions/5555#discussioncomment-1852834
https://github.com/6bee/Remote.Linq
Expand All @@ -97,8 +43,6 @@ callcontext vs headers \ trailers of grpc?
meaning, could we make a GrpgCallHeaders static class, that works similar?
and meaning, could we make a GrpgCallTrailers static class, that works similar?



Use headers to tell what\if compression to use? Compress\compressor: Deflate, gzip, etc.

Use separate methods for bidir and unary? So if no callback delegate arguments can use unary.
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "5.0",
"version": "6.0",
"rollForward": "latestMajor",
"allowPrerelease": false
}
Expand Down
5 changes: 3 additions & 2 deletions nuget push.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
REM set myKey=
set ver=0.0.1
set ver=0.0.2

nuget push bin\Packages\Release\NuGet\GoreRemoting.%ver%.nupkg -src https://api.nuget.org/v3/index.json -ApiKey %myKey%
nuget push bin\Packages\Release\NuGet\GoreRemoting.Compression.Lz4.%ver%.nupkg -src https://api.nuget.org/v3/index.json -ApiKey %myKey%
nuget push bin\Packages\Release\NuGet\GoreRemoting.Serialization.BinaryFormatter.%ver%.nupkg -src https://api.nuget.org/v3/index.json -ApiKey %myKey%
nuget push bin\Packages\Release\NuGet\GoreRemoting.Serialization.Json.%ver%.nupkg -src https://api.nuget.org/v3/index.json -ApiKey %myKey%
nuget push bin\Packages\Release\NuGet\GoreRemoting.Serialization.MemoryPack.%ver%.nupkg -src https://api.nuget.org/v3/index.json -ApiKey %myKey%
nuget push bin\Packages\Release\NuGet\GoreRemoting.Serialization.MessagePack.%ver%.nupkg -src https://api.nuget.org/v3/index.json -ApiKey %myKey%
nuget push bin\Packages\Release\NuGet\GoreRemoting.Serialization.MessagePack.%ver%.nupkg -src https://api.nuget.org/v3/index.json -ApiKey %myKey%
nuget push bin\Packages\Release\NuGet\GoreRemoting.Serialization.Protobuf.%ver%.nupkg -src https://api.nuget.org/v3/index.json -ApiKey %myKey%

0 comments on commit 376aaae

Please sign in to comment.