Skip to content

Commit 2c88d7a

Browse files
localdenhalter73
andauthored
Update src/ModelContextProtocol.AspNetCore/Authentication/McpAuthenticationOptions.cs
Co-authored-by: Stephen Halter <[email protected]>
1 parent 253f5d5 commit 2c88d7a

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

src/ModelContextProtocol.AspNetCore/Authentication/McpAuthenticationOptions.cs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -87,41 +87,6 @@ public Func<HttpContext, ProtectedResourceMetadata>? ProtectedResourceMetadataPr
8787
set => _resourceMetadataProvider = value;
8888
}
8989

90-
/// <summary>
91-
/// Sets a static resource metadata instance that will be returned for all requests.
92-
/// </summary>
93-
/// <param name="metadata">The static resource metadata to use.</param>
94-
/// <returns>The current options instance for method chaining.</returns>
95-
/// <remarks>
96-
/// This is a convenience method equivalent to setting the <see cref="ResourceMetadata"/> property.
97-
/// </remarks>
98-
/// <exception cref="ArgumentNullException">Thrown when metadata is null.</exception>
99-
/// <exception cref="ArgumentException">Thrown when the Resource property of the metadata is null.</exception>
100-
public McpAuthenticationOptions UseStaticResourceMetadata(ProtectedResourceMetadata metadata)
101-
{
102-
ArgumentNullException.ThrowIfNull(metadata);
103-
if (metadata.Resource == null)
104-
{
105-
throw new ArgumentException("The Resource property of the metadata cannot be null. A valid resource URI is required.", nameof(metadata));
106-
}
107-
108-
ResourceMetadata = metadata;
109-
return this;
110-
}
111-
112-
/// <summary>
113-
/// Sets a delegate to dynamically provide resource metadata for each request.
114-
/// </summary>
115-
/// <param name="provider">A delegate that returns resource metadata for a given HTTP context.</param>
116-
/// <returns>The current options instance for method chaining.</returns>
117-
/// <remarks>
118-
/// This is a convenience method equivalent to setting the <see cref="ProtectedResourceMetadataProvider"/> property.
119-
/// </remarks>
120-
public McpAuthenticationOptions UseDynamicResourceMetadata(Func<HttpContext, ProtectedResourceMetadata> provider)
121-
{
122-
ProtectedResourceMetadataProvider = provider ?? throw new ArgumentNullException(nameof(provider));
123-
return this;
124-
}
12590

12691
/// <summary>
12792
/// Gets the resource metadata for the current request.

0 commit comments

Comments
 (0)