Skip to content

Commit

Permalink
Merge pull request #1 from Infisical/maidul-dhvgwdhwvd
Browse files Browse the repository at this point in the history
add region when signing
  • Loading branch information
maidul98 authored Aug 22, 2024
2 parents bb9e6c8 + f0a0058 commit e70e41e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions infisical_sdk/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class AWSAuth:
def __init__(self, client: InfisicalSDKClient) -> None:
self.client = client

def login(self, identity_id: str = "") -> ApiV1AuthTokenAuthIdentitiesIdentityIdTokensPost200Response:
def login(self, identity_id: str) -> ApiV1AuthTokenAuthIdentitiesIdentityIdTokensPost200Response:
"""
Login with AWS Authentication.
Expand All @@ -102,7 +102,7 @@ def login(self, identity_id: str = "") -> ApiV1AuthTokenAuthIdentitiesIdentityId

credentials = self._get_aws_credentials(session)

iam_request_url = "https://sts.amazonaws.com/"
iam_request_url = f"https://sts.{aws_region}.amazonaws.com/"
iam_request_body = "Action=GetCallerIdentity&Version=2011-06-15"
request_headers = self._prepare_aws_request(iam_request_url, iam_request_body, credentials, aws_region)

Expand Down Expand Up @@ -133,7 +133,7 @@ def _prepare_aws_request(self, url: str, body: str, credentials: Any, region: st

request = AWSRequest(method="POST", url=url, data=body)
request.headers["X-Amz-Date"] = amz_date
request.headers["Host"] = "sts.amazonaws.com"
request.headers["Host"] = f"sts.{region}.amazonaws.com"
request.headers["Content-Type"] = "application/x-www-form-urlencoded; charset=utf-8"
request.headers["Content-Length"] = str(len(body))

Expand Down Expand Up @@ -177,8 +177,8 @@ def _get_aws_ec2_identity_document_region(timeout: int = 5000) -> str:
class Auth:
def __init__(self, client):
self.client = client
self.awsAuth = AWSAuth(client)
self.universalAuth = UniversalAuth(client)
self.aws_auth = AWSAuth(client)
self.universal_auth = UniversalAuth(client)

class V3RawSecrets:
def __init__(self, client: InfisicalSDKClient) -> None:
Expand Down

0 comments on commit e70e41e

Please sign in to comment.