From f80cb4a0fe26f5ebbb9658da671771dc79d416d6 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Sun, 6 Jul 2025 14:40:32 +0300 Subject: Implemented server-side authentication in accordance to the protocol --- internal/packet/packet_test.go | 4 ++-- internal/packet/protocol.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'internal/packet') diff --git a/internal/packet/packet_test.go b/internal/packet/packet_test.go index 874d0bb..8bba399 100644 --- a/internal/packet/packet_test.go +++ b/internal/packet/packet_test.go @@ -14,7 +14,7 @@ import ( ) func TestPacketEncodingDecoding(t *testing.T) { - testPacketEncodingDecoding(t, &Error{PktType: 0, Error: ""}) + testPacketEncodingDecoding(t, &Error{Error: ""}) node := snowflake.NewNode(1) id := node.Generate() @@ -59,7 +59,7 @@ func TestPacketFramer(t *testing.T) { defer cancel() framer := NewFramer() - pkt := NewPacket(NewJsonEncoder(&Error{PktType: 0, Error: ""})) + pkt := NewPacket(NewJsonEncoder(&Error{Error: ""})) length := len(pkt.data) count := 5 data := make([]byte, length*count) diff --git a/internal/packet/protocol.md b/internal/packet/protocol.md index f013196..9e6d06c 100644 --- a/internal/packet/protocol.md +++ b/internal/packet/protocol.md @@ -51,7 +51,7 @@ The server must then respond in one of the following ways: - With an Error (Type 0) with any message, indicating failed authentication - With a UsersInfo (Type 6) indicating success - - Must include exactly one UserID (corresponding to the authenticated user) + - Must include exactly one User (corresponding to the authenticated user) Note: if the client takes too long between the nonce request, the nonce may have been rotated and the client will need to redo these steps. -- cgit v1.3.1