Poetry - Private packages
When letting Aikido update your dependencies in repositories with private packages, Aikido would need to also have access to the private packages so that we can properly update your lockfiles. For Poetry, you can provide private either a Google Artifact Registry configuration service key or provide environment varaibles in Aikido for this.
Adding credentials with environment variables
When the credentials to connect to the private registry are static, you can provide environment variables for this in the private registry connection modal. The environment variables should be created in the following format:
- POETRY_HTTP_BASIC_[SOURCE_NAME]_USERNAME
- POETRY_HTTP_BASIC_[SOURCE_NAME]_PASSWORD
Where the [SOURCE_NAME]
is the name of the data source which you specified in your pyproject.toml file.
When creating a PR via Autofix, Aikido will include these environment variables when running poetry commands.
Adding credentials for GCP Artifact Registry
For some registries, the credentials can not be generated statically, such as for GCP Artifact registry. In this case you can follow the steps below.
1. Create a Service Account
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 Reader
and click Create And Continue.Grant the service account with the Artifact Registry Reader role.
Click Continue and Done.
2. Create a Key for the Service Account
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 Manage private registry connection, the configuration modal will now be shown
Select Poetry from the tab bar
Paste your saved JSON Key content in the Private registry service account key field
Click Save to save the configuration.