File tree Expand file tree Collapse file tree
src/routes/(app)/namespaces/[namespace]/workflows/start-workflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11module github.com/temporalio/ui-server/v2
22
33go 1.23
4+
45require (
56 github.com/coreos/go-oidc/v3 v3.11.0
67 github.com/gomarkdown/markdown v0.0.0-20241105142532-d03b89096d81
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ package route
2525import (
2626 "fmt"
2727 "net/http"
28+ "strings"
2829
2930 "github.com/labstack/echo/v4"
3031
@@ -40,7 +41,19 @@ func DisableWriteMiddleware(cfgProvider *config.ConfigProviderWithRefresh) echo.
4041 return c .JSON (http .StatusInternalServerError , err )
4142 }
4243
43- if cfg .DisableWriteActions && c .Request ().Method != http .MethodGet {
44+ if c .Request ().Method == http .MethodGet {
45+ return next (c )
46+ }
47+
48+ if cfg .DisableWriteActions {
49+ path := c .Request ().URL .Path
50+ method := c .Request ().Method
51+
52+ if method == http .MethodPost && strings .HasPrefix (path , "/api/v1/namespaces/" ) &&
53+ strings .Contains (path , "/workflows/" ) && strings .Contains (path , "/query/" ) {
54+ return next (c )
55+ }
56+
4457 return echo .ErrMethodNotAllowed
4558 }
4659
Original file line number Diff line number Diff line change @@ -6,7 +6,11 @@ import { routeForWorkflows } from '$lib/utilities/route-for';
66
77export const load : PageLoad = async function ( { params, parent } ) {
88 const data = await parent ( ) ;
9- if ( data . settings . startWorkflowDisabled ) {
9+ const disabled =
10+ data ?. settings ?. disableWriteActions ||
11+ data ?. settings ?. startWorkflowDisabled ;
12+
13+ if ( disabled ) {
1014 const { namespace } = params ;
1115 redirect ( 302 , routeForWorkflows ( { namespace } ) ) ;
1216 }
You can’t perform that action at this time.
0 commit comments