Hi, I been trying to use a custom authenticator as...
# singer-tap-development
s
Hi, I been trying to use a custom authenticator as per the documentation here request-aws4auth . I am stuck with how I get the resultant AWS4Auth object adding in the required requests auth= parameter. The tap is an enhancement to tap-rest-api-msdk where I am adding support to access a AWS end-point. My feature branch is located here: https://github.com/s7clarke10/tap-rest-api-msdk/tree/feature/add_aws_authentication. When I run this block of code with a basic request passing in the
auth=
the request works and I receive my desired results as the appropriate AWS credentials were added to the request. https://github.com/s7clarke10/tap-rest-api-msdk/blob/06105b1c1ed45dc98ae35940acbab3e14c21293f/tap_rest_api_msdk/tap.py#L554
Copy code
r = requests.get(self.config["api_url"] + path, auth=self.aws_auth, params=params, headers=headers)
However when I attempt to set this authenticator it does appear to set any AWS credential in the request as I would like. https://github.com/s7clarke10/tap-rest-api-msdk/blob/06105b1c1ed45dc98ae35940acbab3e14c21293f/tap_rest_api_msdk/tap.py#L655
Copy code
return AWS4Auth(
                self.aws_connection.credentials.access_key,
                self.aws_connection.credentials.secret_key,
                self.aws_connection.region,
                self.aws_connection.aws_service,
                aws_session=self.aws_connection.credentials.token
            )
The SDK documentation suggested I should be able to use other authenticators like aws4auth. Some guidance would be so helpful, I have been really banging my head against the wall on this. Note: All the other extensions I have added to this tap like supporting multiple forms of authentication and paginators do work really well. Just needing to get AWS Authentication working as well via this method using AWS4AUTH as I require signed credential. Thanks 😀