refactor: move coderd/x/nats to coderd/nats

This commit is contained in:
Callum Styan
2026-10-05 16:52:36 -07:00
committed by GitHub
parent 5169248583
commit 15616728d5
31 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -83,6 +83,7 @@ import (
"github.com/coder/coder/v2/coderd/gitsshkey"
"github.com/coder/coder/v2/coderd/httpmw"
"github.com/coder/coder/v2/coderd/jobreaper"
"github.com/coder/coder/v2/coderd/nats"
"github.com/coder/coder/v2/coderd/notifications"
"github.com/coder/coder/v2/coderd/notifications/reports"
"github.com/coder/coder/v2/coderd/oauthpki"
@@ -102,7 +103,6 @@ import (
"github.com/coder/coder/v2/coderd/workspaceapps/appurl"
"github.com/coder/coder/v2/coderd/workspacestats"
"github.com/coder/coder/v2/coderd/wsbuilder"
"github.com/coder/coder/v2/coderd/x/nats"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/drpcsdk"
"github.com/coder/coder/v2/cryptorand"
+1 -1
View File
@@ -75,6 +75,7 @@ import (
"github.com/coder/coder/v2/coderd/healthcheck"
"github.com/coder/coder/v2/coderd/httpmw"
"github.com/coder/coder/v2/coderd/jobreaper"
natspubsub "github.com/coder/coder/v2/coderd/nats"
"github.com/coder/coder/v2/coderd/notifications"
"github.com/coder/coder/v2/coderd/notifications/notificationstest"
"github.com/coder/coder/v2/coderd/provisionerdserver"
@@ -94,7 +95,6 @@ import (
"github.com/coder/coder/v2/coderd/workspacestats"
"github.com/coder/coder/v2/coderd/wsbuilder"
"github.com/coder/coder/v2/coderd/x/chatd/chatprovider"
natspubsub "github.com/coder/coder/v2/coderd/x/nats"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/agentsdk"
"github.com/coder/coder/v2/codersdk/drpcsdk"
+1 -1
View File
@@ -49,7 +49,7 @@ type NATSCA struct {
// active signer for that long. The certificate stays valid for NATSCAOverlap
// past that window so that, once the next CA becomes the active signer, this CA
// is still valid while replicas' key caches refresh onto the new one. Leaves
// are separately clamped to expire before this NotAfter (see coderd/x/nats
// are separately clamped to expire before this NotAfter (see coderd/nats
// mintLeaf), so the overlap only needs to cover the cache-refresh transition.
func generateCASecret(anchorTime time.Time, keyDuration time.Duration) (string, error) {
key, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader)
+1 -1
View File
@@ -31,7 +31,7 @@ const (
// This overlap keeps the old CA valid through that transition, so it must
// exceed the cache refresh interval (plus a small leaf clamp buffer). Leaf
// lifetime imposes nothing here: leaves are clamped to just before their
// signing CA's NotAfter (see coderd/x/nats mintLeaf).
// signing CA's NotAfter (see coderd/nats mintLeaf).
NATSCAOverlap = time.Minute * 30
// defaultRotationInterval is the default interval at which keys are checked for rotation.
@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/coder/coder/v2/coderd/database/pubsub"
"github.com/coder/coder/v2/coderd/x/nats"
"github.com/coder/coder/v2/coderd/nats"
"github.com/coder/coder/v2/testutil"
)
@@ -1,5 +1,5 @@
// Command natsbench benchmarks Coder's NATS-backed pubsub
// (github.com/coder/coder/v2/coderd/x/nats) under high fan-out load.
// (github.com/coder/coder/v2/coderd/nats) under high fan-out load.
//
// A run publishes a configurable total number of messages across a set
// of publishers, subjects, subscribers, and replica nodes, then reports
@@ -11,7 +11,7 @@ import (
"golang.org/x/xerrors"
"cdr.dev/slog/v3"
"github.com/coder/coder/v2/coderd/x/nats"
"github.com/coder/coder/v2/coderd/nats"
)
// topology owns the embedded pubsub nodes for one benchmark run.
@@ -14,7 +14,7 @@ import (
"cdr.dev/slog/v3"
"cdr.dev/slog/v3/sloggers/slogtest"
"github.com/coder/coder/v2/coderd/database/pubsub"
"github.com/coder/coder/v2/coderd/x/nats"
"github.com/coder/coder/v2/coderd/nats"
"github.com/coder/coder/v2/testutil"
)
@@ -462,7 +462,7 @@ func TestMintLeaf(t *testing.T) {
// TestPubsub_ClusterTLS_RealCA stands up a three-node TLS mesh whose trust root
// is a real CA served by the cryptokeys signing cache against a real DB, then
// verifies a cross-route publish/subscribe round-trip. This exercises the
// integration seam between the cryptokeys CA cache and the x/nats cluster TLS
// integration seam between the cryptokeys CA cache and the nats cluster TLS
// callbacks, including the real PEM/x509 round-trip that the synthetic
// generateTestCA helper does not cover. Nodes form a direct full mesh to avoid
// depending on multi-hop route gossip.
+1 -1
View File
@@ -38,6 +38,7 @@ import (
"github.com/coder/coder/v2/coderd/httpapi"
"github.com/coder/coder/v2/coderd/httpmw"
"github.com/coder/coder/v2/coderd/idpsync"
"github.com/coder/coder/v2/coderd/nats"
agplportsharing "github.com/coder/coder/v2/coderd/portsharing"
"github.com/coder/coder/v2/coderd/pproflabel"
agplprebuilds "github.com/coder/coder/v2/coderd/prebuilds"
@@ -46,7 +47,6 @@ import (
agplschedule "github.com/coder/coder/v2/coderd/schedule"
agplusage "github.com/coder/coder/v2/coderd/usage"
"github.com/coder/coder/v2/coderd/wsbuilder"
"github.com/coder/coder/v2/coderd/x/nats"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/enterprise/aiseats"
"github.com/coder/coder/v2/enterprise/coderd/connectionlog"
+1 -1
View File
@@ -40,11 +40,11 @@ import (
"github.com/coder/coder/v2/coderd/database/pubsub"
"github.com/coder/coder/v2/coderd/entitlements"
"github.com/coder/coder/v2/coderd/httpapi"
natspubsub "github.com/coder/coder/v2/coderd/nats"
agplprebuilds "github.com/coder/coder/v2/coderd/prebuilds"
"github.com/coder/coder/v2/coderd/rbac"
"github.com/coder/coder/v2/coderd/rbac/policy"
"github.com/coder/coder/v2/coderd/util/namesgenerator"
natspubsub "github.com/coder/coder/v2/coderd/x/nats"
"github.com/coder/coder/v2/codersdk"
"github.com/coder/coder/v2/codersdk/workspacesdk"
"github.com/coder/coder/v2/enterprise/audit"