@@ -206,6 +206,7 @@ def layout():
206206 color = "primary" ,
207207 className = "mb-2"
208208 ),
209+ html .P ("Note: App service principal must have USE CONNECTION privilege on UC connection object" , className = "text-dark small mb-2" ),
209210 html .Div (id = "response-output" , className = "bg-light p-3 rounded" )
210211 ])
211212 ])
@@ -227,6 +228,26 @@ def layout():
227228 headers={"Accept": "application/vnd.github+json"},
228229)
229230
231+ print(response.json())
232+ ```""" ,
233+ className = "mb-3"
234+ ),
235+ html .H4 ("Github Non-MCP API with Oauth On-Behalf-Of User" , className = "mb-1" , style = {"margin-top" : "0" , "padding-top" : "0" }),
236+ dcc .Markdown (
237+ """```python
238+ from databricks.sdk import WorkspaceClient
239+ from databricks.sdk.service.serving import ExternalFunctionRequestHttpMethod
240+ from flask import request
241+ token = request.headers.get("x-forwarded-access-token")
242+ w = WorkspaceClient(token=token, auth_type="pat")
243+
244+ response = w.serving_endpoints.http_request(
245+ conn="github_u2m",
246+ method=ExternalFunctionRequestHttpMethod.GET,
247+ path="/user",
248+ headers={"Accept": "application/vnd.github+json"},
249+ )
250+
230251print(response.json())
231252```""" ,
232253 className = "mb-3"
@@ -389,7 +410,8 @@ async def serve_index():
389410 html .Li ("Workspace enabled for Unity Catalog" ),
390411 html .Li ("Metastore admin or CREATE CONNECTION privilege" ),
391412 html .Li ("CREATE CATALOG permission on metastore" ),
392- html .Li ("USE CONNECTION privilege on connection object" )
413+ html .Li ("USE CONNECTION privilege on connection object" ),
414+ html .Li ("App service principal must have USE CONNECTION privilege on UC connection object" )
393415 ])
394416 ]),
395417 dbc .Col (md = 4 , children = [
@@ -418,7 +440,6 @@ async def serve_index():
418440 html .Ul ([
419441 html .Li ("Unity Catalog connection" ),
420442 html .Li ("Foreign catalog (optional)" ),
421- html .Li ("Serving endpoint" ),
422443 html .Li ("Workspace access" )
423444 ])
424445 ]),
@@ -481,6 +502,7 @@ def reset_workspace_client_on_auth_change(auth_type):
481502 w = None # Reset the global workspace client
482503 return html .Div ([html .P (f"Authentication type changed to: { auth_type } " , className = "text-info" )])
483504
505+
484506@callback (
485507 Output ("response-output" , "children" , allow_duplicate = True ),
486508 [Input ("send-request-btn" , "n_clicks" )],
0 commit comments