Skip to main content

Definition

Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Configuration Inheritance: System.Object

Syntax

Summary

Configuration for IP address restrictions and access control.

Remarks

IP restriction configuration allows controlling access to the MCP server based on client IP addresses. This provides an additional security layer by allowing or blocking requests from specific IP ranges.

Constructors

.ctor

Syntax

.ctor Inherited

Inherited from object

Syntax

Properties

AllowedIpRanges

Gets or sets the list of allowed IP address ranges.

Syntax

Property Value

Type: System.Collections.Generic.List<string> A collection of IP ranges in CIDR notation that are allowed access.

Remarks

IP ranges should be specified in CIDR notation (e.g., “192.168.1.0/24”). Individual IP addresses can be specified with /32 suffix (e.g., “192.168.1.100/32”).

BlockedIpRanges

Gets or sets the list of blocked IP address ranges.

Syntax

Property Value

Type: System.Collections.Generic.List<string> A collection of IP ranges in CIDR notation that are blocked from access.

Remarks

Blocked IP ranges take precedence over allowed ranges. If an IP address matches both an allowed and blocked range, access will be denied.

Enabled

Gets or sets a value indicating whether IP restrictions are enabled.

Syntax

Property Value

Type: bool true to enable IP restrictions; otherwise, false.

Remarks

When enabled, only requests from allowed IP ranges will be accepted, and requests from blocked IP ranges will be rejected.

Methods

Clone

Creates a copy of this IP restriction configuration.

Syntax

Returns

Type: Microsoft.OData.Mcp.Core.Configuration.IpRestrictionConfiguration A new instance with the same settings.

Equals Inherited Virtual

Inherited from object

Syntax

Parameters

Returns

Type: bool

Equals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

GetHashCode Inherited Virtual

Inherited from object

Syntax

Returns

Type: int

GetType Inherited

Inherited from object

Syntax

Returns

Type: System.Type

MemberwiseClone Inherited

Inherited from object

Syntax

Returns

Type: object

MergeWith

Merges another IP restriction configuration into this one.

Syntax

Parameters

ReferenceEquals Inherited

Inherited from object

Syntax

Parameters

Returns

Type: bool

ToString Inherited Virtual

Inherited from object

Syntax

Returns

Type: string?

Validate

Validates the IP restriction configuration.

Syntax

Returns

Type: System.Collections.Generic.IEnumerable<string> A collection of validation errors, or empty if the configuration is valid.