summaryrefslogtreecommitdiff
path: root/internal/packet
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2025-07-06 14:40:32 +0300
committerKyren223 <Kyren223@proton.me>2025-07-06 14:40:32 +0300
commitf80cb4a0fe26f5ebbb9658da671771dc79d416d6 (patch)
tree78dcfa294aabc1db78686a095c12bf294eaa5145 /internal/packet
parente7344492595b26fd7ae21b945d1bdfe2ef115f10 (diff)
Implemented server-side authentication in accordance to the protocol
Diffstat (limited to 'internal/packet')
-rw-r--r--internal/packet/packet_test.go4
-rw-r--r--internal/packet/protocol.md2
2 files changed, 3 insertions, 3 deletions
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.