Skip to content

Commit

Permalink
feat(experimentalIdentityAndAuth): update `HttpAuthSchemeParametersPr…
Browse files Browse the repository at this point in the history
…ovider` to use Smithy context
  • Loading branch information
Steven Yuan authored and syall committed Sep 15, 2023
1 parent 1fad7e5 commit 94f2e72
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ private void generateDefaultHttpAuthSchemeParametersProviderFunction() {
Paths.get(".", serviceSymbol.getNamespace()));
w.addDependency(TypeScriptDependency.EXPERIMENTAL_IDENTITY_AND_AUTH);
w.addImport("HttpAuthSchemeParametersProvider", null, TypeScriptDependency.EXPERIMENTAL_IDENTITY_AND_AUTH);
w.addDependency(TypeScriptDependency.UTIL_MIDDLEWARE);
w.addImport("getSmithyContext", null, TypeScriptDependency.UTIL_MIDDLEWARE);
w.openBlock("""
/**
* @internal
Expand All @@ -142,7 +144,7 @@ private void generateDefaultHttpAuthSchemeParametersProviderFunction() {
serviceName, serviceSymbol.getName(), serviceName,
() -> {
w.openBlock("return {", "};", () -> {
w.write("operation: context.commandName,");
w.write("operation: getSmithyContext(context).operation as string,");
for (HttpAuthScheme authScheme : authIndex.getSupportedHttpAuthSchemes().values()) {
for (HttpAuthSchemeParameter parameter : authScheme.getHttpAuthSchemeParameters()) {
w.write("$L: $C,", parameter.name(), parameter.source());
Expand Down

0 comments on commit 94f2e72

Please sign in to comment.