Add NATS support for Async Minion and secretName for remote artifact import - #148
Add NATS support for Async Minion and secretName for remote artifact import#148versussun wants to merge 3 commits into
Conversation
|
Welcome to the Microcks community! 💖 Thanks and congrats 🎉 for opening your first pull request here! Be sure to follow the pull request template or please update it accordingly. Hope you have a great time there! |
There was a problem hiding this comment.
Pull request overview
This PR extends the Microcks Aspire integration by adding NATS support for the Async Minion configuration and by enhancing remote artifact import to optionally authenticate using a Microcks-registered secret.
Changes:
- Added
WithNatsConnection()to configure Async Minion environment variables for NATS and appended NATS toASYNC_PROTOCOLS. - Extended remote artifact import APIs to accept a
secretNameand wired it through from remote artifact annotations to the download endpoint call. - Updated README documentation to describe NATS usage and marked NATS as supported in the features table; added unit tests for NATS protocol configuration.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Microcks.Aspire.Tests/Features/Async/MicrocksAsyncProtocolsConfigurationTests.cs | Adds unit tests validating NATS environment variable/protocol list configuration. |
| src/Microcks.Aspire/MicrocksAsyncMinionExtensions.cs | Introduces WithNatsConnection() and ASYNC_PROTOCOLS updates for NATS. |
| src/Microcks.Aspire/MicrocksApplicationEventingSubscriber.cs | Passes SecretName through when importing remote artifacts. |
| src/Microcks.Aspire/Clients/MicrocksClient.cs | Threads secretName through to the download endpoint call. |
| src/Microcks.Aspire/Clients/IMicrocksClient.cs | Updates public client API to include secretName for remote artifact import. |
| src/Microcks.Aspire/Clients/IDownloadArtifactEndpoint.cs | Adds optional secretName query parameter to the download API call. |
| README.md | Documents NATS usage and updates supported protocols table. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| var builder = DistributedApplication.CreateBuilder(args); | ||
|
|
||
| // Add a NATS broker | ||
| var nats = builder.AddNats("nats"); |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Signed-off-by: Вячеслав <versussun@gmail.com>
|
@SebastienDegodez @lbroudoux Guys please aproove PR. It blocks me. Because I need secret authorization. I`ve checked it in Azure DevOps and it is working fine. And also can you push it to NUGET. Please. |
Description
WithNatsConnection()extension to configure the Microcks Async Minion against a NATS broker (server, port, optional username/password), following the same pattern as the existing MQTT connection helper, and mark NATS as supported (✅) in the README features table.secretNameparameter toImportRemoteArtifactAsync/IDownloadArtifactEndpoint.DownloadArtifactAsyncso remote artifact imports can authenticate against a Microcks-registered secret, and pass it through fromRemoteArtifactannotations inMicrocksApplicationEventingSubscriber.natsbinding, credentials, contract testing example) in the README.ASYNC_PROTOCOLS.Related issue(s)
Test results
dotnet test→ 40 passed, 1 failed, 41 total.Failed:
Microcks.Aspire.Tests.Features.Async.Kafka.MicrocksKafkaTests.WhenBadMessageIsSent_ThenReturnsCorrectStatusPre-existing test, unrelated to this change (file not touched by this PR). Fails consistently locally
due to a fixed 500ms delay +
events.Count >= 4timing assumption that appears sensitive to localcontainer/environment speed; reproduced identically in isolation.
All new NATS-related unit tests pass:
WhenOnlyNatsIsConfigured_ThenAsyncProtocolsContainsNatsWhenNatsIsConfiguredWithCredentials_ThenUsernameAndPasswordAreSetWhenNatsAndKafkaAreConfigured_ThenAsyncProtocolsContainsAll