-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f5a82c4
commit f813a85
Showing
10 changed files
with
98 additions
and
1 deletion.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
src/RabbitMQ.Next/Transport/Methods/Connection/SecureMethod.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,16 @@ | ||
using System; | ||
using RabbitMQ.Next.Methods; | ||
|
||
namespace RabbitMQ.Next.Transport.Methods.Connection; | ||
|
||
public readonly struct SecureMethod : IIncomingMethod | ||
{ | ||
public SecureMethod(ReadOnlyMemory<byte> challenge) | ||
{ | ||
this.Challenge = challenge; | ||
} | ||
|
||
public MethodId MethodId => MethodId.ConnectionSecure; | ||
|
||
public ReadOnlyMemory<byte> Challenge { get; } | ||
} |
14 changes: 14 additions & 0 deletions
14
src/RabbitMQ.Next/Transport/Methods/Connection/SecureMethodParser.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,14 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace RabbitMQ.Next.Transport.Methods.Connection; | ||
|
||
internal class SecureMethodParser : IMethodParser<SecureMethod> | ||
{ | ||
public SecureMethod Parse(ReadOnlySpan<byte> payload) | ||
{ | ||
payload.Read(out byte[] challenge); | ||
|
||
return new SecureMethod(challenge); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/RabbitMQ.Next/Transport/Methods/Connection/SecureOkMethod.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,16 @@ | ||
using System; | ||
using RabbitMQ.Next.Methods; | ||
|
||
namespace RabbitMQ.Next.Transport.Methods.Connection; | ||
|
||
public readonly struct SecureOkMethod : IOutgoingMethod | ||
{ | ||
public SecureOkMethod(ReadOnlyMemory<byte> response) | ||
{ | ||
this.Response = response; | ||
} | ||
|
||
public MethodId MethodId => MethodId.ConnectionSecureOk; | ||
|
||
public ReadOnlyMemory<byte> Response { get; } | ||
} |
9 changes: 9 additions & 0 deletions
9
src/RabbitMQ.Next/Transport/Methods/Connection/SecureOkMethodFormatter.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,9 @@ | ||
using System; | ||
|
||
namespace RabbitMQ.Next.Transport.Methods.Connection; | ||
|
||
internal class SecureOkMethodFormatter : IMethodFormatter<SecureOkMethod> | ||
{ | ||
public Span<byte> Write(Span<byte> destination, SecureOkMethod method) | ||
=> destination.Write(method.Response.Span); | ||
} |
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
Binary file added
BIN
+8 Bytes
tests/RabbitMQ.Next.Tests/Transport/Methods/Connection/SecureMethodPayload.dat
Binary file not shown.
Binary file added
BIN
+8 Bytes
tests/RabbitMQ.Next.Tests/Transport/Methods/Connection/SecureOkMethodPayload.dat
Binary file not shown.
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