Definition
Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Configuration Inheritance: System.ObjectSyntax
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
objectSyntax
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
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
obj | object? | - |
Returns
Type:bool
Equals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
GetHashCode Inherited Virtual
Inherited from
objectSyntax
Returns
Type:int
GetType Inherited
Inherited from
objectSyntax
Returns
Type:System.Type
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
MergeWith
Merges another IP restriction configuration into this one.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
other | Microsoft.OData.Mcp.Core.Configuration.IpRestrictionConfiguration | The configuration to merge into this one. |
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
ToString Inherited Virtual
Inherited from
objectSyntax
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.