Automatically retrieve credentials for AWS CodeArtifact.
Project description
AWS CodeArtifact Keyring Backend
The keyrings.codeartifact
package provides authentication for publishing and consuming packages within a private
PyPi repository hosted on AWS CodeArtifact; it contains an extension to the
keyring library that will automatically inject a time-limited access token.
Installation
To install this package, install the "keyrings.codeartifact" package using pip
:
pip install keyrings.codeartifact
Usage
The keyring
library has been integrated with recent versions of pip and twine. Once installed, this library will
automatically supply credentials whenever pip/twine (or other keyring-enabled package) attempts to use a repository
hosted within CodeArtifact. It will use any appropriate AWS credentials provided in ~/.aws/credentials
by default.
--index-url https://${DOMAIN}-${ACCOUNT}.d.codeartifact.${REGION}.amazonaws.com/pypi/${REPOSITORY}/simple/
Config
This backend provides a number of configuration options to modify the behaviour of the AWS client.
These configuration options can be specified within a [codeartifact]
section of the keyringrc.cfg
.
Run keyring diagnose
to find its as the location; it varies between different platforms.
Available options:
profile_name
: Use a specific AWS profile to authenticate with AWS.token_duration
: Validity period (in seconds) for retieved authorization tokens.aws_access_key_id
: Use a specific AWS access key to authenticate with AWS.aws_secret_access_key
: Use a specific AWS secret access key to authenticate with AWS.
For more explanation of these options see the AWS CLI documentation.
An example keyringrc.cfg
section:
[codeartifact]
# Tokens should only be valid for 30 minutes.
token_duration=1800
# Use the 'default' profile name.
profile_name=default
# Use the following access keys.
aws_access_key_id=xxxxxxxxx
aws_secret_access_key=xxxxxxxxx
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for keyrings_codeartifact-1.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 372f30cb647f0b4a19c05129392fda06228226de92a16acc236aef33f6ffefc7 |
|
MD5 | 6ea2466b781924b05b433d264c003cad |
|
BLAKE2b-256 | dd9a120d18f06ca0ff27a9c309f51435ea3e37ec78f4c85100927a19d7898515 |
Hashes for keyrings.codeartifact-1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7102a6ccc71231c87bae97f015bc0a62bc76d608ca237b96762551e0d33f5dd |
|
MD5 | 89c24c1ca34c5524593b3dd4eee1a701 |
|
BLAKE2b-256 | f536cc643214859539d40f5556dba2c4e22d651845e894a454644f447764b227 |