Damien Harley
08/06/2024, 7:59 AMapi_key
as auth method. I want the authenticator to pull the value for the api_key
from the .env
file as it's currently stored as value in the config block in meltano.yml
. I've searched the docs but I'm at a loss as to how to do this for a custom plugin, without importing dotenv
. I've tried following examples from existing taps which appear to pull values from .env
files using self.config
If I put the key in the .env
file I get an error stating that auth_token
is a required field. Indicating that Meltano is looking through the config block but not looking through the .env
file.
@property
def authenticator(self) -> APIKeyAuthenticator:
"""Return a new authenticator object.
Returns:
An authenticator instance.
"""
return APIKeyAuthenticator.create_for_stream(
self,
key=self.config["key_name"],
value=self.config["auth_token"],
location="header",
)
Reuben (Matatika)
08/06/2024, 8:22 AM.env
(as well as other sources, like meltano.yml
):
meltano invoke my-custom-extractor
or pass the value ENV
for the --config
option if invoking the plugin directly
poetry run my-custom-extractor --config ENV
Reuben (Matatika)
08/06/2024, 8:31 AMmeltano.yml
that that plugin is picking up, I'm assuming you are already invoking it through Meltano to test, in which case a couple of things to check:
⢠.env
should be at the root of the Meltano project (same level as meltano.yml
)
⢠Environment variable name should be set to <PLUGIN_NAME>_<SETTING_NAME>
(i.e. TAP_CUSTOM_EXTRACTOR_AUTH_TOKEN
): https://docs.meltano.com/guide/configuration/#configuring-settingsDamien Harley
08/06/2024, 8:36 AM.env
wasn't in root dir of project š¤¦āāļøDamien Harley
08/06/2024, 8:36 AMReuben (Matatika)
08/06/2024, 8:37 AM