From 4104b8270ba8c653f80a27737bd125f06ef0e06d Mon Sep 17 00:00:00 2001 From: cnderrauber Date: Mon, 22 Dec 2025 12:54:11 +0800 Subject: [PATCH] update protocol (#4183) * update protocol * fix test --- go.mod | 2 +- go.sum | 2 ++ pkg/agent/agent_test.go | 2 +- pkg/service/auth.go | 2 +- test/multinode_test.go | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index eac57e09..22f00d02 100644 --- a/go.mod +++ b/go.mod @@ -23,7 +23,7 @@ require ( github.com/jxskiss/base62 v1.1.0 github.com/livekit/mageutil v0.0.0-20250511045019-0f1ff63f7731 github.com/livekit/mediatransportutil v0.0.0-20251213100503-cc390ae365e9 - github.com/livekit/protocol v1.43.5-0.20251217174542-5c369b107325 + github.com/livekit/protocol v1.43.5-0.20251222031942-17875e94bb49 github.com/livekit/psrpc v0.7.1 github.com/mackerelio/go-osstat v0.2.6 github.com/magefile/mage v1.15.0 diff --git a/go.sum b/go.sum index e5db3690..bd1014aa 100644 --- a/go.sum +++ b/go.sum @@ -175,6 +175,8 @@ github.com/livekit/mediatransportutil v0.0.0-20251213100503-cc390ae365e9 h1:ciqz github.com/livekit/mediatransportutil v0.0.0-20251213100503-cc390ae365e9/go.mod h1:mSNtYzSf6iY9xM3UX42VEI+STHvMgHmrYzEHPcdhB8A= github.com/livekit/protocol v1.43.5-0.20251217174542-5c369b107325 h1:oaqg6YhJDFh1JShsEUK7iXlkLFcm6GEiaVhm0JP+Rsg= github.com/livekit/protocol v1.43.5-0.20251217174542-5c369b107325/go.mod h1:n00Ul4P6o2YILGhxw+O57B0h/bF3Je9PzRN36fElCmw= +github.com/livekit/protocol v1.43.5-0.20251222031942-17875e94bb49 h1:c2mvLX0IQE7cC/LYYtBeKUrGdHVuXAJMtj4fcjN9vTk= +github.com/livekit/protocol v1.43.5-0.20251222031942-17875e94bb49/go.mod h1:n00Ul4P6o2YILGhxw+O57B0h/bF3Je9PzRN36fElCmw= github.com/livekit/psrpc v0.7.1 h1:ms37az0QTD3UXIWuUC5D/SkmKOlRMVRsI261eBWu/Vw= github.com/livekit/psrpc v0.7.1/go.mod h1:bZ4iHFQptTkbPnB0LasvRNu/OBYXEu1NA6O5BMFo9kk= github.com/mackerelio/go-osstat v0.2.6 h1:gs4U8BZeS1tjrL08tt5VUliVvSWP26Ai2Ob8Lr7f2i0= diff --git a/pkg/agent/agent_test.go b/pkg/agent/agent_test.go index 5e317c24..d82e1fd7 100644 --- a/pkg/agent/agent_test.go +++ b/pkg/agent/agent_test.go @@ -48,7 +48,7 @@ func TestAgent(t *testing.T) { require.EqualValues(t, job.Id, a.Job.Id) v, err := auth.ParseAPIToken(a.Token) require.NoError(t, err) - claims, err := v.Verify(server.TestAPISecret) + _, claims, err := v.Verify(server.TestAPISecret) require.NoError(t, err) require.Equal(t, testAgentName, claims.Attributes[agent.AgentNameAttributeKey]) case <-time.After(time.Second): diff --git a/pkg/service/auth.go b/pkg/service/auth.go index c94c08fc..f8e6442b 100644 --- a/pkg/service/auth.go +++ b/pkg/service/auth.go @@ -90,7 +90,7 @@ func (m *APIKeyAuthMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Request, return } - grants, err := v.Verify(secret) + _, grants, err := v.Verify(secret) if err != nil { HandleError(w, r, http.StatusUnauthorized, errors.New("invalid token: "+authToken+", error: "+err.Error())) return diff --git a/test/multinode_test.go b/test/multinode_test.go index 54f85475..9b4d5ace 100644 --- a/test/multinode_test.go +++ b/test/multinode_test.go @@ -227,7 +227,7 @@ func TestMultiNodeRefreshToken(t *testing.T) { verifier, err := auth.ParseAPIToken(c1.RefreshToken()) require.NoError(t, err) - grants, err := verifier.Verify(testApiSecret) + _, grants, err := verifier.Verify(testApiSecret) require.NoError(t, err) if grants.Metadata != "metadata" {