Skip to content

Production banner advertises /swagger and /__dev URLs that 404 (all 4 frameworks) #99

Description

@andrevanzuydam

Summary

The framework startup banner prints Swagger: and Dashboard: URLs unconditionally,
including under tina4 serve --production and with TINA4_DEBUG=false, where both of
those endpoints correctly return 404.

Reproduction

TINA4_OVERRIDE_CLIENT=true tina4 serve --production --no-browser

Banner shows:

  Server:    http://localhost:7146 (uvicorn)
  Swagger:   http://localhost:7146/swagger
  Dashboard: http://localhost:7146/__dev
  Debug:     OFF

but:

curl -o /dev/null -w '%{http_code}\n' http://127.0.0.1:7146/__dev      # 404
curl -o /dev/null -w '%{http_code}\n' http://127.0.0.1:7146/swagger    # 404

Why it matters

It is only cosmetic, but it is actively misleading in two directions: an operator
reads it as "swagger and the dev dashboard are exposed in production" (they are not),
and a developer clicking the link gets a 404 with no explanation. It also made
verifying the dev-admin production gate harder, because the banner and the actual
behaviour disagreed.

Proposed fix (all 4, parity)

Print each line only when that surface is actually enabled: gate the Swagger: line
on the swagger predicate (is_enabled() / isEnabled() / enabled? /
swaggerEnabled()) and the Dashboard: line on the dev-admin/debug gate. When
suppressed, print nothing rather than a dead URL.

Not yet fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions