Skip to content

Require explicit flag for gateway auth enforcement#468

Merged
MaxGhenis merged 1 commit intomainfrom
modal-gateway-auth-required-flag
Apr 26, 2026
Merged

Require explicit flag for gateway auth enforcement#468
MaxGhenis merged 1 commit intomainfrom
modal-gateway-auth-required-flag

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

  • Keep the Modal gateway public unless GATEWAY_AUTH_REQUIRED=1 is set.
  • Allow issuer/audience values to be staged in the Modal secret without silently requiring bearer tokens.
  • Continue returning 503 for partial issuer/audience config, and require issuer/audience when auth enforcement is enabled.

Why

The #467 deploy still failed beta integration with 403s: a gateway auth secret exists in staging, but GATEWAY_AUTH_REQUIRED is not set and the generated integration client does not send a bearer token. This makes the enforcement switch explicit so deployment can proceed without accidentally breaking the current public gateway behavior.

Testing

  • env -u UV_FROZEN uv run pytest tests/gateway/test_auth.py tests/gateway/test_endpoints.py -q
  • env -u UV_FROZEN uv run pytest -q
  • env -u UV_FROZEN uv run --with ruff ruff format --check src

@MaxGhenis MaxGhenis merged commit 22d0dae into main Apr 26, 2026
4 checks passed
@MaxGhenis MaxGhenis deleted the modal-gateway-auth-required-flag branch April 26, 2026 14:52
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