Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
24810c1
Add `BenchmarkJetStreamConsumeFilteredContiguous`
neilalexander Jul 2, 2025
7fb2ad3
CI: Check PR sign-offs with env variable
MauriceVanVeen Jul 3, 2025
e2f782b
CI: Default to read permissions
MauriceVanVeen Jul 3, 2025
e8f559b
CI: Simplify PR sign-offs check
MauriceVanVeen Jul 3, 2025
813c4dd
Update `BenchmarkJetStreamConsumeFilteredContiguous` to test both sin…
neilalexander Jul 3, 2025
91e9965
NRG: Partial catchup protection
MauriceVanVeen Jul 7, 2025
e701ddf
NRG: Don't compact on catchup until snapshot written
neilalexander Jul 7, 2025
5d33ef4
NRG: Fix server shutdown race condition
MauriceVanVeen Jul 8, 2025
8878e66
Update to Go 1.24.5/1.23.11
neilalexander Jul 9, 2025
f986fa3
[FIXED] Replicated NoWait/Expires request timeout
MauriceVanVeen Jul 8, 2025
14db0ef
De-flake TestGatewayTLSMixedIPAndDNS
MauriceVanVeen Jul 9, 2025
1456fa4
Export `SubjectMatchesFilter`
neilalexander Jul 10, 2025
d5ee7ee
[FIXED] Pull consumer AckWait signals still active
MauriceVanVeen Jul 11, 2025
7a47a1a
Fix lack of check for priority groups on push consumers
Jarema Jul 11, 2025
656a1ef
Update dependencies
neilalexander Jul 14, 2025
21194b4
Add cid to LeafInfo
bruth Jul 15, 2025
41035b5
[FIXED] CommittedEntry leak on error
MauriceVanVeen Jul 15, 2025
79679dd
[FIXED] Get header value with shared prefix
MauriceVanVeen Jul 15, 2025
05cc8ff
add endpoint names to monitoring overivew page
alexbozhenko Jul 15, 2025
f203778
[FIXED] THW: ExpireTasks in full wheel
MauriceVanVeen Jul 16, 2025
54d402d
[FIXED] Panic when selectMsgBlock returns nil
MauriceVanVeen Jul 16, 2025
d2efac7
First stab at documenting varz and related structures
ripienaar Jul 18, 2025
f0fb6b9
Review feedback
ripienaar Jul 18, 2025
9114366
[FIXED] No redundant limit marker on KV purge
MauriceVanVeen Jul 1, 2025
774028f
Add fuzz tests
Jul 21, 2025
7679d07
[FIXED] Validate default_sentinel JWT is bearer
MauriceVanVeen Jul 17, 2025
a2a1708
Ensure `$SYS.REQ.USER.INFO` is only answered by correct server
neilalexander Jul 22, 2025
82b46be
NRG: Improve logs to consistencly include [pterm:pindex]
MauriceVanVeen Jul 23, 2025
5e631c0
NRG: Truncate back to snapshot properly
MauriceVanVeen Jul 23, 2025
05be7c4
NRG: Continue after truncate to snapshot
MauriceVanVeen Jul 23, 2025
be856b5
make overiview page æsthetically more pleasant
alexbozhenko Jul 21, 2025
761461a
make endpoint to appear only on hover
alexbozhenko Jul 23, 2025
81a5dfc
ci: add loong64 to release
znley Jul 23, 2025
c86939f
Add auth callout [REDACTED] token test
MauriceVanVeen Jul 24, 2025
e9c78cc
[FIXED] Cipher conversion fails on compressed msg block
MauriceVanVeen Jul 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/cov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
schedule:
- cron: "40 4 * * *"

permissions:
contents: read

jobs:
nightly_coverage:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/long-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
schedule:
- cron: "30 12 * * *"

permissions:
contents: read

concurrency:
# At most one of these workflow per ref running
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/mqtt-test.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: MQTT External Tests
on: [pull_request]

permissions:
contents: read

jobs:
test:
env:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ on:
schedule:
- cron: "40 4 * * *"

permissions:
contents: read

jobs:
run:
runs-on: ${{ vars.GHA_WORKER_RELEASE || 'ubuntu-latest' }}
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ on:
- v*

permissions:
contents: write
contents: read

jobs:
run:
name: GitHub Release
runs-on: ${{ vars.GHA_WORKER_RELEASE || 'ubuntu-latest' }}
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
pull_request:
workflow_dispatch:

permissions:
contents: read

