Skip to content

Commit

Permalink
Empty cluster_traffic value should default to "system" in JWT
Browse files Browse the repository at this point in the history
Signed-off-by: Neil Twigg <neil@nats.io>
  • Loading branch information
neilalexander committed Sep 17, 2024
1 parent cec21b7 commit ff5c337
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -3687,7 +3687,7 @@ func (s *Server) updateAccountClaimsWithRefresh(a *Account, ac *jwt.AccountClaim
a.mu.Lock()
previous := ajs.nrgAccount
switch tokens := strings.SplitN(ac.ClusterTraffic, ":", 2); tokens[0] {
case "system":
case "system", _EMPTY_:
a.js.nrgAccount = _EMPTY_
case "owner":
a.js.nrgAccount = a.Name
Expand Down
2 changes: 1 addition & 1 deletion server/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2147,7 +2147,7 @@ func parseJetStreamForAccount(v any, acc *Account, errors *[]error) error {
return &configErr{tk, fmt.Sprintf("Expected either 'system' or 'account' string value for %q, got %v", mk, mv)}
}
switch tokens := strings.SplitN(vv, ":", 2); strings.ToLower(tokens[0]) {
case "system":
case "system", _EMPTY_:
acc.js.nrgAccount = _EMPTY_
case "owner":
acc.js.nrgAccount = acc.Name
Expand Down

0 comments on commit ff5c337

Please sign in to comment.