Skip to content

Robusta fork: gate JWT exp requirement behind env var#1

Open
RoiGlinik wants to merge 2 commits into
mainfrom
robusta-build/v2.96.0
Open

Robusta fork: gate JWT exp requirement behind env var#1
RoiGlinik wants to merge 2 commits into
mainfrom
robusta-build/v2.96.0

Conversation

@RoiGlinik
Copy link
Copy Markdown
Collaborator

Self-host customers' existing ANON_KEY/SERVICE_ROLE_KEY JWTs predate the upstream realtime hard-requirement on the 'exp' claim. To avoid forcing every customer to rotate keys on upgrade, this fork makes 'exp' optional when the new env var JWT_REQUIRE_EXP=false is set.

Default (JWT_REQUIRE_EXP=true) matches upstream behavior exactly.

Changes:

  • config/runtime.exs: read JWT_REQUIRE_EXP env var into :realtime, :jwt_require_exp app env
  • channels_authorization.ex: toggle required = ["role", "exp"] vs ["role"] based on the flag
  • jwt_verification.ex: add token_config(opts), omit exp validator when flag off AND token has no exp claim. Expired tokens still rejected when exp is present.
  • Dockerfile: reuse prebuilt supabase/realtime:v2.96.0 image for pgdelta artifacts instead of running the heavy bun-based pgdelta-builder stage.
  • .github/workflows/robusta-build.yml: manual + push-triggered build pipeline targeting GCP Artifact Registry and (opt-in) Docker Hub.

RoiGlinik and others added 2 commits May 21, 2026 00:01
Self-host customers' existing ANON_KEY/SERVICE_ROLE_KEY JWTs predate the
upstream realtime hard-requirement on the 'exp' claim. To avoid forcing
every customer to rotate keys on upgrade, this fork makes 'exp' optional
when the new env var JWT_REQUIRE_EXP=false is set.

Default (JWT_REQUIRE_EXP=true) matches upstream behavior exactly.

Changes:
  * config/runtime.exs:
    read JWT_REQUIRE_EXP env var into :realtime, :jwt_require_exp app env
  * channels_authorization.ex:
    toggle required = ["role", "exp"] vs ["role"] based on the flag
  * jwt_verification.ex:
    add token_config(opts), omit exp validator when flag off AND token
    has no exp claim. Expired tokens still rejected when exp is present.
  * Dockerfile:
    reuse prebuilt supabase/realtime:v2.96.0 image for pgdelta artifacts
    instead of running the heavy bun-based pgdelta-builder stage.
  * .github/workflows/robusta-build.yml:
    manual + push-triggered build pipeline targeting GCP Artifact Registry
    and (opt-in) Docker Hub.
Adds an arm64 matrix entry running on ubuntu-24.04-arm so a multi-arch
fork image is available (pushed as :<tag>-arm64) for local testing on
Apple Silicon. Native runner avoids QEMU emulation, which is slow and
flaky for Elixir/Erlang builds.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant