Skip to content

Commit c18e787

Browse files
committed
make endpoints behind flag
1 parent ecfb140 commit c18e787

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

backend/bootstrap/main.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,11 @@ func Bootstrap(templates embed.FS, diggerController controllers.DiggerController
222222
runsApiGroup.POST("/:run_id/approve", controllers.ApproveRun)
223223

224224
// internal endpoints not meant to be exposed to public and protected behind webhook secret
225-
r.POST("_internal/update_repo_cache", middleware.InternalApiAuth(), diggerController.UpdateRepoCache)
226-
r.POST("_internal/api/create_user", middleware.InternalApiAuth(), diggerController.CreateUserInternal)
227-
r.POST("_internal/api/upsert_org", middleware.InternalApiAuth(), diggerController.UpsertOrgInternal)
225+
if enableInternal := os.Getenv("DIGGER_ENABLE_INTERNAL_ENDPOINTS"); enableInternal == "true" {
226+
r.POST("_internal/update_repo_cache", middleware.InternalApiAuth(), diggerController.UpdateRepoCache)
227+
r.POST("_internal/api/create_user", middleware.InternalApiAuth(), diggerController.CreateUserInternal)
228+
r.POST("_internal/api/upsert_org", middleware.InternalApiAuth(), diggerController.UpsertOrgInternal)
229+
}
228230

229231
fronteggWebhookProcessor.POST("/create-org-from-frontegg", controllers.CreateFronteggOrgFromWebhook)
230232

0 commit comments

Comments
 (0)