Debugging TokenAuthenticator in API Connector Development

Summary

User is developing an API connector using TokenAuthenticator but is not seeing the expected authentication headers in the debug output when running the read command. The issue may relate to the configuration of the TokenAuthenticator.


Question

I am developing a connector to an API. The API uses an API Key set as the Bearer Token in the request Header. The request itself is a POST request with some pagination. I am in the process of debugging. For some reason when I run:

python main.py read --config secrets/config.json --catalog integration_tests/configured_catalog.json --debug

The debug message shows the request.headers according to https://github.com/airbytehq/airbyte/blob/5c77501b0a41361edb6293439b870cf0618c37e7/airbyte-cdk/python/airbyte_cdk/sources/streams/http/http.py#L355C2-L357|http.py and my assumption is it would show the auth headers as well, However, I am not seeing any auth headers from the authenticator when set. Below is the code I am using to set up the TokenAuthenticator. Am I missing something?


.....

def streams(self, config: Mapping[str, Any]) -> List[Stream]:
        auth = TokenAuthenticator(token=config["api_key"])
        return [Contacts(authenticator=auth, config=config)]```

<br>

---

This topic has been created from a Slack thread to give it more visibility.
It will be on Read-Only mode here. [Click here](https://airbytehq.slack.com/archives/C021JANJ6TY/p1703283408535929) if you want
to access the original thread.

[Join the conversation on Slack](https://slack.airbyte.com)

<sub>
['api-connector', 'token-authenticator', 'debugging', 'bearer-token', 'http-request']
</sub>