Skip to content

Add proxy support to NOAA clients via UseProxy option - #9

Merged
alex1ozr merged 4 commits into
mainfrom
add_noaa_proxy
Aug 15, 2026
Merged

Add proxy support to NOAA clients via UseProxy option#9
alex1ozr merged 4 commits into
mainfrom
add_noaa_proxy

Conversation

@alex1ozr

@alex1ozr alex1ozr commented Aug 14, 2026

Copy link
Copy Markdown
Member

Summary

Adds optional proxy routing for NOAA HTTP clients through AuroraScienceHub.Framework.Http.Proxy.

Changes

NoaaClientOptions

  • New UseProxy option (default false). When enabled, client requests are routed through the proxy configured in the Proxy section.

ServiceCollectionExtensions

  • Breaking: AddNoaaClients() now accepts IConfiguration; NoaaClientOptions and ProxyOptions are bound directly from the provided instance, so the method is self-contained (no dependency on IConfiguration being registered in DI).
  • Clients are registered with ConfigurePrimaryHttpProxyMessageHandler() when UseProxy is enabled.

Sample & docs

  • Updated NoaaClientSample and the main README to the new AddNoaaClients(configuration) signature.
  • Documented UseProxy / Proxy sections in the package README; flagged the signature change in the changelog.

Tests

  • New ServiceCollectionExtensionsTests covering: proxy disabled, proxy address applied, credentials applied, and missing-address fast-fail (InvalidOperationException) — verified without registering IConfiguration in DI.

Notes

  • The AddNoaaClients() signature change is intentional: the proxy handler is only configured at registration when UseProxy is enabled, so the flag must be read eagerly.

Introduce NoaaClientOptions.UseProxy; when enabled, NOAA client
requests are routed through the proxy from the Proxy section using
AuroraScienceHub.Framework.Http.Proxy. The registration now reads
configuration, so AddNoaaClients(IConfiguration) is required.

Update the sample and package README, and add unit tests covering
disabled proxy, proxy address, credentials, and the missing-address
fast-fail case.

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 14, 2026 10:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds opt-in proxy routing support for the NOAA HTTP clients by introducing a UseProxy flag in NoaaClientOptions and conditionally wiring the framework proxy message handler during DI registration.

Changes:

  • Added NoaaClientOptions.UseProxy and updated AddNoaaClients to conditionally configure proxy handling.
  • Registered proxy options and updated the sample to the new AddNoaaClients(IConfiguration) signature.
  • Added unit tests for proxy disabled/enabled, credentials, and missing-address fast-fail; updated package README and changelog.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/UnitTests/NoaaClient/ServiceCollectionExtensionsTests.cs Adds coverage for proxy wiring behavior and failure mode when proxy config is incomplete.
src/NoaaClient/ServiceCollectionExtensions.cs Adds proxy option registration and conditional primary handler proxy configuration; changes DI registration signature.
src/NoaaClient/README.md Documents UseProxy and Proxy configuration and updates DI registration example.
src/NoaaClient/NoaaClientOptions.cs Introduces the UseProxy option on NOAA client options.
samples/NoaaClientSample/Program.cs Updates sample registration to pass configuration into AddNoaaClients.
CHANGELOG.md Documents the newly added proxy support option (but should also call out the breaking signature change).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/NoaaClient/ServiceCollectionExtensions.cs Outdated
Comment thread src/NoaaClient/README.md
Comment thread CHANGELOG.md
alex1ozr and others added 3 commits August 14, 2026 15:32
BindConfiguration reads IConfiguration from the DI container at resolve
time, which would break when a consumer passes configuration to
AddNoaaClients without registering it. Bind both NoaaClientOptions and
ProxyOptions directly from the passed instance instead, making the
method self-contained. The test helper no longer registers
IConfiguration, exercising exactly that scenario.

Co-Authored-By: Claude <noreply@anthropic.com>
Add a Changed entry to the Unreleased changelog calling out that
AddNoaaClients now requires IConfiguration, and update the main README
quick example to pass builder.Configuration.

Co-Authored-By: Claude <noreply@anthropic.com>
Set PackageBaseVersion to 1.3.0 and turn the Unreleased changelog
section into the 1.3.0 release (proxy support + breaking
AddNoaaClients(IConfiguration) signature change), fixing the missing
1.2.2 compare link.

Co-Authored-By: Claude <noreply@anthropic.com>
@alex1ozr
alex1ozr merged commit 475c9fb into main Aug 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants