Skip to content

Commit 80b891a

Browse files
committed
Wire up signers
1 parent 05673d6 commit 80b891a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

codegen/core/src/main/java/software/amazon/smithy/python/codegen/integrations/RestJsonProtocolGenerator.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,12 +397,24 @@ public void wrapInputStream(GenerationContext context, PythonWriter writer) {
397397
writer.addImport("smithy_core.aio.types", "AsyncBytesReader");
398398
writer.addImport("smithy_core.types", "TimestampFormat");
399399
writer.addImport("aws_event_stream.aio", "AWSEventPublisher");
400+
writer.addImport("aws_sdk_signers", "AsyncEventSigner");
400401
writer.write(
401402
"""
403+
# TODO - Move this out of the RestJSON generator
404+
ctx = request_context
405+
signer_properties = ctx.properties.get("signer_properties") # type: ignore
406+
identity = ctx.properties.get("identity") # type: ignore
407+
signature = ctx.properties.get("signature") # type: ignore
408+
signer = AsyncEventSigner(
409+
signing_properties=signer_properties, # type: ignore
410+
identity=identity, # type: ignore
411+
initial_signature=signature, # type: ignore
412+
)
402413
codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
403414
publisher = AWSEventPublisher[Any](
404415
payload_codec=codec,
405416
async_writer=request_context.transport_request.body, # type: ignore
417+
signer=signer, # type: ignore
406418
)
407419
""");
408420
}
@@ -428,4 +440,3 @@ public void wrapOutputStream(GenerationContext context, PythonWriter writer) {
428440
)
429441
""");
430442
}
431-
}

0 commit comments

Comments
 (0)