-
Notifications
You must be signed in to change notification settings - Fork 694
Add server validation of interaction inputs #10527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive server-side validation for interaction service inputs to ensure data integrity and provide clear error messages to users. The validation covers all input types with appropriate type checking and constraint enforcement.
- Validates required inputs, data types (number, boolean), choice options, and text length limits
- Adds server-side validation that runs before custom validation callbacks
- Implements a maximum text length of 8000 characters for text inputs with corresponding UI enforcement
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/Aspire.Hosting/InteractionService.cs |
Core validation logic for all input types with error handling |
src/Aspire.Hosting/IInteractionService.cs |
Defines maximum text length constant for validation |
src/Aspire.Dashboard/Components/Dialogs/InteractionsInputDialog.razor.cs |
Dashboard constant for text length matching server validation |
src/Aspire.Dashboard/Components/Dialogs/InteractionsInputDialog.razor |
UI enforcement of maximum text length on input fields |
tests/Aspire.Hosting.Tests/InteractionServiceTests.cs |
Comprehensive test coverage for all validation scenarios |
|
||
public partial class InteractionsInputDialog | ||
{ | ||
internal const int MaxTextLength = 8000; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MaxTextLength constant is duplicated between InteractionInput and InteractionsInputDialog. Consider referencing the constant from InteractionInput instead of duplicating it to maintain a single source of truth.
Copilot uses AI. Check for mistakes.
If this makes back porting harder then we shouldn’t merge this or we should backport it |
This is security hardening and should be in 9.4 |
Lets add this. |
bc9968f
to
c485449
Compare
Done |
/backport to release/9.4 |
Started backporting to release/9.4: https://github.com/dotnet/aspire/actions/runs/16387420476 |
Description
Validate interaction service input matches what is expected:
Could add configuration for a custom length in the futureThe dashboard or CLI shouldn't send these values, UI logic should prevent that from happening, but server should double check.
Checklist
<remarks />
and<code />
elements on your triple slash comments?doc-idea
templatebreaking-change
templatediagnostic
template