We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c989e2 commit 1ff4850Copy full SHA for 1ff4850
packages/smithy-aws-core/src/smithy_aws_core/auth/sigv4.py
@@ -1,7 +1,7 @@
1
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
# SPDX-License-Identifier: Apache-2.0
3
import re
4
-from typing import TYPE_CHECKING, Protocol
+from typing import TYPE_CHECKING, Protocol, Self
5
6
from aws_sdk_signers import AsyncEventSigner, AsyncSigV4Signer, SigV4SigningProperties
7
from smithy_core.aio.interfaces.auth import AuthScheme, EventSigner, Signer
@@ -117,3 +117,7 @@ def event_signer(
117
initial_signature=signature.encode("utf-8"),
118
event_encoder_cls=EventHeaderEncoder,
119
)
120
+
121
+ @classmethod
122
+ def from_trait(cls, trait: SigV4Trait, /) -> Self:
123
+ return cls(service=trait.name)
0 commit comments