• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nats-io / nats-server / 35688130530
81%

Build:
DEFAULT BRANCH: main
Ran 22 Sep 2026 05:52AM UTC
Jobs 1
Files 66
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Sep 2026 02:53PM UTC coverage: 82.842% (+0.3%) from 82.509%
35688130530

push

github

web-flow
[FIXED] Reject JWT account mappings that AddWeightedMappings would discard (#8627)

## Description

`claimValidate` used to rely only on `jwt.AccountClaims.Validate`, which
does not enforce the same destination rules as
`Account.AddWeightedMappings`. A `$SYS.REQ.CLAIMS.UPDATE` push with a
mapping that would fail install (duplicate destination subject, or an
invalid transform token like `foo.* -> bar.$2`) still got `200 "jwt
updated"`, while the server either kept the previous mapping or removed
it and installed nothing.

This change:

1. Validates account mappings in `claimValidate` with the same checks as
`AddWeightedMappings` (duplicate dests, weight totals,
`ValidateMapping`, `NewSubjectTransform`), so bad pushes fail validation
instead of reporting success.
2. Skips removing existing mappings when a replacement fails to install
during claim apply, so a rejected destination cannot leave the account
with an empty mapping set.

## Related issue

Fixes #8468

## Testing

- `go test ./server/ -count=1 -run
'TestClaimValidateRejectsBadMappings|TestJWTMappingsRejectInvalidAndPreserveExisting|TestJWTMappings$'`

71948 of 86850 relevant lines covered (82.84%)

331908.87 hits per line

Coverage Regressions

Lines Coverage ∆ File
393
88.91
0.08% src/github.com/nats-io/nats-server/server/mqtt.go
365
78.73
0.82% src/github.com/nats-io/nats-server/server/filestore.go
332
83.03
0.1% src/github.com/nats-io/nats-server/server/jetstream_cluster.go
322
87.32
-0.1% src/github.com/nats-io/nats-server/server/consumer.go
238
93.02
0.14% src/github.com/nats-io/nats-server/server/client.go
153
86.0
-0.31% src/github.com/nats-io/nats-server/server/accounts.go
22
80.91
-0.42% src/github.com/nats-io/nats-server/server/memstore.go
15
73.49
-0.38% src/github.com/nats-io/nats-server/server/jetstream_api.go
13
84.6
0.0% src/github.com/nats-io/nats-server/conf/lex.go
9
89.14
-0.33% src/github.com/nats-io/nats-server/server/server.go
5
77.74
-0.07% src/github.com/nats-io/nats-server/server/opts.go
2
77.36
-1.26% src/github.com/nats-io/nats-server/server/log.go
2
84.42
5.99% src/github.com/nats-io/nats-server/server/raft.go
2
86.2
0.05% src/github.com/nats-io/nats-server/server/stream.go
1
94.16
0.25% src/github.com/nats-io/nats-server/server/gateway.go
1
86.58
0.11% src/github.com/nats-io/nats-server/server/monitor.go
Jobs
ID Job ID Ran Files Coverage
1 35688130530.1 22 Sep 2026 05:52AM UTC 66
82.84
GitHub Action Run
Source Files on build 35688130530
  • Tree
  • List 66
  • Changed 21
  • Source Changed 7
  • Coverage Changed 21
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #35688130530
  • 9c9ee053 on github
  • Prev Build on main (#35562344772)
  • Next Build on main (#35819710081)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc