Skip to content

Commit a12b2eb

Browse files
author
Steven Yuan
authored
feat(experimentalIdentityAndAuth): add event streaming input integrations relative to auth (#5578)
* feat(experimentalIdentityAndAuth): remove `AddEventStreamHandlingDependency` experimental branch * feat(experimentalIdentityAndAuth): add order for `AddWebsocketPlugin`
1 parent 7759481 commit a12b2eb

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddEventStreamHandlingDependency.java

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import software.amazon.smithy.typescript.codegen.TypeScriptDependency;
3434
import software.amazon.smithy.typescript.codegen.TypeScriptSettings;
3535
import software.amazon.smithy.typescript.codegen.TypeScriptWriter;
36+
import software.amazon.smithy.typescript.codegen.auth.http.integration.AddHttpAuthSchemePlugin;
3637
import software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;
3738
import software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;
3839
import software.amazon.smithy.utils.ListUtils;
@@ -45,20 +46,24 @@
4546
*/
4647
@SmithyInternalApi
4748
public class AddEventStreamHandlingDependency implements TypeScriptIntegration {
49+
50+
@Override
51+
public List<String> runAfter() {
52+
return List.of(AddHttpAuthSchemePlugin.class.getCanonicalName());
53+
}
54+
4855
@Override
4956
public List<RuntimeClientPlugin> getClientPlugins() {
5057
return ListUtils.of(
5158
RuntimeClientPlugin.builder()
5259
.withConventions(AwsDependency.MIDDLEWARE_EVENTSTREAM.dependency,
5360
"EventStream", HAS_CONFIG)
5461
.servicePredicate(AddEventStreamHandlingDependency::hasEventStreamInput)
55-
.settingsPredicate((m, s, settings) -> !settings.getExperimentalIdentityAndAuth())
5662
.build(),
5763
RuntimeClientPlugin.builder()
5864
.withConventions(AwsDependency.MIDDLEWARE_EVENTSTREAM.dependency,
5965
"EventStream", HAS_MIDDLEWARE)
6066
.operationPredicate(AddEventStreamHandlingDependency::hasEventStreamInput)
61-
.settingsPredicate((m, s, settings) -> !settings.getExperimentalIdentityAndAuth())
6267
.build()
6368
);
6469
}
@@ -70,10 +75,6 @@ public void addConfigInterfaceFields(
7075
SymbolProvider symbolProvider,
7176
TypeScriptWriter writer
7277
) {
73-
if (settings.getExperimentalIdentityAndAuth()) {
74-
return;
75-
}
76-
// feat(experimentalIdentityAndAuth): control branch for event stream handler interface fields
7778
if (hasEventStreamInput(model, settings.getService(model))) {
7879
writer.addImport("EventStreamPayloadHandlerProvider", "__EventStreamPayloadHandlerProvider",
7980
TypeScriptDependency.AWS_SDK_TYPES);
@@ -94,11 +95,6 @@ public Map<String, Consumer<TypeScriptWriter>> getRuntimeConfigWriters(
9495
if (!hasEventStreamInput(model, service)) {
9596
return Collections.emptyMap();
9697
}
97-
98-
if (settings.getExperimentalIdentityAndAuth()) {
99-
return Collections.emptyMap();
100-
}
101-
// feat(experimentalIdentityAndAuth): control branch for event stream handler runtime config
10298
switch (target) {
10399
case NODE:
104100
return MapUtils.of("eventStreamPayloadHandlerProvider", writer -> {

codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/AddWebsocketPlugin.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import software.amazon.smithy.typescript.codegen.TypeScriptDependency;
3232
import software.amazon.smithy.typescript.codegen.TypeScriptSettings;
3333
import software.amazon.smithy.typescript.codegen.TypeScriptWriter;
34+
import software.amazon.smithy.typescript.codegen.auth.http.integration.AddHttpAuthSchemePlugin;
3435
import software.amazon.smithy.typescript.codegen.integration.RuntimeClientPlugin;
3536
import software.amazon.smithy.typescript.codegen.integration.TypeScriptIntegration;
3637
import software.amazon.smithy.utils.ListUtils;
@@ -44,6 +45,12 @@
4445
**/
4546
@SmithyInternalApi
4647
public class AddWebsocketPlugin implements TypeScriptIntegration {
48+
49+
@Override
50+
public List<String> runAfter() {
51+
return List.of(AddHttpAuthSchemePlugin.class.getCanonicalName());
52+
}
53+
4754
@Override
4855
public List<RuntimeClientPlugin> getClientPlugins() {
4956
return ListUtils.of(

0 commit comments

Comments
 (0)