Skip to content

Commit

Permalink
Merge pull request #9332 from OpenMined/bschell/turn-off-redoc
Browse files Browse the repository at this point in the history
Remove default /redoc and /docs FastAPI endpoints from server
  • Loading branch information
yashgorana authored Oct 1, 2024
2 parents 9af1e36 + 3f0b0f2 commit bd8a1c2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions packages/grid/backend/grid/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ def create_app() -> FastAPI:
openapi_url=f"{settings.API_V2_STR}/openapi.json",
lifespan=lifespan,
middleware=get_middlewares(),
docs_url=None,
redoc_url=None,
)

# instrument app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ data:
- "web"
service: "frontend"
backend:
rule: "(PathPrefix(`/api`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`)) && !PathPrefix(`/rtunnel`)"
rule: "PathPrefix(`/api`) && !PathPrefix(`/rtunnel`)"
entryPoints:
- "web"
service: "backend"
Expand Down
4 changes: 2 additions & 2 deletions packages/grid/traefik/docker/dynamic-tls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ http:
- websecure
service: "frontend"
backend:
rule: "PathPrefix(`/api`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`)"
rule: "PathPrefix(`/api`)"
entryPoints:
- web
- websecure
service: "backend"
backend-stream:
rule: "PathPrefix(`/api`) && PathPrefix(`/api/v1/syft/stream`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`)"
rule: "PathPrefix(`/api`) && PathPrefix(`/api/v1/syft/stream`)"
entryPoints:
- web
- websecure
Expand Down
4 changes: 2 additions & 2 deletions packages/grid/traefik/docker/dynamic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ http:
- web
service: "frontend"
backend:
rule: "PathPrefix(`/api`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`)"
rule: "PathPrefix(`/api`)"
entryPoints:
- web
service: "backend"
backend-stream:
rule: "PathPrefix(`/api`) && PathPrefix(`/api/v1/syft/stream`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`)"
rule: "PathPrefix(`/api`) && PathPrefix(`/api/v1/syft/stream`)"
entryPoints:
- web
service: "backend-stream"
Expand Down

0 comments on commit bd8a1c2

Please sign in to comment.