Poetry - Private Packages
For Aikido to update dependencies that include private packages, it needs access to your private registries so it can generate accurate lockfile updates. For Poetry, you can provide a Google Artifact Registry configuration service key or provide environment variables in Aikido.
Adding credentials with environment variables
When the credentials to connect to the private registry are static, you can provide them in environment variables. The environment variables should be created in the following format:
POETRY_HTTP_BASIC_[SOURCE_NAME]_USERNAMEPOETRY_HTTP_BASIC_[SOURCE_NAME]_PASSWORD
Where the [SOURCE_NAME] is the name of the data source which you specified in your pyproject.toml file in uppercase. For example, set POETRY_HTTP_BASIC_ARTIFACT_USERNAME and POETRY_HTTP_BASIC_ARTIFACT_PASSWORD for the following project file:
[[tool.poetry.source]]
name = "artifact"
url = "https://repo-1234567890.d.codeartifact.eu-west-1.amazonaws.com/pypi/poetry/simple/"You can configure the Poetry environment variables in Aikido by following the steps below:
Go to your account's settings page for AutoFix in Aikido, here.
Click on "Connect Registry", the configuration modal will now be shown

Select Poetry and you can now add the
POETRY_HTTP_BASIC_[SOURCE_NAME]_USERNAMEandPOETRY_HTTP_BASIC_[SOURCE_NAME]_PASSWORDenvironment variables:

Click Connect Registry to save the environment variables.
If you are using AWS CodeArtifact in combination with Poetry, the password needs to be generated on-the-fly, see this page on how to configure Poetry with AWS CodeArtifact.
When creating a PR via Autofix, Aikido will include these environment variables when running Poetry commands.
Adding credentials for GCP Artifact Registry
For GCP Artifact registry, credentials can not be generated statically. In this case you can follow the steps below.
1. Create a Service Account in GCP
First, create a service account in your Google Cloud project:
Go to the Google Cloud Console.
Navigate to IAM & Admin > Service Accounts.
Click Create Service Account.
Fill in a Service account name such as
Aikido Artifact Registry Readerand click Create And Continue.Grant the service account with the Artifact Registry Reader role.

Assigning the "Artifact Registry Reader" role to a service account in a Google Cloud project. Click Continue and Done.
2. Create a Key for the Service Account in GCP
On the Service Accounts page, find the service account you just created.
Click on the three dots on the right and select Manage Keys.
Click Add Key > Create New Key.
Choose JSON and click Create.
Save the JSON key file to a secure location.
3. Configuration in Aikido
Once the prerequisites are fulfilled, you can configure aikido to authenticate with your private registry when updating the dependencies by following the steps below:
Go to your account's settings page for the autofixer in Aikido, here.
Click on "Connect Registry", the configuration modal will now be shown

Select Poetry and find the
GCP service account keysection at the bottom of the modal:

Paste your saved JSON Key content in the Private registry service account key field
Click Connect Registry to save the configuration.
Last updated
Was this helpful?