Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: coder/coder
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: coder/coder
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: callum/nats-mtls-integration
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 6 commits
  • 18 files changed
  • 2 contributors

Commits on Jun 12, 2026

  1. feat(coderd/x/nats): add cluster mTLS config builder

    Mints an ephemeral IP-SAN leaf certificate from an injected CA for mutually verified TLS on NATS cluster routes.
    
    Co-authored-by: Mux <mux@coder.com>
    cstyan and Mux committed Jun 12, 2026
    Configuration menu
    Copy the full SHA
    33cfa62 View commit details
    Browse the repository at this point in the history
  2. feat(coderd/x/nats): wire cluster mTLS into embedded server options

    Adds Options.ClusterTLS so buildServerOptions configures the route listener with the minted leaf and a 10s handshake timeout; nil preserves plaintext routes.
    
    Co-authored-by: Mux <mux@coder.com>
    cstyan and Mux committed Jun 12, 2026
    Configuration menu
    Copy the full SHA
    a5a5190 View commit details
    Browse the repository at this point in the history
  3. test(coderd/x/nats): add cluster TLS mesh tests and relay URL constru…

    …ctor
    
    Adds ClusterTLSOptionsFromRelayURL for deriving the leaf SAN from a replica's relay URL, plus mesh tests covering TLS delivery, wrong-CA rejection, SAN mismatch, and mixed TLS/plaintext.
    
    Co-authored-by: Mux <mux@coder.com>
    cstyan and Mux committed Jun 12, 2026
    Configuration menu
    Copy the full SHA
    274cdcb View commit details
    Browse the repository at this point in the history
  4. feat: add nats_ca crypto key feature for NATS cluster mTLS CA

    Adds cryptokeys support for a CA that will sign the ephemeral leaf
    certificates replicas use for NATS cluster mTLS:
    
    - New crypto_key_feature enum value nats_ca; the rotator generates a
      self-signed ECDSA P-256 CA (PEM cert+key bundle in the secret column)
      and rotates it on the shared key duration with a 30 day token
      duration matching the maximum leaf lifetime.
    - FetchNATSCA accessor returns the active CA (parsed cert and signer)
      plus a trust bundle of all valid CA rows and the active row sequence
      so callers can detect rotation. It creates the CA on first fetch
      under an advisory lock since the NATS pubsub is constructed before
      the rotator starts.
    - The CA bundle contains a private key and stays excluded from the
      wsproxy crypto-keys endpoint allowlist and the signing/encryption
      keycaches.
    
    The feature is dormant: nothing fetches the CA until cli/server.go is
    wired up in a follow-up branch.
    cstyan committed Jun 12, 2026
    Configuration menu
    Copy the full SHA
    978710a View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2026

  1. Merge remote-tracking branch 'origin/callum/nats-mtls-config' into ca…

    …llum/nats-mtls-integration
    cstyan committed Jun 19, 2026
    Configuration menu
    Copy the full SHA
    698dbca View commit details
    Browse the repository at this point in the history
  2. feat(cli): wire NATS cluster mTLS into server startup

    When the NATS pubsub experiment is enabled and a DERP relay URL is
    configured (HA), enable mutual TLS on inter-replica cluster routes. The
    per-replica leaf certificate's IP SAN is derived from the relay URL host
    (the address peers dial), and the cluster CA is fetched from cryptokeys.
    
    Adds an integration test that meshes three nodes over TLS using a CA
    minted by cryptokeys.FetchNATSCA and verifies a cross-route pubsub
    round-trip.
    
    Co-authored-by: Mux <mux@coder.com>
    cstyan and Mux committed Jun 19, 2026
    Configuration menu
    Copy the full SHA
    dff598b View commit details
    Browse the repository at this point in the history
Loading