1273 get thumbnail attechment shell - #198
Open
mm-omdi wants to merge 74 commits into
Open
Conversation
…nhance asset ID queries
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Refactor the return statement in `SubmodelRepositoryService.cs` to use the C# 8.0 range operator for improved collection handling. Add comprehensive unit tests in `GetAllSubmodelsControllerTests.cs` to cover various scenarios for the `GetAllSubmodelsAsync` method, including handling of query parameters, paging, and exception cases. Utilize `NSubstitute` for mocking and `Xunit` for test structuring.
…th semaphore and add configuration for concurrent operations limit
Introduce `_templateManagementOptions` in `SubmodelRepositoryServiceTests` to configure `TemplateManagementConfig` with a `ServiceInstance` and `ConcurrentOperationsLimit`. Update the constructor of `SubmodelRepositoryService` to include the new parameter. Add necessary using directives for configuration and options handling.
…tAllSubmodelsAsync functionality and improve request handling
…mplateAsync and adjust request paths
…SubmodelTemplateAsync for improved query handling
…cluding adjustments to semaphore release and data structure initialization.
…ginServices for better dependency management; add FileSizeExceededException and InvalidFileUrlException for improved error handling; update appsettings.json to configure max file attachment size.
…ttachmentAsync method; improve null handling for submodel ID; enhance file size validation logic in SubmodelRepositoryService; adjust HTTP client configuration for plugins.
…load endpoint; improve response descriptions; correct max file attachment size in configuration files.
…nd validate asset thumbnails
- Implemented tests for FileAttachmentStreamProvider to verify response headers and content stream reading. - Added tests for MaxLengthStream to ensure it correctly enforces maximum byte limits and throws exceptions when exceeded. - Refactored SubmodelRepositoryHandler to streamline file attachment retrieval logic. - Updated FileSizeExceededException and InvalidFileUrlException to simplify constructors and messages. - Introduced MaxLengthStream class to limit stream reading to a specified byte size. - Modified SubmodelRepositoryService to enhance file URL validation and response handling. - Updated JSON test data to remove Google Docs viewer URLs in favor of direct file URLs. - Adjusted SQL load script to reflect changes in document URL handling.
… invalid file element types and empty file URLs.
…treamline thumbnail retrieval and validation
…erface and FileContentProvider class; update SubmodelRepositoryService to use new provider; add unit tests for MaxLengthStream and FileContentProvider.
…r; update exception classes by removing unnecessary comments and whitespace.
…mResult, FileAttachmentResult, and FileContentResponse classes; refactor SubmodelRepositoryService and related components; update exception handling for file size limits; remove obsolete exceptions.
…ControllerTests and SubmodelRepositoryHandlerTests to use new FileContentResponse and LimitedFileStreamResult; adjust assertions and exception handling for improved clarity and accuracy.
…od to return FileStreamResult instead of LimitedFileStreamResult; modify related unit tests for consistency and clarity.
Renamed FileStreamResult to FileContentStreamResult and updated all references, including controller logic and tests, to ensure consistent handling of file attachments with the new result type.
…SuccessStatusCode with explicit check for success status and throw InternalDataProcessingException on failure.
Replaces direct HTTP streaming with IFileContentProvider and FileAttachmentResult abstractions. Controller now uses FileContentStreamResult with OpenTelemetry tracing. Improves error handling for invalid URLs and removes obsolete code and dependencies. Updates usings for consistency.
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
…ovider with IFileContentProvider and update related methods
…viders with Shared.Providers and update related services
…ean up file content provider by removing unused content type variable
…sts: update expected content type to application/octet-stream and streamline file content retrieval
|
Test & Coverage ReportTest Results Summary
Code CoverageUnit Tests Coverage
Minimum allowed line rate is Module Tests Coverage
|
mm-omdi
marked this pull request as ready for review
August 7, 2026 07:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This pull request introduces and tests the new "Get Thumbnail By Id" API endpoint for the AAS Repository, which allows clients to retrieve the thumbnail image for a given Asset Administration Shell (AAS) by its identifier. The changes include the addition of example API requests, new unit and integration tests, and necessary dependency injections to support streaming thumbnail files.
Key changes include:
API Additions
Get Thumbnail By Id.bru) for different products in the API collection, demonstrating how to call the new thumbnail endpoint with various AAS identifiers. [1] [2] [3]Integration and Unit Testing
AasRepositoryControllerTests.csto verify:AasRepositoryControllerTests.cs,AasRepositoryHandlerTests.cs, andAasRepositoryServiceTests.csto ensure:Dependency Injection and Mocks
IFileAttachmentStreamProviderin test setups to support streaming thumbnail files in tests. [1] [2] [3] [4]IHttpContextAccessorand configuration options for file attachment size. [1] [2]Minor Improvements
These changes ensure the new thumbnail retrieval endpoint is robustly covered by tests and ready for integration.