Definition
Assembly: Microsoft.OData.Mcp.Core.dll Namespace: Microsoft.OData.Mcp.Core.Configuration Inheritance: System.ObjectSyntax
Summary
Configuration for input validation and sanitization.Remarks
Input validation configuration controls how user-provided data is validated and sanitized before processing. This helps prevent injection attacks, data corruption, and ensures data integrity throughout the application.Constructors
.ctor
Syntax
.ctor Inherited
Inherited from
objectSyntax
Properties
AllowSpecialCharacters
Gets or sets a value indicating whether special characters are allowed in input.Syntax
Property Value
Type:bool
true to allow special characters; otherwise, false.
Remarks
Special characters can be used in injection attacks but may also be legitimate parts of user data. This setting controls the balance between security and functionality.EnableStrictValidation
Gets or sets a value indicating whether strict validation is enabled.Syntax
Property Value
Type:bool
true to enable strict validation; otherwise, false.
Remarks
Strict validation applies more rigorous rules to input data, rejecting potentially dangerous content. This provides better security but may be more restrictive for legitimate use cases.MaxStringLength
Gets or sets the maximum allowed length for string inputs.Syntax
Property Value
Type:int
The maximum string length in characters.
Remarks
String length limits prevent buffer overflow attacks and ensure predictable resource usage. This applies to all string inputs unless overridden by specific field validation rules.Methods
Clone
Creates a copy of this input validation configuration.Syntax
Returns
Type:Microsoft.OData.Mcp.Core.Configuration.InputValidationConfiguration
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
Lenient
Creates an input validation configuration with lenient rules.Syntax
Returns
Type:Microsoft.OData.Mcp.Core.Configuration.InputValidationConfiguration
A validation configuration suitable for environments requiring flexible input handling.
MemberwiseClone Inherited
Inherited from
objectSyntax
Returns
Type:object
MergeWith
Merges another input validation configuration into this one.Syntax
Parameters
| Name | Type | Description |
|---|---|---|
other | Microsoft.OData.Mcp.Core.Configuration.InputValidationConfiguration | The configuration to merge into this one. |
ReferenceEquals Inherited
Inherited from
objectSyntax
Parameters
| Name | Type | Description |
|---|---|---|
objA | object? | - |
objB | object? | - |
Returns
Type:bool
Strict
Creates an input validation configuration with strict rules.Syntax
Returns
Type:Microsoft.OData.Mcp.Core.Configuration.InputValidationConfiguration
A validation configuration suitable for high-security environments.
ToString Inherited Virtual
Inherited from
objectSyntax
Returns
Type:string?
Validate
Validates the input validation configuration.Syntax
Returns
Type:System.Collections.Generic.IEnumerable<string>
A collection of validation errors, or empty if the configuration is valid.