feat(embed): scope OAuth and sessions per visitor principal
Add embed visitor principals (X-Embed-Visitor), widen sessions.user_id, embed MCP OAuth/approval routes, OAuth callback context detachment, and CloneContext principal preservation for async QA streams.
This commit is contained in:
@@ -71,6 +71,7 @@ func (m *MCPManager) GetOrCreateClient(ctx context.Context, service *types.MCPSe
|
||||
if service.AuthConfig.IsOAuth() {
|
||||
tenantID, _ = types.TenantIDFromContext(ctx)
|
||||
principal, _ = types.PrincipalFromContext(ctx)
|
||||
principal = types.MCPOAuthPrincipalFromContext(ctx)
|
||||
if !principal.Valid() {
|
||||
return nil, fmt.Errorf("principal context is required to connect to OAuth MCP service %s", service.Name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user