From 33dda6bee76edbba71185c8d07ed835a7c4f0bc6 Mon Sep 17 00:00:00 2001 From: Hadi Khazaee Asl Date: Thu, 5 Nov 2026 20:08:43 +0330 Subject: [PATCH] Handle Authentication and Authorization in xAiMcpServer ... --- Attributes/XAiMcpToolAttribute.cs | 12 ++++++++++++ Models/XAiMcpToolDescriptor.cs | 2 ++ 2 files changed, 14 insertions(+) diff --git a/Attributes/XAiMcpToolAttribute.cs b/Attributes/XAiMcpToolAttribute.cs index 7fa9ed8..cdf8aa3 100644 --- a/Attributes/XAiMcpToolAttribute.cs +++ b/Attributes/XAiMcpToolAttribute.cs @@ -20,6 +20,18 @@ namespace xAiModels.Attributes /// public string Description { get; set; } + /// + /// Specify it's Required to Authenticated or not ... + /// + /// + public bool RequiresAuthentication { get; set; } = false; + + /// + /// Authorization and Policiy ... + /// + /// + public string RequiredPolicy { get; set; } = string.Empty; + public XAiMcpToolAttribute(string name = null) { Name = name; diff --git a/Models/XAiMcpToolDescriptor.cs b/Models/XAiMcpToolDescriptor.cs index 0bad13f..001218a 100644 --- a/Models/XAiMcpToolDescriptor.cs +++ b/Models/XAiMcpToolDescriptor.cs @@ -10,6 +10,8 @@ namespace xAiModels.Models public string Name { get; set; } public string Description { get; set; } public JObject InputSchema { get; set; } + public string RequiredPolicy { get; set; } + public bool RequiresAuthentication { get; set; } = false; public Func> Execute { get; set; } } } \ No newline at end of file