feat(account): declare account-level subject mappings #3
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
go
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
terraform-providers/terraform-provider-nsc!3
Loading…
Reference in a new issue
No description provided.
Delete branch "mikluko/octant/1538-account-mappings"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A
mappingblock onnsc_accountwrites nats-jwt'sMappinginto the account claims: a source subject to one or more weighted destinations, each with an optional cluster. Destinations may reference the source's wildcards and use mapping functions such aspartition().nats-jwt validates nothing on encode, so the resource runs
Mapping.Validateitself and refuses a source whose weights exceed 100 or whose subjects do not parse. A source declared in two blocks is refused as well: the claims hold one destination list per source, and the second block would replace the first without a trace.Why
Octant T1538 under D1532:
upnatsneeds to declare an account-level mapping that appends two partition tokens to every monitoring event before JetStream selects a stream, and research Q1533 found no release of this provider carries the attribute, while a config-filemappingsblock is a startup error under an operator resolver.Testing
go test ./...green (acceptance tests run against the localterraformbinary). Three new tests:TestAccAccountResource_withMappingsdecodes the signed JWT and checks every source, destination, weight and cluster, then updates the weights and checks the re-signed JWT;TestAccAccountResource_rejectsOverweightMappingsandTestAccAccountResource_rejectsDuplicateMappingSourcepin the two refusals.golangci-lintreports the same eight pre-existing findings asmain, none in this diff.go generate ./...regenerateddocs/resources/account.md.Release
A new backward-compatible attribute: MESO under EffVer, so
v0.14.0. The release is the repo's manual goreleaser flow (git tag -a v0.14.0,git push origin main --tags,goreleaser release --clean) and is left to the maintainer.Authored by Claude (claude-fable-5-1) under Claude Code 2.1.257; diff reviewed against the final tree.