Artifact Registry tools for PyPI
This repository contains an alternate keyring backend implementation to help with interacting with PyPI Repositories hosted on Artifact Registry.
Authentication
keyrings.google-artifactregistry-auth is a python package which allows you to configure keyring to interact with PyPI repositories stored in Artifact Registry.
The backend automatically searches for credentials from the environment and authenticates to Artifact Registry. It looks for credentials in the following order:
- Google Application Default Credentials.
- From the
gcloudSDK. (i.e., the access token printed viagcloud config config-helper --format='value(credential.access_token)')- Hint: You can see which account is active with the command
gcloud config config-helper --format='value(configuration.properties.core.account)'
- Hint: You can see which account is active with the command
- If neither of them exist, an error occurs.
To use the keyring backend:
-
Log in
Option 1: log in as a service account:
(1). Using a JSON file that contains a service account key:
`$ export GOOGLE_APPLICATION_CREDENTIALS=[path/to/key.json]`(2). Or using gcloud:
`$ gcloud auth application-default login`Option 2: log in as an end user via gcloud:
`$ gcloud auth login` -
Configure twine (.pypirc) and pip (pip.conf) tools to connect to the repository. Use the output from the following command:
gcloud alpha artifacts print-settings pypiIn your
.pypircfile add:[disutils] index-servers = REPOSITORY_ID [REPOSITORY_ID] repository: https://LOCATION-pypi.pkg.dev/PROJECT_ID/REPOSITORY_ID/In your
pip.conffile add:[global] index-url = https://LOCATION-pypi.pkg.dev/PROJECT_ID/REPOSITORY_ID/simple/ -
Install the keyrings.google-artifactregistry-auth package
pip install keyrings.google-artifactregistry-auth
List backends to confirm the installation.
`keyring --list-backends`
The list should include
-`ChainerBackend(priority:10)`
-`GooglePyPIAuth(priority:9)`
Metadata
Release files for keyrings.google-artifactregistry-auth-legacy 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| keyrings.google_artifactregistry_auth_legacy-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for keyrings.google_artifactregistry_auth_legacy-0.0.1-py3-none-any.whl |
Release files / keyrings.google_artifactregistry_auth_legacy-0.0.1-py3-none-any.whl
| Download URL | keyrings.google_artifactregistry_auth_legacy-0.0.1-py3-none-any.whl |
|---|---|
| Size | 26.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
108e925debb873d6b805c3feb610b8de9a6e1995744480a27d3bfc43ccf43fad
|
|
BLAKE2b-256 checksum How to use checksums |
8ee8423e139c79b88b1cc542ddd4b142cc8cd6143b831f91292b160304c303f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.24.0 setuptools/49.1.3 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.2
|
Security for keyrings.google-artifactregistry-auth-legacy 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.