Skip to content

Dynamic client fixes - #1328

Merged
mtdowling merged 2 commits into
mainfrom
dynamic-client-fixes
Aug 19, 2026
Merged

Dynamic client fixes#1328
mtdowling merged 2 commits into
mainfrom
dynamic-client-fixes

Conversation

@mtdowling

Copy link
Copy Markdown
Member

What behavior changes?

Describe the observable difference in behavior before and after this change.

DynamicClient gains two capabilities:

  1. Per-operation auth. Effective auth schemes are now resolved per operation instead of only at the service level. Operation-level @auth overrides, @auth([]) (no-auth), and @optionalAuth are honored, matching what a code-generated client does. Auth-scheme detection now registers all schemes defined on the service, not just the service default.
  2. Event streams end-to-end. A dynamic client can now send/receive @streaming union event streams (input, output, and bidirectional). Previously, decoding an output event stream on the dynamic path threw IllegalStateException: Schema does not have a shape builder; now each event variant is built from the runtime model as a schema-backed document. The DynamicClient javadoc no longer claims streaming is unsupported.

Why is this change needed?

Explain the motivation: bug, feature request, refactor, performance, etc.

  1. Service-level-only auth meant @auth/@optionalAuth/@auth([]) operations were signed incorrectly or over-broadly.
  2. Event-stream operations were effectively unusable on the dynamic path.

How was this validated?

List tests added, benchmarks run, or manual verification performed.

Tests and also live calls to BedRock.

What should reviewers focus on?

Point reviewers to the files or sections that contain the interesting logic.

  • dynamic-schemas/.../SchemaConverter.java — the core fix: attaching a builderSupplier to dynamic struct/union schemas. Confirm there's no unintended effect from dynamic schemas now returning a non-null shapeBuilder() (verified nothing branches on shapeBuilder == null to detect the dynamic path).
  • protocol-test-harness/.../EventStreamClientTestsProtocolTestProvider.java — running both modes; note the transport is now bound at execution time (not generation) so per-mode contexts don't clobber each other's PlaceHolderTransport.
  • protocol-test-harness/.../TestFilter.java — new mode-aware skipTestCase(EventStreamTestCase, TestMode) overload.
  • client/dynamic-client/.../DynamicOperation.java — the one-line switch to the operation-aware, NO_AUTH_AWARE ServiceIndex overload.

Additional Links

Related issues, design docs, or prior art.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Use ServiceIndex.getEffectiveAuthSchemes(service, operation,
NO_AUTH_AWARE) so @auth overrides, @auth([]), and @optionalAuth are
honored, and register all service auth schemes (getAuthSchemes) during
detection. A service that models no auth now resolves to noAuth like a
code-generated client; update SmithyCallTest accordingly.
Attach a builder supplier to dynamic struct/union schemas so
Schema#shapeBuilder() works off a runtime model, letting the AWS event
decoder build event variants on the dynamic path. Run the event-stream
client protocol tests in dynamic mode and fix the DynamicClient javadoc.
@mtdowling
mtdowling force-pushed the dynamic-client-fixes branch from b4fea1b to 38aa34c Compare August 17, 2026 21:12
@mtdowling
mtdowling merged commit 14a61e1 into main Aug 19, 2026
5 checks passed
@mtdowling
mtdowling deleted the dynamic-client-fixes branch August 19, 2026 15:58
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