env:
RACE: ${{ (github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/release/') && github.event_name != 'pull_request') && '-race' || '' }}

Expand Down Expand Up @@ -51,11 +54,13 @@ jobs:

- name: Check PR description is signed off
if: github.event_name == 'pull_request'
env:
PR_DESC: ${{ github.event.pull_request.body }}
run: |
if ! echo "${{ github.event.pull_request.body }}" | grep -Pq '^Signed-off-by:\s*(?!Your Name|.*<your\.email@example\.com>)'; then
echo "::error ::Pull request has not been signed off in the PR description with a \`Signed-off-by:\` line"
exit 1
fi
grep -Pq '^Signed-off-by:\s*(?!Your Name|.*<your\.email@example\.com>)' <<<"$PR_DESC" || {
echo "::error ::Pull request has not been signed off in the PR description with a \`Signed-off-by:\` line"
exit 1
}

lint:
name: Lint
Expand Down
3 changes: 2 additions & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ builds:
env:
# This is the toolchain version we use for releases. To override, set the env var, e.g.:
# GORELEASER_TOOLCHAIN="go1.22.8" TARGET='linux_amd64' goreleaser build --snapshot --clean --single-target
- GOTOOLCHAIN={{ envOrDefault "GORELEASER_TOOLCHAIN" "go1.24.4" }}
- GOTOOLCHAIN={{ envOrDefault "GORELEASER_TOOLCHAIN" "go1.24.5" }}
- GO111MODULE=on
- CGO_ENABLED=0
goos:
Expand All @@ -34,6 +34,7 @@ builds:
- arm
- arm64
- 386
- loong64
- mips64le
- s390x
- ppc64le
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/nats-io/nats-server/v2

go 1.23.0

toolchain go1.23.10
toolchain go1.23.11

require (
github.com/antithesishq/antithesis-sdk-go v0.4.3-default-no-op
Expand All @@ -14,7 +14,7 @@ require (
github.com/nats-io/nkeys v0.4.11
github.com/nats-io/nuid v1.0.1
go.uber.org/automaxprocs v1.6.0
golang.org/x/crypto v0.39.0
golang.org/x/sys v0.33.0
golang.org/x/crypto v0.40.0
golang.org/x/sys v0.34.0
golang.org/x/time v0.12.0
)
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMT
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs=
go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8=
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM=
golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA=
golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE=
golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
39 changes: 38 additions & 1 deletion server/auth_callout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,14 @@ func TestAuthCalloutBasics(t *testing.T) {
require_True(t, si.Name == "A")
require_True(t, ci.Host == "127.0.0.1")
// Allow dlc user.
if opts.Username == "dlc" && opts.Password == "zzz" {
if (opts.Username == "dlc" && opts.Password == "zzz") || opts.Token == "SECRET_TOKEN" {
var j jwt.UserPermissionLimits
j.Pub.Allow.Add("$SYS.>")
j.Payload = 1024
if opts.Token == "SECRET_TOKEN" {
// Token MUST NOT be exposed in user info.
require_Equal(t, ci.User, "[REDACTED]")
}
ujwt := createAuthUser(t, user, _EMPTY_, globalAccountName, "", nil, 10*time.Minute, &j)
m.Respond(serviceResponse(t, user, si.ID, ujwt, "", 0))
} else {
Expand Down Expand Up @@ -279,6 +283,39 @@ func TestAuthCalloutBasics(t *testing.T) {
if expires > 10*time.Minute || expires < (10*time.Minute-5*time.Second) {
t.Fatalf("Expected expires of ~%v, got %v", 10*time.Minute, expires)
}

// Callout with a token should also work, regardless of it being redacted in the user info.
nc.Close()
nc = at.Connect(nats.Token("SECRET_TOKEN"))
defer nc.Close()

resp, err = nc.Request(userDirectInfoSubj, nil, time.Second)
require_NoError(t, err)
response = ServerAPIResponse{Data: &UserInfo{}}
err = json.Unmarshal(resp.Data, &response)
require_NoError(t, err)

userInfo = response.Data.(*UserInfo)
dlc = &UserInfo{
// Token MUST NOT be exposed in user info.
UserID: "[REDACTED]",
Account: globalAccountName,
Permissions: &Permissions{
Publish: &SubjectPermission{
Allow: []string{"$SYS.>"},
Deny: []string{AuthCalloutSubject}, // Will be auto-added since in auth account.
},
Subscribe: &SubjectPermission{},
},
}
expires = userInfo.Expires
userInfo.Expires = 0
if !reflect.DeepEqual(dlc, userInfo) {
t.Fatalf("User info for %q did not match", "dlc")
}
if expires > 10*time.Minute || expires < (10*time.Minute-5*time.Second) {
t.Fatalf("Expected expires of ~%v, got %v", 10*time.Minute, expires)
}
}

func TestAuthCalloutMultiAccounts(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion server/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -4360,7 +4360,7 @@ func sliceHeader(key string, hdr []byte) []byte {
if len(hdr) == 0 {
return nil
}
index := bytes.Index(hdr, stringToBytes(key))
index := bytes.Index(hdr, stringToBytes(key+":"))
hdrLen := len(hdr)
// Check that we have enough characters, this will handle the -1 case of the key not
// being found and will also handle not having enough characters for trailing CRLF.
Expand Down
20 changes: 20 additions & 0 deletions server/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3040,6 +3040,26 @@ func TestSliceHeader(t *testing.T) {
require_True(t, bytes.Equal(sliced, copied))
}

func TestSliceHeaderOrdering(t *testing.T) {
hdr := []byte("NATS/1.0\r\n\r\n")

// These headers share the same prefix, the longer subject
// must not invalidate the existence of the shorter one.
hdr = genHeader(hdr, JSExpectedLastSubjSeqSubj, "foo")
hdr = genHeader(hdr, JSExpectedLastSubjSeq, "24")

sliced := sliceHeader(JSExpectedLastSubjSeq, hdr)
copied := getHeader(JSExpectedLastSubjSeq, hdr)

require_NotNil(t, sliced)
require_Equal(t, cap(sliced), 2)

require_NotNil(t, copied)
require_Equal(t, cap(copied), len(copied))

require_True(t, bytes.Equal(sliced, copied))
}

func TestInProcessAllowedConnectionType(t *testing.T) {
tmpl := `
listen: "127.0.0.1:-1"
Expand Down
16 changes: 0 additions & 16 deletions server/configs/reload/defaultsentinel_1.conf

This file was deleted.

16 changes: 0 additions & 16 deletions server/configs/reload/defaultsentinel_2.conf

This file was deleted.

Loading
Loading