From ec92a82e4e5cd614cc59aef2174366d929498d8c Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 14 May 2026 22:51:37 +0000 Subject: [PATCH] fix(nests): pin the interop harness's moq-relay to the version moq-auth expects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The local Docker interop stack builds moq-relay from a `./moq` checkout that NostrNestsHarness cloned at unpinned `main` (~0.10.25+), while nostrnests's moq-auth sidecar mints tokens for moq-relay 0.10.10 — the version nostrnests pins in their own nests-relay/Dockerfile.relay. The JWKS/JWT-signature handling drifted across those releases, so the relay rejected every connection with `failed to decode the token` even though the QUIC/TLS/WebTransport handshake completed cleanly. Pin DEFAULT_MOQ_REVISION to the moq-relay-v0.10.10 release tag so the harness builds the relay moq-auth was written against, and fetch tags so the tag is checkout-able on a pre-existing clone. https://claude.ai/code/session_01PoQupfdoKU3ryQwLwTeXeM --- .../nestsclient/interop/NostrNestsHarness.kt | 27 ++++++++++++++----- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/nestsClient/src/jvmTest/kotlin/com/vitorpamplona/nestsclient/interop/NostrNestsHarness.kt b/nestsClient/src/jvmTest/kotlin/com/vitorpamplona/nestsclient/interop/NostrNestsHarness.kt index e647cc926..c155e0c1c 100644 --- a/nestsClient/src/jvmTest/kotlin/com/vitorpamplona/nestsclient/interop/NostrNestsHarness.kt +++ b/nestsClient/src/jvmTest/kotlin/com/vitorpamplona/nestsclient/interop/NostrNestsHarness.kt @@ -99,12 +99,23 @@ class NostrNestsHarness private constructor( private const val MOQ_REPO_URL = "https://github.com/kixelated/moq.git" /** - * Pin the upstream `kixelated/moq` revision so test runs are - * reproducible even if upstream main changes a wire-level detail - * we depend on (e.g. moq-lite framing). Override at runtime via - * `-DnestsInteropMoqRev=`. + * Pin the upstream `kixelated/moq` revision the harness builds + * `moq-relay` from. This MUST match the version nostrnests's + * `moq-auth` sidecar mints tokens for — otherwise the relay + * rejects every connection with `failed to decode the token` + * (the JWKS / JWT-signature handling drifted across releases). + * + * nostrnests pins `moq-relay --version 0.10.10` in their own + * `nests-relay/Dockerfile.relay`, so 0.10.10 is the version their + * `moq-auth` is written against. The `docker-compose-moq.yml` this + * harness uses builds `moq-relay` from `./moq` source instead of + * `cargo install`ing it, so we have to check out the matching tag + * ourselves. Plain `main` builds whatever is latest (0.10.25+), + * which moq-auth's tokens no longer satisfy. + * + * Override at runtime via `-DnestsInteropMoqRev=`. */ - const val DEFAULT_MOQ_REVISION = "main" + const val DEFAULT_MOQ_REVISION = "moq-relay-v0.10.10" private const val COMPOSE_FILE = "docker-compose-moq.yml" private const val PORT_READY_TIMEOUT_MS = 90_000L @@ -314,8 +325,10 @@ class NostrNestsHarness private constructor( if (!moqDir.exists()) { runProcess(nestsRepo, "git", "clone", MOQ_REPO_URL, "moq") } - // Reproducible runs: pin to the requested revision. - runProcess(moqDir, "git", "fetch", "origin", "--quiet") + // Reproducible runs: pin to the requested revision. `--tags` so a + // release-tag pin like `moq-relay-v0.10.10` is checkout-able even + // on a repo first cloned before that tag existed. + runProcess(moqDir, "git", "fetch", "origin", "--tags", "--quiet") runProcess(moqDir, "git", "checkout", "--quiet", rev) }