@@ -20,19 +20,22 @@ async def connect(self):
2020 logger .error ("Authentication required" )
2121 raise DenyConnection ("Authentication required" )
2222
23- if not self .scope ["user" ].has_perm ("common.access_dagster_ui" ):
24- logger .error (f"User { self .scope ['user' ].username } lacks permission" )
23+ perm = "common.access_dagster_ui"
24+ if not self .scope ["user" ].has_perm (perm ):
25+ logger .error (
26+ f"User { self .scope ['user' ].username } lacks permission { perm } for accessing { self .scope ['path' ]} "
27+ )
2528 raise DenyConnection ("Permission denied" )
2629
2730 logger .info (f"User { self .scope ['user' ].username } authenticated" )
2831
2932 # Build upstream URL
3033 dagster_url = os .environ .get ("DAGSTER_WEBSERVER_URL" , "http://localhost:3000" )
31- dagster_prefix = os .environ .get ("DAGSTER_WEBSERVER_PREFIX" , "" )
34+ dagster_prefix = os .environ .get ("DAGSTER_WEBSERVER_PREFIX" , "pipelines " )
3235
3336 path = self .scope ["path" ]
34- if path .startswith ("/pipelines /" ):
35- path = path [len ("/pipelines /" ) :]
37+ if path .startswith (f"/ { dagster_prefix } /" ):
38+ path = path [len (f"/ { dagster_prefix } /" ) :]
3639
3740 # Convert http to ws
3841 if dagster_url .startswith ("https://" ):
@@ -45,7 +48,6 @@ async def connect(self):
4548 target_url = f"{ ws_url } /{ dagster_prefix } /{ path } "
4649 else :
4750 target_url = f"{ ws_url } /{ path } "
48-
4951 # Add query string
5052 if self .scope .get ("query_string" ):
5153 target_url += f"?{ self .scope ['query_string' ].decode ()} "
0 commit comments